From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 16 Oct 2024 12:50:11 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1t11bX-00521q-1l for lore@lore.pengutronix.de; Wed, 16 Oct 2024 12:50:11 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1t11bX-0007Xd-94; Wed, 16 Oct 2024 12:50:11 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t11bG-0007XC-A5; Wed, 16 Oct 2024 12:49:54 +0200 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t11bF-002Fab-Tl; Wed, 16 Oct 2024 12:49:53 +0200 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1t11bF-006uGr-2q; Wed, 16 Oct 2024 12:49:53 +0200 Date: Wed, 16 Oct 2024 12:49:53 +0200 From: Michael Olbrich To: Lars Pedersen Message-ID: References: <20240927113830.415517-1-lapeddk@gmail.com> <20240927113830.415517-2-lapeddk@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain Subject: Re: [ptxdist] [PATCH 2/4] host-python3-setuptools-scm: Version bump 4.1.2 -> 8.1.0 X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false On Thu, Oct 03, 2024 at 11:16:26AM +0200, Lars Pedersen wrote: > On Mon, 30 Sept 2024 at 08:32, Michael Olbrich wrote: > > > > On Fri, Sep 27, 2024 at 01:38:28PM +0200, Lars Pedersen wrote: > > > Signed-off-by: Lars Pedersen > > > --- > > > rules/host-python3-setuptools-scm.make | 12 ++++++++++-- > > > 1 file changed, 10 insertions(+), 2 deletions(-) > > > > > > diff --git a/rules/host-python3-setuptools-scm.make b/rules/host-python3-setuptools-scm.make > > > index f413d7b35..0146fa9cd 100644 > > > --- a/rules/host-python3-setuptools-scm.make > > > +++ b/rules/host-python3-setuptools-scm.make > > > @@ -14,8 +14,8 @@ HOST_PACKAGES-$(PTXCONF_HOST_PYTHON3_SETUPTOOLS_SCM) += host-python3-setuptools- > > > # > > > # Paths and names > > > # > > > -HOST_PYTHON3_SETUPTOOLS_SCM_VERSION := 4.1.2 > > > -HOST_PYTHON3_SETUPTOOLS_SCM_MD5 := e6c9fad17c90516d640868eb833d5150 > > > +HOST_PYTHON3_SETUPTOOLS_SCM_VERSION := 8.1.0 > > > +HOST_PYTHON3_SETUPTOOLS_SCM_MD5 := d8046dce093a94dc382b68b45f6a6257 > > > HOST_PYTHON3_SETUPTOOLS_SCM := setuptools_scm-$(HOST_PYTHON3_SETUPTOOLS_SCM_VERSION) > > > HOST_PYTHON3_SETUPTOOLS_SCM_SUFFIX := tar.gz > > > HOST_PYTHON3_SETUPTOOLS_SCM_URL := $(call ptx/mirror-pypi, setuptools_scm, $(HOST_PYTHON3_SETUPTOOLS_SCM).$(HOST_PYTHON3_SETUPTOOLS_SCM_SUFFIX)) > > > @@ -29,4 +29,12 @@ HOST_PYTHON3_SETUPTOOLS_SCM_LICENSE := MIT > > > > > > HOST_PYTHON3_SETUPTOOLS_SCM_CONF_TOOL := python3 > > > > > > +# Patch in version by removing multiline dynamic = [ "version" ] (line 39 to 41) and add static version after project name > > > +$(STATEDIR)/host-python3-setuptools-scm.extract.post: > > > + @$(call targetinfo) > > > + @$(call world/patchin/post, HOST_PYTHON3_SETUPTOOLS_SCM) > > > + @sed -i '39,41d' $(HOST_PYTHON3_SETUPTOOLS_SCM_DIR)/pyproject.toml > > > > Hmmm, I don't like this because it won't break if the stuff we want to > > remove, moves to a different place in the file. > > > > > + @sed -i '/^name =/aversion = "$(HOST_PYTHON3_SETUPTOOLS_SCM_VERSION)"' $(HOST_PYTHON3_SETUPTOOLS_SCM_DIR)/pyproject.toml > > > > We're collecting multiple packages now that have this kind of hack. I need > > to dig into this. We need a better solution for this. What does this > > 'dynamic = [ "version" ]' stuff do anyways, that we want to avoid? > > > > Michael > > > I don't fully understand this myself. It seems like the dynamic = > ["version"} tells the compiler backend (guess that is setuptools) to > find version in different/smart/magic ways. I have yet to find a good > explanation, but the ptxdist compile stage will fail if it is unable > to find a version for the package. I think I found the issue: PTXdist has two ways to build Python packages with pyproject.toml: The regular way with "python build". A bootstrapping method in case the "build" package is not yet available (e.g. this package itself or its dependencies). HOST_PYTHON3_PYBUILD must be selected (directly or indirectly) to get the regular way. The version magic does not work with the bootstrapping but it works with "python build". Can you add 'select HOST_PYTHON3_PYBUILD' in rules/host-python3-setuptools-scm.in? That helped in my quick test. Michael -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |