package/pkg-python: migrate flit to new bootstrapping sequence
PATCH v7 1/5 package/pkg-python: migrate flit to new bootstrapping sequence
There are a number of flit toolchain dependencies currently in the process of deprecating distutils based fallbacks.
This will be needed in order to update tomli.
We need to migrate these to use a new bootstrap based build+install sequence which relies on flit's bootstrap wheel build+install features to build and install host-python-pypa-build and host-python-installer which gives us a full pep517 toolchain.
Note that one can run host-python-flit-core commands for building and installing itself since the package build directory is the cwd.
We need to add a special flit-bootstrap SETUP_TYPE for dependencies of host-python-pypa-build and host-python-installer which can not use the normal flit SETUP_TYPE which would cause a circular dependency issue.
We need to special case dependency exclusions for host-python-flit-core and host-python-installer to avoid circular dependencies in the flit-bootstrap SETUP_TYPE.
We also need to special case the installation command for host-python-flit-core since it can not depend on host-python-installer due to host-python-installer requiring host-python-flit-core.
---
Changes v3 -> v4:
- rebase
Changes v2 -> v3:
- add special flit-bootstrap SETUP_TYPE
- don't change package SETUP_TYPE's yet
Changes v1 -> v2:
- formatting/cleanup
- add comments
--- package/pkg-python.mk | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
package/pkg-python.mk +25 -1
@@ -154,6 +154,9 @@ HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \ --scripts=$(HOST_DIR)/bin \ --data=$(HOST_DIR) +HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS = \ + --installdir=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages + ################################################################################ # inner-python-package -- defines how the configuration, compilation # and installation of a Python package should be done, implements a
@@ -203,7 +206,7 @@ $(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_ENV) $(2)_BASE_BUILD_CMD = setup.py build $(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) endif -else ifneq ($$(filter flit pep517,$$($(2)_SETUP_TYPE)),) +else ifneq ($$(filter flit flit-bootstrap pep517,$$($(2)_SETUP_TYPE)),) ifeq ($(4),target) $(2)_BASE_ENV = $$(PKG_PYTHON_PEP517_ENV) $(2)_BASE_BUILD_CMD = -m build -n -w
@@ -211,9 +214,24 @@ $(2)_BASE_INSTALL_TARGET_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $ $(2)_BASE_INSTALL_STAGING_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS) else $(2)_BASE_ENV = $$(HOST_PKG_PYTHON_PEP517_ENV) +# Use flit built in wheel builder for packages that are flit-bootstrap packages. +# This is needed to avoid a circular with host-python-pypa-build and those dependencies. +# +ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) +$(2)_BASE_BUILD_CMD = -m flit_core.wheel +ifeq ($(1),host-python-flit-core) +# Use flit built in bootstrap_install for installing host-python-flit-core. +# This is due to host-python-installer depending on host-python-flit-core. +# +$(2)_BASE_INSTALL_CMD = -m bootstrap_install dist/* $$(HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS) +else +$(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) +endif +else $(2)_BASE_BUILD_CMD = -m build -n -w $(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) endif +endif else $$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils', 'setuptools', 'pep517' or 'flit'.") endif
@@ -239,6 +257,12 @@ $(2)_DEPENDENCIES += host-python-pypa-build host-python-installer ifeq ($$($(2)_SETUP_TYPE),flit) $(2)_DEPENDENCIES += host-python-flit-core endif +else ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) +ifneq ($$(filter host-python-flit-core host-python-installer,$(1)),) +$(2)_DEPENDENCIES += $$(if $$(filter host-python-flit-core,$(1)),,host-python-flit-core) +else +$(2)_DEPENDENCIES += host-python-flit-core host-python-installer +endif endif # SETUP_TYPE # Python interpreter to use for building the package.
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v7 2/5 package/pkg-python.mk: remove hardcoded paths for host Python
From: Роман Донченко <[email protected]>
When installer is used to install packages for host Python, it can figure out by itself which paths to use. We just need to use the installer CLI instead of our wrapper script.
---
Changes v4 -> v5:
- add rebased remove hardcoded paths patch
--- package/pkg-python.mk | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
package/pkg-python.mk +2 -10
@@ -146,14 +146,6 @@ HOST_PKG_PYTHON_PEP517_ENV = \ PYTHONNOUSERSITE=1 \ $(HOST_CONFIGURE_OPTS) -HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \ - --interpreter=/bin/python \ - --script-kind=posix \ - --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ - --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR) \ - --scripts=$(HOST_DIR)/bin \ - --data=$(HOST_DIR) - HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS = \ --installdir=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
@@ -225,11 +217,11 @@ ifeq ($(1),host-python-flit-core) # $(2)_BASE_INSTALL_CMD = -m bootstrap_install dist/* $$(HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS) else -$(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) +$(2)_BASE_INSTALL_CMD = -m installer dist/* endif else $(2)_BASE_BUILD_CMD = -m build -n -w -$(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) +$(2)_BASE_INSTALL_CMD = -m installer dist/* endif endif else
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Arnout Vandecappelle
AppliedRe: [Buildroot] [PATCH v7 2/5] package/pkg-python.mk: remove hardcoded paths for host Python
Quoted 8 lines · James Hilliard
From: Роман Донченко <[email protected]>
When installer is used to install packages for host Python, it can figure out by itself which paths to use. We just need to use the installer CLI instead of our wrapper script.
Signed-off-by Роман Донченко <[email protected]>Signed-off-by James Hilliard <[email protected]>
Applied to master, thanks.
Regards,
Arnout
Quoted 30 lines
---
Changes v4 -> v5:
- add rebased remove hardcoded paths patch--- package/pkg-python.mk | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)package/pkg-python.mk +0
-8@@ -146,14 +146,6 @@ HOST_PKG_PYTHON_PEP517_ENV = \ PYTHONNOUSERSITE=1 \ $(HOST_CONFIGURE_OPTS) -HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \ - --interpreter=/bin/python \ - --script-kind=posix \ - --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ - --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR) \ - --scripts=$(HOST_DIR)/bin \ - --data=$(HOST_DIR) - HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS = \ --installdir=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages@@ -225,11 +217,11 @@ ifeq ($(1),host-python-flit-core) # $(2)_BASE_INSTALL_CMD = -m bootstrap_install dist/* $$(HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS) else
package/pkg-python.mk ifeq ($(1),host-python-flit-core) · line 227
Quoted 10 lines
package/pkg-python.mk +2
-2-$(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) +$(2)_BASE_INSTALL_CMD = -m installer dist/* endif else $(2)_BASE_BUILD_CMD = -m build -n -w -$(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) +$(2)_BASE_INSTALL_CMD = -m installer dist/* endif endif else
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v7 3/5 package/python-flit-core: migrate setup type to flit bootstrap
In reply to James HilliardThis package needs to use flit-bootstrap since it is a dependency of host-python-pypa-build.
--- package/python-flit-core/python-flit-core.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/python-flit-core/python-flit-core.mk +1 -1
@@ -8,6 +8,6 @@ PYTHON_FLIT_CORE_VERSION = 3.7.1 PYTHON_FLIT_CORE_SOURCE = flit_core-$(PYTHON_FLIT_CORE_VERSION).tar.gz PYTHON_FLIT_CORE_SITE = https://files.pythonhosted.org/packages/15/d1/d8798b83e953fd6f86ca9b50f93eec464a9305b0661469c8234e61095481 PYTHON_FLIT_CORE_LICENSE = BSD-3-Clause -PYTHON_FLIT_CORE_SETUP_TYPE = pep517 +PYTHON_FLIT_CORE_SETUP_TYPE = flit-bootstrap $(eval $(host-python-package))
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Arnout Vandecappelle
AppliedRe: [Buildroot] [PATCH v7 3/5] package/python-flit-core: migrate setup type to flit bootstrap
Quoted 13 lines · James Hilliard
This package needs to use flit-bootstrap since it is a dependency of host-python-pypa-build.
Signed-off-by James Hilliard <[email protected]>--- package/python-flit-core/python-flit-core.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/python-flit-core/python-flit-core.mk +0
-0
package/python-flit-core/python-flit-core.mk PYTHON_FLIT_CORE_VERSION = 3.7.1 · line 11
Quoted 5 lines
package/python-flit-core/python-flit-core.mk +1
-1@@ -8,6 +8,6 @@ PYTHON_FLIT_CORE_VERSION = 3.7.1 PYTHON_FLIT_CORE_SOURCE = flit_core-$(PYTHON_FLIT_CORE_VERSION).tar.gz PYTHON_FLIT_CORE_SITE = https://files.pythonhosted.org/packages/15/d1/d8798b83e953fd6f86ca9b50f93eec464a9305b0661469c8234e61095481 PYTHON_FLIT_CORE_LICENSE = BSD-3-Clause -PYTHON_FLIT_CORE_SETUP_TYPE = pep517 +PYTHON_FLIT_CORE_SETUP_TYPE = flit-bootstrap
So here I added
HOST_PYTHON_FLIT_CORE_BASE_INSTALL_CMD = -m bootstrap_install dist/* $(HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS)
Applied to master, thanks.
Regards,
Arnout
package/python-flit-core/python-flit-core.mk PYTHON_FLIT_CORE_VERSION = 3.7.1 · line 13
Quoted 2 lines
package/python-flit-core/python-flit-core.mk +0
-0$(eval $(host-python-package))
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v7 4/5 package/python-tomli: bump to version 2.0.1
In reply to James HilliardThis package now requires flit and must use the flit-bootstrap setup type for the host build since it is a dependency of host-python-pypa-build.
---
Changes v6 -> v7:
- only use flit-boostrap for host-python-tomli
--- package/python-tomli/python-tomli.hash | 4 ++-- package/python-tomli/python-tomli.mk | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-)
package/python-tomli/python-tomli.hash +2 -2
@@ -1,5 +1,5 @@ # md5, sha256 from https://pypi.org/pypi/tomli/json -md5 2ecbc7a23b8c8dc2fe96f588f88463d9 tomli-1.2.0.tar.gz -sha256 d60e681734099207a6add7a10326bc2ddd1fdc36c1b0f547d00ef73ac63739c2 tomli-1.2.0.tar.gz +md5 d4341621d423a7ca6822e23d6d52bb9a tomli-2.0.1.tar.gz +sha256 de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f tomli-2.0.1.tar.gz # Locally computed sha256 checksums sha256 b80816b0d530b8accb4c2211783790984a6e3b61922c2b5ee92f3372ab2742fe LICENSE
package/python-tomli/python-tomli.mk +4 -3
@@ -4,12 +4,13 @@ # ################################################################################ -PYTHON_TOMLI_VERSION = 1.2.0 +PYTHON_TOMLI_VERSION = 2.0.1 PYTHON_TOMLI_SOURCE = tomli-$(PYTHON_TOMLI_VERSION).tar.gz -PYTHON_TOMLI_SITE = https://files.pythonhosted.org/packages/ec/38/8eccdc662c61aed187d5f5b168c18b1d2de3827976c3691e4da8be7375aa -PYTHON_TOMLI_SETUP_TYPE = distutils +PYTHON_TOMLI_SITE = https://files.pythonhosted.org/packages/c0/3f/d7af728f075fb08564c5949a9c95e44352e23dee646869fa104a3b2060a3 PYTHON_TOMLI_LICENSE = MIT PYTHON_TOMLI_LICENSE_FILES = LICENSE +PYTHON_TOMLI_SETUP_TYPE = flit +HOST_PYTHON_TOMLI_SETUP_TYPE = flit-bootstrap $(eval $(python-package)) $(eval $(host-python-package))
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Arnout Vandecappelle
AppliedRe: [Buildroot] [PATCH v7 4/5] package/python-tomli: bump to version 2.0.1
Quoted 5 lines · James Hilliard
This package now requires flit and must use the flit-bootstrap setup type for the host build since it is a dependency of host-python-pypa-build.
Signed-off-by James Hilliard <[email protected]>
Applied to master, thanks.
While testing this series, I noticed that the following gives an error (this
was already the case in the original series; I haven't checked how it was before your series was applied - for tomli, it certainly wouldn't happen because it would still be using setuptools, but maybe for other flit packages, I don't know).
make python-tomli
make python-tomli-dirclean
make python-tomli
...
FileExistsError: File already exists: /home/arnout/src/buildroot/output/target/usr/lib/python3.10/site-packages/tomli/__init__.py
Would be nice to get that fixed...
Regards,
Arnout
Quoted 31 lines
---
Changes v6 -> v7:
- only use flit-boostrap for host-python-tomli--- package/python-tomli/python-tomli.hash | 4 ++-- package/python-tomli/python-tomli.mk | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-)package/python-tomli/python-tomli.hash +2
-2@@ -1,5 +1,5 @@ # md5, sha256 from https://pypi.org/pypi/tomli/json -md5 2ecbc7a23b8c8dc2fe96f588f88463d9 tomli-1.2.0.tar.gz -sha256 d60e681734099207a6add7a10326bc2ddd1fdc36c1b0f547d00ef73ac63739c2 tomli-1.2.0.tar.gz +md5 d4341621d423a7ca6822e23d6d52bb9a tomli-2.0.1.tar.gz +sha256 de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f tomli-2.0.1.tar.gz # Locally computed sha256 checksums sha256 b80816b0d530b8accb4c2211783790984a6e3b61922c2b5ee92f3372ab2742fe LICENSEpackage/python-tomli/python-tomli.mk +1
-1@@ -4,12 +4,13 @@ # ################################################################################ -PYTHON_TOMLI_VERSION = 1.2.0 +PYTHON_TOMLI_VERSION = 2.0.1 PYTHON_TOMLI_SOURCE = tomli-$(PYTHON_TOMLI_VERSION).tar.gz
package/python-tomli/python-tomli.mk line 16
Quoted 10 lines
package/python-tomli/python-tomli.mk +3
-2-PYTHON_TOMLI_SITE = https://files.pythonhosted.org/packages/ec/38/8eccdc662c61aed187d5f5b168c18b1d2de3827976c3691e4da8be7375aa -PYTHON_TOMLI_SETUP_TYPE = distutils +PYTHON_TOMLI_SITE = https://files.pythonhosted.org/packages/c0/3f/d7af728f075fb08564c5949a9c95e44352e23dee646869fa104a3b2060a3 PYTHON_TOMLI_LICENSE = MIT PYTHON_TOMLI_LICENSE_FILES = LICENSE +PYTHON_TOMLI_SETUP_TYPE = flit +HOST_PYTHON_TOMLI_SETUP_TYPE = flit-bootstrap $(eval $(python-package)) $(eval $(host-python-package))
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v7 4/5] package/python-tomli: bump to version 2.0.1
Quoted 18 lines · Arnout Vandecappelle
Quoted 5 lines · James Hilliard
This package now requires flit and must use the flit-bootstrap setup type for the host build since it is a dependency of host-python-pypa-build.
Signed-off-by James Hilliard <[email protected]>Applied to master, thanks.
While testing this series, I noticed that the following gives an error (this
was already the case in the original series; I haven't checked how it was before your series was applied - for tomli, it certainly wouldn't happen because it would still be using setuptools, but maybe for other flit packages, I don't know).
Quoted 6 lines
make python-tomli
make python-tomli-dirclean
make python-tomli
...
FileExistsError: File already exists:/home/arnout/src/buildroot/output/target/usr/lib/python3.10/site-packages/tomli/__init__.py
I think it happens only when building across version bumps, probably a bug with installer(https://github.com/pypa/installer) upstream.
Quoted 2 lines
Would be nice to get that fixed...
Yeah, I'll see if I can track that issue down.
Quoted 43 lines
Regards,
ArnoutQuoted 39 lines
---
Changes v6 -> v7:
- only use flit-boostrap for host-python-tomli--- package/python-tomli/python-tomli.hash | 4 ++-- package/python-tomli/python-tomli.mk | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-)package/python-tomli/python-tomli.hash +2
-2@@ -1,5 +1,5 @@ # md5, sha256 from https://pypi.org/pypi/tomli/json -md5 2ecbc7a23b8c8dc2fe96f588f88463d9 tomli-1.2.0.tar.gz -sha256 d60e681734099207a6add7a10326bc2ddd1fdc36c1b0f547d00ef73ac63739c2 tomli-1.2.0.tar.gz +md5 d4341621d423a7ca6822e23d6d52bb9a tomli-2.0.1.tar.gz +sha256 de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f tomli-2.0.1.tar.gz # Locally computed sha256 checksums sha256 b80816b0d530b8accb4c2211783790984a6e3b61922c2b5ee92f3372ab2742fe LICENSEpackage/python-tomli/python-tomli.mk +4
-3@@ -4,12 +4,13 @@ # ################################################################################ -PYTHON_TOMLI_VERSION = 1.2.0 +PYTHON_TOMLI_VERSION = 2.0.1 PYTHON_TOMLI_SOURCE = tomli-$(PYTHON_TOMLI_VERSION).tar.gz -PYTHON_TOMLI_SITE = https://files.pythonhosted.org/packages/ec/38/8eccdc662c61aed187d5f5b168c18b1d2de3827976c3691e4da8be7375aa -PYTHON_TOMLI_SETUP_TYPE = distutils +PYTHON_TOMLI_SITE = https://files.pythonhosted.org/packages/c0/3f/d7af728f075fb08564c5949a9c95e44352e23dee646869fa104a3b2060a3 PYTHON_TOMLI_LICENSE = MIT PYTHON_TOMLI_LICENSE_FILES = LICENSE +PYTHON_TOMLI_SETUP_TYPE = flit +HOST_PYTHON_TOMLI_SETUP_TYPE = flit-bootstrap
Quoted 2 lines
package/python-tomli/python-tomli.mk line 16
Quoted 2 lines
package/python-tomli/python-tomli.mk +0
-0$(eval $(python-package)) $(eval $(host-python-package))
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v7 4/5] package/python-tomli: bump to version 2.0.1
Quoted 26 lines · James Hilliard
Quoted 18 lines · Arnout Vandecappelle
Quoted 5 lines · James Hilliard
This package now requires flit and must use the flit-bootstrap setup type for the host build since it is a dependency of host-python-pypa-build.
Signed-off-by James Hilliard <[email protected]>Applied to master, thanks.
While testing this series, I noticed that the following gives an error (this
was already the case in the original series; I haven't checked how it was before your series was applied - for tomli, it certainly wouldn't happen because it would still be using setuptools, but maybe for other flit packages, I don't know).Quoted 6 lines
make python-tomli
make python-tomli-dirclean
make python-tomli
...
FileExistsError: File already exists:/home/arnout/src/buildroot/output/target/usr/lib/python3.10/site-packages/tomli/__init__.py
Quoted 2 lines
I think it happens only when building across version bumps, probably a bug with installer(https://github.com/pypa/installer) upstream.
No, it's exactly the sequence of commands that I wrote above that triggers it.
I haven't checked if this is the case for flit/pep517 packages in general, or
just for flit-bootstrap.
Regards,
Arnout
Quoted 49 lines
Quoted 3 lines
Would be nice to get that fixed...
Yeah, I'll see if I can track that issue down.
Quoted 43 lines
Regards,
ArnoutQuoted 39 lines
---
Changes v6 -> v7:
- only use flit-boostrap for host-python-tomli--- package/python-tomli/python-tomli.hash | 4 ++-- package/python-tomli/python-tomli.mk | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-)package/python-tomli/python-tomli.hash +2
-2@@ -1,5 +1,5 @@ # md5, sha256 from https://pypi.org/pypi/tomli/json -md5 2ecbc7a23b8c8dc2fe96f588f88463d9 tomli-1.2.0.tar.gz -sha256 d60e681734099207a6add7a10326bc2ddd1fdc36c1b0f547d00ef73ac63739c2 tomli-1.2.0.tar.gz +md5 d4341621d423a7ca6822e23d6d52bb9a tomli-2.0.1.tar.gz +sha256 de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f tomli-2.0.1.tar.gz # Locally computed sha256 checksums sha256 b80816b0d530b8accb4c2211783790984a6e3b61922c2b5ee92f3372ab2742fe LICENSEpackage/python-tomli/python-tomli.mk +4
-3@@ -4,12 +4,13 @@ # ################################################################################ -PYTHON_TOMLI_VERSION = 1.2.0 +PYTHON_TOMLI_VERSION = 2.0.1 PYTHON_TOMLI_SOURCE = tomli-$(PYTHON_TOMLI_VERSION).tar.gz -PYTHON_TOMLI_SITE = https://files.pythonhosted.org/packages/ec/38/8eccdc662c61aed187d5f5b168c18b1d2de3827976c3691e4da8be7375aa -PYTHON_TOMLI_SETUP_TYPE = distutils +PYTHON_TOMLI_SITE = https://files.pythonhosted.org/packages/c0/3f/d7af728f075fb08564c5949a9c95e44352e23dee646869fa104a3b2060a3 PYTHON_TOMLI_LICENSE = MIT PYTHON_TOMLI_LICENSE_FILES = LICENSE +PYTHON_TOMLI_SETUP_TYPE = flit +HOST_PYTHON_TOMLI_SETUP_TYPE = flit-bootstrap
Quoted 2 lines
Quoted 2 lines
package/python-tomli/python-tomli.mk line 16
Quoted 2 lines
package/python-tomli/python-tomli.mk +0
-0$(eval $(python-package)) $(eval $(host-python-package))
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v7 4/5] package/python-tomli: bump to version 2.0.1
Quoted 30 lines · Arnout Vandecappelle
Quoted 26 lines · James Hilliard
Quoted 24 lines · Arnout Vandecappelle
Quoted 5 lines · James Hilliard
This package now requires flit and must use the flit-bootstrap setup type for the host build since it is a dependency of host-python-pypa-build.
Signed-off-by James Hilliard <[email protected]>Applied to master, thanks.
While testing this series, I noticed that the following gives an error (this
was already the case in the original series; I haven't checked how it was before your series was applied - for tomli, it certainly wouldn't happen because it would still be using setuptools, but maybe for other flit packages, I don't know).make python-tomli
make python-tomli-dirclean
make python-tomli
...
FileExistsError: File already exists:/home/arnout/src/buildroot/output/target/usr/lib/python3.10/site-packages/tomli/__init__.py
Quoted 4 lines
Quoted 2 lines
I think it happens only when building across version bumps, probably a bug with installer(https://github.com/pypa/installer) upstream.
No, it's exactly the sequence of commands that I wrote above that triggers it.
Oh, yeah, I see what's happening, I was testing with per-package directories which prevents one from hitting that issue in most cases since it clears out the conflicting/old artifacts with dirclean.
Quoted 3 lines
I haven't checked if this is the case for flit/pep517 packages in general, or
just for flit-bootstrap.
Likely affects all flit/flit-bootstrap and pep517 packages if I had to guess, seems
due to stale build artifacts lying around combined with installer not wanting to overwrite artifacts in general, might need to upstream some way to enable artifact overwrites, I'll look into that.
Quoted 53 lines
Regards,
ArnoutQuoted 49 lines
Quoted 3 lines
Would be nice to get that fixed...
Yeah, I'll see if I can track that issue down.
Quoted 43 lines
Regards,
ArnoutQuoted 39 lines
---
Changes v6 -> v7:
- only use flit-boostrap for host-python-tomli--- package/python-tomli/python-tomli.hash | 4 ++-- package/python-tomli/python-tomli.mk | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-)package/python-tomli/python-tomli.hash +2
-2@@ -1,5 +1,5 @@ # md5, sha256 from https://pypi.org/pypi/tomli/json -md5 2ecbc7a23b8c8dc2fe96f588f88463d9 tomli-1.2.0.tar.gz -sha256 d60e681734099207a6add7a10326bc2ddd1fdc36c1b0f547d00ef73ac63739c2 tomli-1.2.0.tar.gz +md5 d4341621d423a7ca6822e23d6d52bb9a tomli-2.0.1.tar.gz +sha256 de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f tomli-2.0.1.tar.gz # Locally computed sha256 checksums sha256 b80816b0d530b8accb4c2211783790984a6e3b61922c2b5ee92f3372ab2742fe LICENSEpackage/python-tomli/python-tomli.mk +4
-3@@ -4,12 +4,13 @@ # ################################################################################ -PYTHON_TOMLI_VERSION = 1.2.0 +PYTHON_TOMLI_VERSION = 2.0.1 PYTHON_TOMLI_SOURCE = tomli-$(PYTHON_TOMLI_VERSION).tar.gz -PYTHON_TOMLI_SITE = https://files.pythonhosted.org/packages/ec/38/8eccdc662c61aed187d5f5b168c18b1d2de3827976c3691e4da8be7375aa -PYTHON_TOMLI_SETUP_TYPE = distutils +PYTHON_TOMLI_SITE = https://files.pythonhosted.org/packages/c0/3f/d7af728f075fb08564c5949a9c95e44352e23dee646869fa104a3b2060a3 PYTHON_TOMLI_LICENSE = MIT PYTHON_TOMLI_LICENSE_FILES = LICENSE +PYTHON_TOMLI_SETUP_TYPE = flit +HOST_PYTHON_TOMLI_SETUP_TYPE = flit-bootstrap
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
package/python-tomli/python-tomli.mk line 16
Quoted 2 lines
package/python-tomli/python-tomli.mk +0
-0$(eval $(python-package)) $(eval $(host-python-package))
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v7 4/5] package/python-tomli: bump to version 2.0.1
Quoted 42 lines · James Hilliard
Quoted 30 lines · Arnout Vandecappelle
Quoted 26 lines · James Hilliard
Quoted 24 lines · Arnout Vandecappelle
Quoted 5 lines · James Hilliard
This package now requires flit and must use the flit-bootstrap setup type for the host build since it is a dependency of host-python-pypa-build.
Signed-off-by James Hilliard <[email protected]>Applied to master, thanks.
While testing this series, I noticed that the following gives an error (this
was already the case in the original series; I haven't checked how it was before your series was applied - for tomli, it certainly wouldn't happen because it would still be using setuptools, but maybe for other flit packages, I don't know).make python-tomli
make python-tomli-dirclean
make python-tomli
...
FileExistsError: File already exists:/home/arnout/src/buildroot/output/target/usr/lib/python3.10/site-packages/tomli/__init__.pyQuoted 4 lines
Quoted 2 lines
I think it happens only when building across version bumps, probably a bug with installer(https://github.com/pypa/installer) upstream.
No, it's exactly the sequence of commands that I wrote above that triggers it.
Oh, yeah, I see what's happening, I was testing with per-package directories which prevents one from hitting that issue in most cases since it clears out the conflicting/old artifacts with dirclean.
Quoted 1 line
Quoted 8 lines
Quoted 2 lines
I haven't checked if this is the case for flit/pep517 packages in general, or
just for flit-bootstrap.Likely affects all flit/flit-bootstrap and pep517 packages if I had to guess, seems
due to stale build artifacts lying around combined with installer not wanting to overwrite artifacts in general, might need to upstream some way to enable artifact overwrites, I'll look into that.
Issue opened upstream:
https://github.com/pypa/installer/issues/121
Quoted 54 lines
Quoted 54 lines
Regards,
ArnoutQuoted 49 lines
Quoted 3 lines
Would be nice to get that fixed...
Yeah, I'll see if I can track that issue down.
Quoted 43 lines
Regards,
ArnoutQuoted 39 lines
---
Changes v6 -> v7:
- only use flit-boostrap for host-python-tomli--- package/python-tomli/python-tomli.hash | 4 ++-- package/python-tomli/python-tomli.mk | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-)package/python-tomli/python-tomli.hash +2
-2@@ -1,5 +1,5 @@ # md5, sha256 from https://pypi.org/pypi/tomli/json -md5 2ecbc7a23b8c8dc2fe96f588f88463d9 tomli-1.2.0.tar.gz -sha256 d60e681734099207a6add7a10326bc2ddd1fdc36c1b0f547d00ef73ac63739c2 tomli-1.2.0.tar.gz +md5 d4341621d423a7ca6822e23d6d52bb9a tomli-2.0.1.tar.gz +sha256 de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f tomli-2.0.1.tar.gz # Locally computed sha256 checksums sha256 b80816b0d530b8accb4c2211783790984a6e3b61922c2b5ee92f3372ab2742fe LICENSEpackage/python-tomli/python-tomli.mk +4
-3@@ -4,12 +4,13 @@ # ################################################################################ -PYTHON_TOMLI_VERSION = 1.2.0 +PYTHON_TOMLI_VERSION = 2.0.1 PYTHON_TOMLI_SOURCE = tomli-$(PYTHON_TOMLI_VERSION).tar.gz -PYTHON_TOMLI_SITE = https://files.pythonhosted.org/packages/ec/38/8eccdc662c61aed187d5f5b168c18b1d2de3827976c3691e4da8be7375aa -PYTHON_TOMLI_SETUP_TYPE = distutils +PYTHON_TOMLI_SITE = https://files.pythonhosted.org/packages/c0/3f/d7af728f075fb08564c5949a9c95e44352e23dee646869fa104a3b2060a3 PYTHON_TOMLI_LICENSE = MIT PYTHON_TOMLI_LICENSE_FILES = LICENSE +PYTHON_TOMLI_SETUP_TYPE = flit +HOST_PYTHON_TOMLI_SETUP_TYPE = flit-bootstrap
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
package/python-tomli/python-tomli.mk line 16
Quoted 2 lines
package/python-tomli/python-tomli.mk +0
-0$(eval $(python-package)) $(eval $(host-python-package))
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v7 5/5 package/python-pyparsing: bump to version 3.0.8
In reply to James HilliardThis package now requires flit and must use the flit-bootstrap setup type for the host build since it is a dependency of host-python-pypa-build.
---
Changes v6 -> v7:
- only use flit-boostrap for host-python-pyparsing
--- package/python-pyparsing/python-pyparsing.hash | 4 ++-- package/python-pyparsing/python-pyparsing.mk | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-)
package/python-pyparsing/python-pyparsing.hash +2 -2
@@ -1,5 +1,5 @@ # md5, sha256 from https://pypi.org/pypi/pyparsing/json -md5 9d38774991175444e21a3dfa865876cc pyparsing-3.0.7.tar.gz -sha256 18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea pyparsing-3.0.7.tar.gz +md5 971252e99e1e02a4c27f001894e0422d pyparsing-3.0.8.tar.gz +sha256 7bf433498c016c4314268d95df76c81b842a4cb2b276fa3312cfb1e1d85f6954 pyparsing-3.0.8.tar.gz # Locally computed sha256 checksums sha256 10d5120a16805804ffda8b688c220bfb4e8f39741b57320604d455a309e01972 LICENSE
package/python-pyparsing/python-pyparsing.mk +4 -3
@@ -4,12 +4,13 @@ # ################################################################################ -PYTHON_PYPARSING_VERSION = 3.0.7 +PYTHON_PYPARSING_VERSION = 3.0.8 PYTHON_PYPARSING_SOURCE = pyparsing-$(PYTHON_PYPARSING_VERSION).tar.gz -PYTHON_PYPARSING_SITE = https://files.pythonhosted.org/packages/d6/60/9bed18f43275b34198eb9720d4c1238c68b3755620d20df0afd89424d32b +PYTHON_PYPARSING_SITE = https://files.pythonhosted.org/packages/31/df/789bd0556e65cf931a5b87b603fcf02f79ff04d5379f3063588faaf9c1e4 PYTHON_PYPARSING_LICENSE = MIT PYTHON_PYPARSING_LICENSE_FILES = LICENSE -PYTHON_PYPARSING_SETUP_TYPE = setuptools +PYTHON_PYPARSING_SETUP_TYPE = flit +HOST_PYTHON_PYPARSING_SETUP_TYPE = flit-bootstrap $(eval $(python-package)) $(eval $(host-python-package))
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Arnout Vandecappelle
AppliedRe: [Buildroot] [PATCH v7 5/5] package/python-pyparsing: bump to version 3.0.8
Quoted 5 lines · James Hilliard
This package now requires flit and must use the flit-bootstrap setup type for the host build since it is a dependency of host-python-pypa-build.
Signed-off-by James Hilliard <[email protected]>
Applied to master, thanks.
Regards,
Arnout
Quoted 31 lines
---
Changes v6 -> v7:
- only use flit-boostrap for host-python-pyparsing--- package/python-pyparsing/python-pyparsing.hash | 4 ++-- package/python-pyparsing/python-pyparsing.mk | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-)package/python-pyparsing/python-pyparsing.hash +2
-2@@ -1,5 +1,5 @@ # md5, sha256 from https://pypi.org/pypi/pyparsing/json -md5 9d38774991175444e21a3dfa865876cc pyparsing-3.0.7.tar.gz -sha256 18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea pyparsing-3.0.7.tar.gz +md5 971252e99e1e02a4c27f001894e0422d pyparsing-3.0.8.tar.gz +sha256 7bf433498c016c4314268d95df76c81b842a4cb2b276fa3312cfb1e1d85f6954 pyparsing-3.0.8.tar.gz # Locally computed sha256 checksums sha256 10d5120a16805804ffda8b688c220bfb4e8f39741b57320604d455a309e01972 LICENSEpackage/python-pyparsing/python-pyparsing.mk +1
-1@@ -4,12 +4,13 @@ # ################################################################################ -PYTHON_PYPARSING_VERSION = 3.0.7 +PYTHON_PYPARSING_VERSION = 3.0.8 PYTHON_PYPARSING_SOURCE = pyparsing-$(PYTHON_PYPARSING_VERSION).tar.gz
package/python-pyparsing/python-pyparsing.mk line 16
Quoted 10 lines
package/python-pyparsing/python-pyparsing.mk +3
-2-PYTHON_PYPARSING_SITE = https://files.pythonhosted.org/packages/d6/60/9bed18f43275b34198eb9720d4c1238c68b3755620d20df0afd89424d32b +PYTHON_PYPARSING_SITE = https://files.pythonhosted.org/packages/31/df/789bd0556e65cf931a5b87b603fcf02f79ff04d5379f3063588faaf9c1e4 PYTHON_PYPARSING_LICENSE = MIT PYTHON_PYPARSING_LICENSE_FILES = LICENSE -PYTHON_PYPARSING_SETUP_TYPE = setuptools +PYTHON_PYPARSING_SETUP_TYPE = flit +HOST_PYTHON_PYPARSING_SETUP_TYPE = flit-bootstrap $(eval $(python-package)) $(eval $(host-python-package))
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 72 lines · James Hilliard
There are a number of flit toolchain dependencies currently in the process of deprecating distutils based fallbacks.
This will be needed in order to update tomli.
We need to migrate these to use a new bootstrap based build+install sequence which relies on flit's bootstrap wheel build+install features to build and install host-python-pypa-build and host-python-installer which gives us a full pep517 toolchain.
Note that one can run host-python-flit-core commands for building and installing itself since the package build directory is the cwd.
We need to add a special flit-bootstrap
SETUP_TYPEfor dependencies of host-python-pypa-build and host-python-installer which can not use the normal flitSETUP_TYPEwhich would cause a circular dependency issue.We need to special case dependency exclusions for host-python-flit-core and host-python-installer to avoid circular dependencies in the flit-bootstrap
SETUP_TYPE.We also need to special case the installation command for host-python-flit-core since it can not depend on host-python-installer due to host-python-installer requiring host-python-flit-core.
Signed-off-by James Hilliard <[email protected]>Cc "Yann E. MORIN" <[email protected]>Cc Arnout Vandecappelle <[email protected]>---
Changes v3 -> v4:
- rebase
Changes v2 -> v3:
- add special flit-bootstrapSETUP_TYPE
- don't change package SETUP_TYPE's yet
Changes v1 -> v2:
- formatting/cleanup
- add comments--- package/pkg-python.mk | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)package/pkg-python.mk +7
-1@@ -154,6 +154,9 @@ HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \ --scripts=$(HOST_DIR)/bin \ --data=$(HOST_DIR) +HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS = \ + --installdir=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages + ################################################################################ # inner-python-package -- defines how the configuration, compilation # and installation of a Python package should be done, implements a@@ -203,7 +206,7 @@ $(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_ENV) $(2)_BASE_BUILD_CMD = setup.py build $(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) endif -else ifneq ($$(filter flit pep517,$$($(2)_SETUP_TYPE)),) +else ifneq ($$(filter flit flit-bootstrap pep517,$$($(2)_SETUP_TYPE)),) ifeq ($(4),target) $(2)_BASE_ENV = $$(PKG_PYTHON_PEP517_ENV) $(2)_BASE_BUILD_CMD = -m build -n -w@@ -211,9 +214,24 @@ $(2)_BASE_INSTALL_TARGET_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $ $(2)_BASE_INSTALL_STAGING_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS) else $(2)_BASE_ENV = $$(HOST_PKG_PYTHON_PEP517_ENV) +# Use flit built in wheel builder for packages that are flit-bootstrap packages. +# This is needed to avoid a circular with host-python-pypa-build and those dependencies. +#
package/pkg-python.mk $(2)_BASE_INSTALL_TARGET_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $ · line 229
Quoted 10 lines
package/pkg-python.mk +10
-0+ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) +$(2)_BASE_BUILD_CMD = -m flit_core.wheel +ifeq ($(1),host-python-flit-core) +# Use flit built in bootstrap_install for installing host-python-flit-core. +# This is due to host-python-installer depending on host-python-flit-core. +# +$(2)_BASE_INSTALL_CMD = -m bootstrap_install dist/* $$(HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS) +else +$(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) +endif
I still think this is too complicated. And I'm stubborn, so I changed it and
committed to master [1]. I've basically done two things:
- Treat flit-bootstrap as a completely separate setup type. Only the _BASE_ENV is exactly the same as in the other cases; the conditional flow becomes a lot easier to understand by making it explicit. This also allows an $(error ...) when it's used for a target package.
The special-casing for flit-core I solved by using ?= and overriding it in
python-flit-core.mk
Quoted 9 lines
package/pkg-python.mk +2
-0+else $(2)_BASE_BUILD_CMD = -m build -n -w $(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) endif +endif else $$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils', 'setuptools', 'pep517' or 'flit'.") endif
package/pkg-python.mk $(2)_DEPENDENCIES += host-python-pypa-build host-python-installer · line 262
Quoted 6 lines
package/pkg-python.mk +3
-0@@ -239,6 +257,12 @@ $(2)_DEPENDENCIES += host-python-pypa-build host-python-installer ifeq ($$($(2)_SETUP_TYPE),flit) $(2)_DEPENDENCIES += host-python-flit-core endif +else ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) +ifneq ($$(filter host-python-flit-core host-python-installer,$(1)),) +$(2)_DEPENDENCIES += $$(if $$(filter host-python-flit-core,$(1)),,host-python-flit-core)
Again, too complicated for me. I just removed this conditional branch. So for
host-python-flit-core and host-python-installer, no dependencies are added. host-python-flit-core in fact doesn't need any. host-python-installer has to add it manually.
Regards,
Arnout
[1] https://git.buildroot.org/buildroot/commit/?id=8b4f831f36cd653504f38023f909f76912730534
package/pkg-python.mk $(2)_DEPENDENCIES += host-python-pypa-build host-python-installer · line 268
Quoted 6 lines
package/pkg-python.mk +3
-0+else +$(2)_DEPENDENCIES += host-python-flit-core host-python-installer +endif endif # SETUP_TYPE # Python interpreter to use for building the package.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot