All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/pkg-python: add setup.cfg-only setuptools project support
@ 2022-05-09  1:09 James Hilliard
  2022-05-09  1:09 ` [Buildroot] [PATCH 2/2] package/python-cssutils: bump to version 2.4.0 James Hilliard
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: James Hilliard @ 2022-05-09  1:09 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, James Hilliard, Thomas Petazzoni, Asaf Kahlon

Some projects have been removing their setup.py shims under the
assumption that they are not needed due to setuptools being usable
via pep517, however this is not actually the case as it is not
possible to bootstrap setuptools without setup.py style builds as
setuptools has a dependency on wheel when being used via pep517
which is itself not installable via pep517 as that would create a
dependency cycle between wheel and setuptools(which means wheel
itself must use a legacy setup.py build/installation for itself).

In addition our pep517 toolchain itself requires setuptools for
building/installing dependencies, although it would appear these
dependencies will eventually move to flit. Until this is resolved
we must use setup.py style builds for setuptools packages.

Since it is not yet possible to convert setup.py based setuptools
builds to pep517 based setuptools builds we simply need to execute
the setuptools shim code directly if the setup.py file is missing.

See:
https://setuptools.pypa.io/en/latest/setuptools.html#setup-cfg-only-projects

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 package/pkg-python.mk | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index 452fa0d3ea..5794e3a195 100644
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -86,6 +86,9 @@ PKG_PYTHON_SETUPTOOLS_ENV = \
 	$(PKG_PYTHON_ENV) \
 	SETUPTOOLS_USE_DISTUTILS=stdlib
 
+PKG_PYTHON_SETUPTOOLS_CMD = \
+	$(if $(wildcard $($(PKG)_BUILDDIR)/setup.py),setup.py,-c 'from setuptools import setup;setup()')
+
 PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
 	--install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \
 	--prefix=/usr \
@@ -180,13 +183,13 @@ endif
 else ifeq ($$($(2)_SETUP_TYPE),setuptools)
 ifeq ($(4),target)
 $(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_ENV)
-$(2)_BASE_BUILD_CMD = setup.py build
-$(2)_BASE_INSTALL_TARGET_CMD = setup.py install --no-compile $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS)
-$(2)_BASE_INSTALL_STAGING_CMD = setup.py install $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS)
+$(2)_BASE_BUILD_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) build
+$(2)_BASE_INSTALL_TARGET_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install --no-compile $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS)
+$(2)_BASE_INSTALL_STAGING_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS)
 else
 $(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)
+$(2)_BASE_BUILD_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) build
+$(2)_BASE_INSTALL_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS)
 endif
 else ifneq ($$(filter flit pep517,$$($(2)_SETUP_TYPE)),)
 ifeq ($(4),target)
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/2] package/python-cssutils: bump to version 2.4.0
  2022-05-09  1:09 [Buildroot] [PATCH 1/2] package/pkg-python: add setup.cfg-only setuptools project support James Hilliard
@ 2022-05-09  1:09 ` James Hilliard
  2022-05-10 12:15 ` [Buildroot] [PATCH 1/2] package/pkg-python: add setup.cfg-only setuptools project support Yegor Yefremov via buildroot
  2022-05-13 22:07 ` Arnout Vandecappelle
  2 siblings, 0 replies; 4+ messages in thread
From: James Hilliard @ 2022-05-09  1:09 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, James Hilliard, Thomas Petazzoni, Asaf Kahlon

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 package/python-cssutils/python-cssutils.hash | 4 ++--
 package/python-cssutils/python-cssutils.mk   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/python-cssutils/python-cssutils.hash b/package/python-cssutils/python-cssutils.hash
index e22dde6e56..13459f7270 100644
--- a/package/python-cssutils/python-cssutils.hash
+++ b/package/python-cssutils/python-cssutils.hash
@@ -1,5 +1,5 @@
 # md5, sha256 from https://pypi.org/pypi/cssutils/json
-md5  71955999f595e4b0eb5a218d614652ca  cssutils-2.3.0.tar.gz
-sha256  b2d3b16047caae82e5c590036935bafa1b621cf45c2f38885af4be4838f0fd00  cssutils-2.3.0.tar.gz
+md5  4ae0e6c670483043260363f593e96a69  cssutils-2.4.0.tar.gz
+sha256  2d97210a83b0a3fe1e4469f5ff9a6420b078572035188b1bab7103c3a36dc89b  cssutils-2.4.0.tar.gz
 # Locally computed sha256 checksums
 sha256  03c570a068086ee577dcd795519ea93462b2ed2fcb6dcc4dfce56a71a2fd6e5a  COPYING.LESSER
