Commit Graph

14 Commits

Author SHA1 Message Date
Alexandru Ardelean 1f317dfb75 python3: add 'ensurepip' to python3-pip sub-package
Fixes:
  https://github.com/openwrt/packages/issues/12707

Seems to work.
Looking into the 'venv' lib, it seems it's installing pip & setuptools
inside a virtual environment.

`python3-pip` is already ~6 MB.
This adds another ~3 MB.

But, this gives users the ability to run Python virtual environments, which
is a pretty common feature of Python in production cases (usually web
stuff).

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
2023-01-25 14:03:33 +02:00
Jeffery To 3c36696a56 python-packages: Add usr/bin symlinks without "3" suffix
Previously, binaries installed by Python packages will have a
non-suffixed Python 2 version and a suffixed Python 3 version, e.g. pip
and pip3. With the removal of Python 2, the non-suffixed names are no
longer taken.

This adds symlinks for the non-suffixed names linking to the suffixed
scripts (or in the case of pip, easy_install, and python-config, to the
fully-versioned scripts).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-05-22 03:57:55 +08:00
Jeffery To 932bfe4cf3 python3-pip: Symlink pip3 to pip3.8
Currently, python3-pip installs the same script as pip3 and pip3.8 to
usr/bin. This changes pip3 to be a symlink to pip3.8.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-04-04 06:21:39 +08:00
Jeffery To b8e7a197db python3-setuptools,python3-pip: Use more predictable pycache cleanup
This uses two find commands to delete __pycache__ contents then the
__pycache__ directories, rather than a for loop.

The second command omits a -empty test, so that if the first command
doesn't remove all directory contents for some reason, the second
command will return an error (find will not delete a non-empty
directory).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-05-29 22:42:02 +08:00
Jeffery To be751236aa python-setuptools,python-pip: Change prefix to /usr
This changes the --prefix option, passed to host pip when "installing"
target setuptools and pip, to /usr, in case the prefix is recorded in
the packages.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-05-29 22:38:30 +08:00
Eneas U de Queiroz 5f447b9020
python-python3-pip: add LICENSE information
CVE id was left commented out as it is not handled by uscan.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
2019-05-21 14:46:13 -03:00
Alexandru Ardelean 1b96dc0171 python3-pip: fix install rule
Fixes: https://github.com/openwrt/packages/issues/8301

This seems to have slipped for some time. No idea if it ever worked.
It could be that this worked at some point.

In any case, the shebang is properly updated now.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2019-02-27 12:18:19 +02:00
Alexandru Ardelean ed862da936 python,python3: move shebang handle in install script
This extends the Python[3] shebang fixup to all packages.
Only Python scripts in `/usr/bin` will be handled at the moment. Later it
may make sense to also cover executables in `/bin`, though typically Python
executables shouldn't be placed there.

Previously the shebang handling was only done for python[3]-pip &
python[3]-setuptools.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2019-02-12 12:31:55 +02:00
Alexandru Ardelean 1bf7679211 python,python3: make deletion tolerant for paths with spaces
Piping to xargs does not handle spaces in paths too well, because it splits
up the paths.
For deleting empty dirs, we also need to do several retries, otherwise
`find` will try to go through the directories after they're deleted.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2019-02-12 12:31:54 +02:00
Jeffery To 2f55f2a7b5 python/python3: fix .dist-info missing for setuptools and pip
Without .dist-info (similar to .egg-info), setuptools and pip are not
discoverable by pkg_resources.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2018-12-22 22:16:52 +08:00
Alexandru Ardelean a2b76b5403 python,python3: simplify `sed` expression for setuptools & pip
A suggestion from comment (from Philip Prindeville):
https://github.com/openwrt/packages/issues/4529#issuecomment-312518121

Avoids some escaping of slashes.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-03 16:11:52 +03:00
Alexandru Ardelean 0d54d05b6d python3-pip: override Package/python3-pip/install rule
This is in essence fixes pip3.

That means pip3 will ship without Python byte-codes
for a while, until I'll find a better way to fix it.

I couldn't think of a not-very hack-ish way of doing it.

The only draw-back of this, will be that pip3 will run
a bit slower ; but that should be ok for a while.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-05-19 17:28:08 +03:00
Alexandru Ardelean a4691a289c python3: remove __pycache__ folders pip & setuptools
python3-pip & python3-setuptools have slightly
different installation mechanisms.

We need to remove the __pycache__ folders.
Seems they're generated.

This also reduces the size of the python3-pip &
python3-setuptools packages.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-05-19 17:27:48 +03:00
Alexandru Ardelean 68312f49c0 python packages: move all things python under lang/python
I admit this may be be a bit aggressive, but the lang
folder is getting cluttered/filled up with Python, PHP, Perl,
Ruby, etc. packages.

Makes sense to try to group them into per-lang folders.

I took the Pythons.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-05-17 16:51:14 +03:00