<feed xmlns='http://www.w3.org/2005/Atom'>
<title>packages/lang/python/python3-host.mk, branch master</title>
<subtitle>Community maintained packages for OpenWrt</subtitle>
<id>http://x-nagi.com/cgit/packages/atom?h=master</id>
<link rel='self' href='http://x-nagi.com/cgit/packages/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/packages/'/>
<updated>2023-10-11T07:50:24Z</updated>
<entry>
<title>python-setuptools-rust: Set cargo profile from environment variable</title>
<updated>2023-10-11T07:50:24Z</updated>
<author>
<name>Jeffery To</name>
<email>jeffery.to@gmail.com</email>
</author>
<published>2023-10-08T12:24:38Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/packages/commit/?id=29ca9797a66f7e4d2ae40d26b91f3d1c2982a744'/>
<id>urn:sha1:29ca9797a66f7e4d2ae40d26b91f3d1c2982a744</id>
<content type='text'>
This adds a patch (submitted upstream in
https://github.com/PyO3/setuptools-rust/pull/364), to read the profile
to pass to cargo from an environment variable.

This also updates the Python include files to set the environment
variable based on values from rust-values.mk.

Signed-off-by: Jeffery To &lt;jeffery.to@gmail.com&gt;
</content>
</entry>
<entry>
<title>rust: Consolidate cargo environment variables</title>
<updated>2023-10-11T07:50:23Z</updated>
<author>
<name>Jeffery To</name>
<email>jeffery.to@gmail.com</email>
</author>
<published>2023-09-25T03:58:12Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/packages/commit/?id=9db7284d589dc8490f8c7dbe56af731fce953eda'/>
<id>urn:sha1:9db7284d589dc8490f8c7dbe56af731fce953eda</id>
<content type='text'>
This consolidates all environment variables for cargo into:

* CARGO_HOST_CONFIG_VARS / CARGO_PKG_CONFIG_VARS

  These contain all cargo-specific environment variables, i.e. without
  "common" variables like CC.

* CARGO_HOST_VARS / CARGO_PKG_VARS (renamed from CARGO_VARS)

  These contain all environment variables to be passed to cargo.

This also:

* Set the CARGO_BUILD_TARGET environment variable instead of using the
  --target command-line option

* Update Python include files to use CARGO_HOST_CONFIG_VARS /
  CARGO_PKG_CONFIG_VARS

Signed-off-by: Jeffery To &lt;jeffery.to@gmail.com&gt;
</content>
</entry>
<entry>
<title>rust: Install to $(STAGING_DIR)/host</title>
<updated>2023-10-11T07:50:22Z</updated>
<author>
<name>Jeffery To</name>
<email>jeffery.to@gmail.com</email>
</author>
<published>2023-09-22T16:02:01Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/packages/commit/?id=49aaf19c65a35c37725ead7a438684411b512d6f'/>
<id>urn:sha1:49aaf19c65a35c37725ead7a438684411b512d6f</id>
<content type='text'>
This allows rustc/cargo/etc to be called without having to set PATH, as
$(STAGING_DIR)/host/bin is already in PATH.

This also fixes CARGO_HOME not being set during Host/Configure and
Host/Compile.

Signed-off-by: Jeffery To &lt;jeffery.to@gmail.com&gt;
</content>
</entry>
<entry>
<title>python: Add environment variables to build Rust extensions</title>
<updated>2023-09-27T23:40:55Z</updated>
<author>
<name>Jeffery To</name>
<email>jeffery.to@gmail.com</email>
</author>
<published>2023-09-13T04:15:18Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/packages/commit/?id=4d43be8549c8240f5039040fd1efd44aa2eb61fa'/>
<id>urn:sha1:4d43be8549c8240f5039040fd1efd44aa2eb61fa</id>
<content type='text'>
Signed-off-by: Jeffery To &lt;jeffery.to@gmail.com&gt;
</content>
</entry>
<entry>
<title>python: Add proper support for pyproject.toml-based builds</title>
<updated>2023-04-24T08:20:33Z</updated>
<author>
<name>Jeffery To</name>
<email>jeffery.to@gmail.com</email>
</author>
<published>2023-02-17T17:13:22Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/packages/commit/?id=5156c0c82bcb18481bf588ba4b1ff67c12422a80'/>
<id>urn:sha1:5156c0c82bcb18481bf588ba4b1ff67c12422a80</id>
<content type='text'>
This removes the changes made in
61f202c0170785addbbc449e4de61cc5886f0833 and adds actual support for
pyproject.toml-based (PEP 517) builds of Python packages.

Packages can force the use of the old build process by setting
PYTHON3_PKG_FORCE_DISTUTILS_SETUP:=1; this should only be a temporary
workaround until the package can be updated/fixed to use the new build
process.

Signed-off-by: Jeffery To &lt;jeffery.to@gmail.com&gt;
</content>
</entry>
<entry>
<title>python: Better host pip options</title>
<updated>2023-03-31T05:08:39Z</updated>
<author>
<name>Jeffery To</name>
<email>jeffery.to@gmail.com</email>
</author>
<published>2023-02-20T11:10:39Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/packages/commit/?id=8c2abb74031e2403dde83536a8e7f13c63cdd4ab'/>
<id>urn:sha1:8c2abb74031e2403dde83536a8e7f13c63cdd4ab</id>
<content type='text'>
pip by default will read system-wide and per-user configuration
files[1]. Setting PIP_CONFIG_FILE=/dev/null instructs pip to not read
any config files[2].

pip will spawn child processes of itself to do work, but not all options
are passed down to the child processes[3]. Setting global options as
environment variables[4] ensures they are passed down to any child
processes.

[1]: https://pip.pypa.io/en/stable/topics/configuration/#configuration-files
[2]: https://pip.pypa.io/en/stable/topics/configuration/#pip-config-file
[3]: https://github.com/pypa/pip/issues/9081#issue-733819665
[4]: https://pip.pypa.io/en/stable/topics/configuration/#environment-variables

Signed-off-by: Jeffery To &lt;jeffery.to@gmail.com&gt;
</content>
</entry>
<entry>
<title>python: Add pyproject.toml-based builds for host Python packages</title>
<updated>2023-03-30T04:19:05Z</updated>
<author>
<name>Jeffery To</name>
<email>jeffery.to@gmail.com</email>
</author>
<published>2023-02-25T11:42:39Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/packages/commit/?id=fe78c07a316b1722b8d35b63772a7067dfd87c5e'/>
<id>urn:sha1:fe78c07a316b1722b8d35b63772a7067dfd87c5e</id>
<content type='text'>
Using pip to install host packages with pyproject.toml-based (PEP 517)
builds is problematic:

* If build isolation is used, pip will create an isolated build
  environment, install any build dependencies for the requested package,
  then build the requested package.

  It does not appear currently possible to have pip install the build
  dependencies with hash-checking mode enabled[1].

* If build isolation is not used, any build dependencies must be
  installed in the build environment before invoking pip to build the
  requested package[2].

  This would require creating a package dependency resolution system to
  install build dependencies, and any dependencies of dependencies, in
  the correct order.

* It is very difficult to patch the packages installed by pip.

This adds a new include file (python3-host-build.mk) with recipes to
install host Python packages with pyproject.toml-based builds. This is
backwards-compatible with packages that require running setup.py.

Besides addressing the above issues (the OpenWrt build system already
resolves dependencies between packages, checks all source downloads
against known hashes, and supports patching packages), host packages
also:

* Capture package licensing and maintainer information
* Enable uscan checking for package updates/CVEs
* Are a known concept for OpenWrt packagers/developers

The existing functionality of using host pip to install packages will
remain for now, but should be considered deprecated and expected to be
removed in the future.

This also updates Py3Build/CheckHostPipVersionMatch for the case where
the host-pip-requirements directory does not exist or is empty.

[1]: https://pip.pypa.io/en/stable/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020
[2]: https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-no-build-isolation

Signed-off-by: Jeffery To &lt;jeffery.to@gmail.com&gt;
</content>
</entry>
<entry>
<title>python: Unset Python environment variables</title>
<updated>2023-03-30T04:19:04Z</updated>
<author>
<name>Jeffery To</name>
<email>jeffery.to@gmail.com</email>
</author>
<published>2023-03-02T15:35:00Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/packages/commit/?id=6ef46bb9194b5d3f5fc17471d8869bcae729d215'/>
<id>urn:sha1:6ef46bb9194b5d3f5fc17471d8869bcae729d215</id>
<content type='text'>
This will prevent the user's environment variables from affecting host
Python, removing the need to manually override these variables.

It is also not necessary to set PYTHONPATH (when not working on target
Python packages) because the given directories are already included in
Python's search path by default.

Signed-off-by: Jeffery To &lt;jeffery.to@gmail.com&gt;
</content>
</entry>
<entry>
<title>python-build: add support for pyproject.toml files</title>
<updated>2023-01-22T14:58:59Z</updated>
<author>
<name>Alexandru Ardelean</name>
<email>ardeleanalex@gmail.com</email>
</author>
<published>2021-11-15T07:26:29Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/packages/commit/?id=61f202c0170785addbbc449e4de61cc5886f0833'/>
<id>urn:sha1:61f202c0170785addbbc449e4de61cc5886f0833</id>
<content type='text'>
A new PEP 517 (https://www.python.org/dev/peps/pep-0517/) has defined that
Python packages can be shipped without any `setup.py` file, and that a
`pyproject.toml` file is sufficient.

A `setup.py` shim layer is suggested as a method for running the build.

For these cases, we will add a support in the OpenWrt build-system to
provide the default `setup.py` shim layer in case this file does not exist,
but there is a `pyproject.toml` file.

We also seem to need to tweak the shim layer with the PKG_VERSION,
otherwise the detected version is 0.0.0.
We will need to see if this will be fixed later in setuptools{-scm}.

Signed-off-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
</content>
</entry>
<entry>
<title>python: Use locked for host pip</title>
<updated>2020-08-31T10:48:47Z</updated>
<author>
<name>Jeffery To</name>
<email>jeffery.to@gmail.com</email>
</author>
<published>2020-08-30T22:29:44Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/packages/commit/?id=c0340f631c6da75c9e19a6a2132777b55b58b777'/>
<id>urn:sha1:c0340f631c6da75c9e19a6a2132777b55b58b777</id>
<content type='text'>
This also removes PKG_BUILD_PARALLEL:=0 that was added for packages that
use HOST_PYTHON3_PACKAGE_BUILD_DEPENDS.

Signed-off-by: Jeffery To &lt;jeffery.to@gmail.com&gt;
</content>
</entry>
</feed>