diff --git a/package/python-cssutils/python-cssutils.mk b/package/python-cssutils/python-cssutils.mk
index 09c2ca44d6..fc65c893ac 100644
--- a/package/python-cssutils/python-cssutils.mk
+++ b/package/python-cssutils/python-cssutils.mk
@@ -4,9 +4,9 @@
 #
 ################################################################################
 
-PYTHON_CSSUTILS_VERSION = 2.3.0
+PYTHON_CSSUTILS_VERSION = 2.4.0
 PYTHON_CSSUTILS_SOURCE = cssutils-$(PYTHON_CSSUTILS_VERSION).tar.gz
-PYTHON_CSSUTILS_SITE = https://files.pythonhosted.org/packages/f5/c6/878abb7df855938a067b762a688da3fcdfea4e41c2399feaf80369b61ed7
+PYTHON_CSSUTILS_SITE = https://files.pythonhosted.org/packages/f4/ea/d09b04b5cf6ad84f45ca4c523d3e153dd9be1f12650c825d1c92ca0618a2
 PYTHON_CSSUTILS_LICENSE = LGPL-3.0+
 PYTHON_CSSUTILS_LICENSE_FILES = COPYING.LESSER
 PYTHON_CSSUTILS_SETUP_TYPE = setuptools
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/pkg-python: add setup.cfg-only setuptools project support
  2022-05-09  1:09 [Buildroot] [PATCH 1/2] package/pkg-python: add setup.cfg-only setuptools project support James Hilliard
  2022-05-09  1:09 ` [Buildroot] [PATCH 2/2] package/python-cssutils: bump to version 2.4.0 James Hilliard
@ 2022-05-10 12:15 ` Yegor Yefremov via buildroot
  2022-05-13 22:07 ` Arnout Vandecappelle
  2 siblings, 0 replies; 4+ messages in thread
From: Yegor Yefremov via buildroot @ 2022-05-10 12:15 UTC (permalink / raw)
  To: James Hilliard; +Cc: Bernd Kuhls, Thomas Petazzoni, Asaf Kahlon, buildroot

Hi James,

On Mon, May 9, 2022 at 3:09 AM James Hilliard <james.hilliard1@gmail.com> wrote:
>
> Some projects have been removing their setup.py shims under the
> assumption that they are not needed due to setuptools being usable
> via pep517, however this is not actually the case as it is not
> possible to bootstrap setuptools without setup.py style builds as
> setuptools has a dependency on wheel when being used via pep517
> which is itself not installable via pep517 as that would create a
> dependency cycle between wheel and setuptools(which means wheel
> itself must use a legacy setup.py build/installation for itself).
>
> In addition our pep517 toolchain itself requires setuptools for
> building/installing dependencies, although it would appear these
> dependencies will eventually move to flit. Until this is resolved
> we must use setup.py style builds for setuptools packages.
>
> Since it is not yet possible to convert setup.py based setuptools
> builds to pep517 based setuptools builds we simply need to execute
> the setuptools shim code directly if the setup.py file is missing.
>
> See:
> https://setuptools.pypa.io/en/latest/setuptools.html#setup-cfg-only-projects
>
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>

Tested-by: Yegor Yefremov <yegorslists@googlemail.com>

Regards,
Yegor

> ---
>  package/pkg-python.mk | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/package/pkg-python.mk b/package/pkg-python.mk
> index 452fa0d3ea..5794e3a195 100644
> --- a/package/pkg-python.mk
> +++ b/package/pkg-python.mk
> @@ -86,6 +86,9 @@ PKG_PYTHON_SETUPTOOLS_ENV = \
>         $(PKG_PYTHON_ENV) \
>         SETUPTOOLS_USE_DISTUTILS=stdlib
>
> +PKG_PYTHON_SETUPTOOLS_CMD = \
> +       $(if $(wildcard $($(PKG)_BUILDDIR)/setup.py),setup.py,-c 'from setuptools import setup;setup()')
> +
>  PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
>         --install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \
>         --prefix=/usr \
> @@ -180,13 +183,13 @@ endif
>  else ifeq ($$($(2)_SETUP_TYPE),setuptools)
>  ifeq ($(4),target)
>  $(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_ENV)
> -$(2)_BASE_BUILD_CMD = setup.py build
> -$(2)_BASE_INSTALL_TARGET_CMD = setup.py install --no-compile $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS)
> -$(2)_BASE_INSTALL_STAGING_CMD = setup.py install $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS)
> +$(2)_BASE_BUILD_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) build
> +$(2)_BASE_INSTALL_TARGET_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install --no-compile $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS)
> +$(2)_BASE_INSTALL_STAGING_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS)
>  else
>  $(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)
> +$(2)_BASE_BUILD_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) build
> +$(2)_BASE_INSTALL_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS)
>  endif
>  else ifneq ($$(filter flit pep517,$$($(2)_SETUP_TYPE)),)
>  ifeq ($(4),target)
> --
> 2.25.1
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/pkg-python: add setup.cfg-only setuptools project support
  2022-05-09  1:09 [Buildroot] [PATCH 1/2] package/pkg-python: add setup.cfg-only setuptools project support James Hilliard
  2022-05-09  1:09 ` [Buildroot] [PATCH 2/2] package/python-cssutils: bump to version 2.4.0 James Hilliard
  2022-05-10 12:15 ` [Buildroot] [PATCH 1/2] package/pkg-python: add setup.cfg-only setuptools project support Yegor Yefremov via buildroot
@ 2022-05-13 22:07 ` Arnout Vandecappelle
  2 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2022-05-13 22:07 UTC (permalink / raw)
  To: James Hilliard, buildroot; +Cc: Bernd Kuhls, Asaf Kahlon, Thomas Petazzoni



