Commit Graph

22 Commits

Author SHA1 Message Date
Jeffery To 2f81f907c2 python3: Add Py3Build/InstallBuildDepends recipe
This adds a recipe, Py3Build/InstallBuildDepends, that installs the
requirements listed in HOST_PYTHON3_PACKAGE_BUILD_DEPENDS. This allows
other (non-Python) packages to install host Python packages by calling
this recipe, without having to know the internals of python3-package.mk.

This also updates apparmor to call this recipe.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-03-17 11:38:19 -07:00
Jeffery To c0340f631c python: Use locked for host pip
This also removes PKG_BUILD_PARALLEL:=0 that was added for packages that
use HOST_PYTHON3_PACKAGE_BUILD_DEPENDS.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-08-31 03:48:47 -07:00
Jeffery To 722a5b8efa
python3: Use hash-checking mode when installing host pip packages
In hash-checking mode[1], pip will verify downloaded package archives
(source tarballs in our case) against known SHA256 hashes before
installing the packages.

As a consequence, this requires the use of requirements files[2] and
pinning packages to known versions.

The syntax for package Makefiles has changed slightly;
HOST_PYTHON3_PACKAGE_BUILD_DEPENDS no longer accepts requirement
specifiers like "foo>=1.0", only requirements file names (which are the
same as package names in the most common case).

This also updates affected packages, in particular:

* python-zipp: "setuptools_scm[toml]" has been split into
  "setuptools-scm toml" to reuse the requirements file for
  setuptools-scm (the extra depends installed by "setuptools_scm[toml]"
  is toml).

* python-pycparser: This previously used ply 3.10, whereas the
  requirements file will now install 3.11.

[1]: https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode
[2]: https://pip.pypa.io/en/stable/user_guide/#requirements-files

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-08-17 23:05:49 +08:00
Jeffery To e0e2224f8a
python-packages: Disable parallel build when host pip is needed
This adds PKG_BUILD_PARALLEL:=0 to packages that depend on host Python
packages (HOST_PYTHON3_PACKAGE_BUILD_DEPENDS), because installing
packages with multiple concurrent pip processes can lead to errors or
unexpected results[1].

This also:

* Move HOST_PYTHON3_PACKAGE_BUILD_DEPENDS definitions to before
  python3-package.mk is included

* Update Python folder readme to include PKG_BUILD_PARALLEL:=0

[1]: https://github.com/pypa/pip/issues/2361

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-06-30 15:43:01 +08:00
Jeffery To 6bb3e26fe2
python: Revise pypi.mk section of readme
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-06-11 16:49:56 +08:00
Jeffery To c662835372
python: Fix relative links in readme
This also removes a link to pypi.org; the previous sentence already
links to pypi.org, a second link in the same paragraph isn't necessary.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-06-11 16:36:38 +08:00
Jeffery To f9ed65d922
python: Remove references to variants in readme
Build variants are no longer necessary.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-06-11 16:23:49 +08:00
Jeffery To d4d78c2511 python3: Add script to help find standard library dependencies
This adds a script that searches a Python package's source code to find
imports for separately-packaged standard library modules.

The script can be run by calling make with the configure target and
"PY3=stdlib V=s" arguments, e.g.

    make package/python3-lxml/configure PY3=stdlib V=s

This also updates the readme on how to call this script, as well as more
information on Python package dependencies in general.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-05-14 23:38:24 +08:00
Jeffery To 8c7039fa7d python: Update readme
* Replace the Python 2 pending removal notice/schedule with a brief
  message about the removal
* Replace mentions of "Python & Python 3" with just "Python" (references
  to the version number are kept only in cases where it is necessary)
* Update Makefile example code to use Python 3 conventions/names

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-04-04 03:09:25 +08:00
Josef Schlehofer de13f35827
python: readme: drop from table of contents removed sections
Fixes: 446bc30c52 ("python: Remove
PKG_BUILD_DIR/PKG_UNPACK sections from readme")

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2020-01-27 14:26:07 +01:00
Jeffery To dad0415215 python: Fix filespec example in readme
While the filespec example is technically correct, the more likely
scenario is that the files to be omitted would be inside of a package
subdirectory.

This adds an example_package directory into the example to illustrate
this case.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-11-07 22:32:57 +08:00
Jeffery To 6f987b727f python: Add pypi.mk usage to readme
This adds documentation on including pypi.mk and its required/optional
variables to the Python section readme.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-11-05 03:28:12 +08:00
Jeffery To 446bc30c52 python: Remove PKG_BUILD_DIR/PKG_UNPACK sections from readme
PKG_BUILD_DIR now takes variants into account
(openwrt/openwrt@e545fac8d9), so it should
not be necessary for Python packages to set these variables anymore.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-11-05 02:20:37 +08:00
Jeffery To 4521b13477 python: Clarify README for Python 2-only libraries
This clarifies that Python 2-only libraries will have a Python 3 version
added, instead of being replaced by a Python 3 version (before the 2020
mass removal).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-06-19 21:09:10 +08:00
Alexandru Ardelean d607b4da7b lang: python: readme: document mechanism for corner-case python[3]-package.mk location
After some thinking over this, documenting this behavior makes sense
versus adding some functionst to handle this.
There is some validity/use-cases where some users may want to reference
a python[3]-package.mk from some other location as well as have the
flexibility to change it (locally). One example can be when the local
`packages` is renamed to something else.

This does not fall on the responsibility of the Python maintainers, but
it can be documented.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2019-05-28 21:38:01 +03:00
Eneas U de Queiroz 36d0c59e99
python: README.md: adjust recursive dep text, misc
Adding the conditionals to DEPENDS should not cause circular
dependencies any more.  This adjusts the text to point out that it used
to be a problem, and if it happens again, one should open an issue.

Also, some spotted trivial errors were fixed.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
2019-05-20 16:17:30 -03:00
Alexandru Ardelean dab8f49f82 lang/python/README.md: add note about use in other packages feeds
By popular demand, via:
   https://github.com/openwrt/packages/issues/8892#issuecomment-489992926

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2019-05-08 14:49:04 +03:00
Rosen Penev efbcf695b8
Merge pull request #8786 from commodo/readme-encodings-update
python/README.md: fix note about python[3]-codecs
2019-05-03 12:45:12 -07:00
Alexandru Ardelean d0fcfc52a1 python/README.md: fix note about python[3]-codecs
The note was note correct when mentioning encodings vs python[3]-codecs.
This change fixes this confusion.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2019-05-03 22:34:51 +03:00
Jeffery To 3a036339e8 python/README: Add deprecation notice / schedule
This describes the proposal outlined in #8520, with a few
additions/modifications:

* Describes the handling of the Python 2 interpreter

* Allows for normal updates of Python 2 libraries that share the same
  Makefile as their Python 3 version

* Mass removal event has a name

Supersedes #8788.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-05-04 02:13:11 +08:00
Jeffery To f16064783c python: Update readme
This adds more details on the PYTHON[3]_PKG_SETUP_* variables, the
filespec format, and the build/install processes in general.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-04-08 21:21:21 +08:00
Alexandru Ardelean 77bce0c672 lang/python/README.md: add doc describing the lang/python subtree
It was a semi-popular request a while back that I put off for a while.
Here's a quick doc.
I'll update it later as things change and I don't forget.
It also lets other people update if something is wrong.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2019-01-08 17:38:16 +02:00