Commit Graph

12 Commits

Author SHA1 Message Date
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 70a7f736c5 python3-setuptools: Fix error when installing from source
When a Python package is installed from source (i.e. using setup.py)
into a custom location (with --home), setuptools may want to create a
site.py file in the custom location. This file is created based on the
source code of site-patch.py, a file bundled with setuptools.

Because the normal OpenWrt setuptools package does not contain Python
source code, this file is missing and the installation will end with an
error.

This copies site-patch.py to site-patch.py.txt so that it will be
included in python3-setuptools, and patches setuptools to look for this
file.

See https://github.com/openwrt/packages/issues/12223

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-05-21 20:02:13 +08:00
Alexandru Ardelean ed0e77f3c3 python,python3: split python[3]-pkg-resources from setuptools
This package is required by other packages to run some binaries via
`load_entry_point`.

So, this splits this package away from setuptools.
setuptools is pretty big, akd pkg-resources is also big, but not as big.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2019-09-20 13:42:40 +03: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 bbd4930ccd
python-python3-setuptools: 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:44:40 -03: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 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