On 09/05/2022 03:09, James Hilliard wrote:
> Some projects have been removing their setup.py shims under the
> assumption that they are not needed due to setuptools being usable
> via pep517, however this is not actually the case as it is not
> possible to bootstrap setuptools without setup.py style builds as
> setuptools has a dependency on wheel when being used via pep517
> which is itself not installable via pep517 as that would create a
> dependency cycle between wheel and setuptools(which means wheel
> itself must use a legacy setup.py build/installation for itself).

  I found this explanation a bit confusing, but I *think* you're saying "We 
can't simply always use the 'from setuptools import setup' approach".

  Anyway, applied both to master, thanks.

  Regards,
  Arnout

> 
> In addition our pep517 toolchain itself requires setuptools for
> building/installing dependencies, although it would appear these
> dependencies will eventually move to flit. Until this is resolved
> we must use setup.py style builds for setuptools packages.
> 
> Since it is not yet possible to convert setup.py based setuptools
> builds to pep517 based setuptools builds we simply need to execute
> the setuptools shim code directly if the setup.py file is missing.
> 
> See:
> https://setuptools.pypa.io/en/latest/setuptools.html#setup-cfg-only-projects
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>   package/pkg-python.mk | 13 ++++++++-----
>   1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/package/pkg-python.mk b/package/pkg-python.mk
> index 452fa0d3ea..5794e3a195 100644
> --- a/package/pkg-python.mk
> +++ b/package/pkg-python.mk
> @@ -86,6 +86,9 @@ PKG_PYTHON_SETUPTOOLS_ENV = \
>   	$(PKG_PYTHON_ENV) \
>   	SETUPTOOLS_USE_DISTUTILS=stdlib
>   
> +PKG_PYTHON_SETUPTOOLS_CMD = \
> +	$(if $(wildcard $($(PKG)_BUILDDIR)/setup.py),setup.py,-c 'from setuptools import setup;setup()')
> +
>   PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
>   	--install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \
>   	--prefix=/usr \
> @@ -180,13 +183,13 @@ endif
>   else ifeq ($$($(2)_SETUP_TYPE),setuptools)
>   ifeq ($(4),target)
>   $(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_ENV)
> -$(2)_BASE_BUILD_CMD = setup.py build
> -$(2)_BASE_INSTALL_TARGET_CMD = setup.py install --no-compile $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS)
> -$(2)_BASE_INSTALL_STAGING_CMD = setup.py install $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS)
> +$(2)_BASE_BUILD_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) build
> +$(2)_BASE_INSTALL_TARGET_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install --no-compile $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS)
> +$(2)_BASE_INSTALL_STAGING_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS)
>   else
>   $(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)
> +$(2)_BASE_BUILD_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) build
> +$(2)_BASE_INSTALL_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS)
>   endif
>   else ifneq ($$(filter flit pep517,$$($(2)_SETUP_TYPE)),)
>   ifeq ($(4),target)
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-13 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09  1:09 [Buildroot] [PATCH 1/2] package/pkg-python: add setup.cfg-only setuptools project support James Hilliard
2022-05-09  1:09 ` [Buildroot] [PATCH 2/2] package/python-cssutils: bump to version 2.4.0 James Hilliard
2022-05-10 12:15 ` [Buildroot] [PATCH 1/2] package/pkg-python: add setup.cfg-only setuptools project support Yegor Yefremov via buildroot
2022-05-13 22:07 ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.