All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pypi: set SRC_URI with =, not with +=
@ 2021-06-22 19:27 Alexander Kanavin
  2021-06-23  7:01 ` Konrad Weihmann
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Kanavin @ 2021-06-22 19:27 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

This did not cause problems in builds, but broke some devtool
workflows such as version upgrades or checking the latest version
from upstream. Tarballs should come first, not the patches.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 meta/classes/pypi.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/pypi.bbclass b/meta/classes/pypi.bbclass
index 87b4c85fc0..899126e9e8 100644
--- a/meta/classes/pypi.bbclass
+++ b/meta/classes/pypi.bbclass
@@ -19,7 +19,7 @@ PYPI_SRC_URI ?= "${@pypi_src_uri(d)}"
 
 HOMEPAGE ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/"
 SECTION = "devel/python"
-SRC_URI += "${PYPI_SRC_URI}"
+SRC_URI = "${PYPI_SRC_URI}"
 S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}"
 
 UPSTREAM_CHECK_URI ?= "https://pypi.org/project/${PYPI_PACKAGE}/"
-- 
2.31.1


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

* Re: [PATCH] pypi: set SRC_URI with =, not with +=
  2021-06-22 19:27 [PATCH] pypi: set SRC_URI with =, not with += Alexander Kanavin
@ 2021-06-23  7:01 ` Konrad Weihmann
  2021-06-23  8:34   ` [OE-core] " Alexander Kanavin
  0 siblings, 1 reply; 7+ messages in thread
From: Konrad Weihmann @ 2021-06-23  7:01 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

That doesn't look completely right to me.

You're absolutely right about devtool expecting the tarball in as the 1st item, but this patch here breaks existing recipes like

SRC_URI += "file://some.patch"

inherit pypi

as the patch will now be dropped.

I would suggest to go for SRC_URI_prepend = "${PYPI_SRC_URI} " which fixes the issue *and* doesn't break exisiting setups

[-- Attachment #2: Type: text/html, Size: 446 bytes --]

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

* Re: [OE-core] [PATCH] pypi: set SRC_URI with =, not with +=
  2021-06-23  7:01 ` Konrad Weihmann
@ 2021-06-23  8:34   ` Alexander Kanavin
  2021-06-23  9:26     ` Peter Kjellerstedt
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Kanavin @ 2021-06-23  8:34 UTC (permalink / raw)
  To: Konrad Weihmann; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 552 bytes --]

Right, I sent an updated patch.

Alex

On Wed, 23 Jun 2021 at 09:01, Konrad Weihmann <kweihmann@outlook.com> wrote:

> That doesn't look completely right to me.
>
> You're absolutely right about devtool expecting the tarball in as the 1st
> item, but this patch here breaks existing recipes like
>
> SRC_URI += "file://some.patch"
>
> inherit pypi
>
> as the patch will now be dropped.
>
>
>
> I would suggest to go for SRC_URI_prepend = "${PYPI_SRC_URI} " which fixes
> the issue *and* doesn't break exisiting setups
>
> 
>
>

[-- Attachment #2: Type: text/html, Size: 913 bytes --]

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

* Re: [OE-core] [PATCH] pypi: set SRC_URI with =, not with +=
  2021-06-23  8:34   ` [OE-core] " Alexander Kanavin
@ 2021-06-23  9:26     ` Peter Kjellerstedt
  2021-06-23 10:17       ` Alexander Kanavin
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Kjellerstedt @ 2021-06-23  9:26 UTC (permalink / raw)
  To: Alexander Kanavin, Konrad Weihmann; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1224 bytes --]

I suggest you use =+ instead of _prepend to maintain expansion order. I.e., if someone does:

inherit pypi

SRC_URI = "http://some_url ${PYPI_SRC_URI}"

However, any way you change it, you risk breaking someone’s use case, but I believe using =+ instead of += should be the least invasive change compared to the current version.

//Peter

From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Alexander Kanavin
Sent: den 23 juni 2021 10:34
To: Konrad Weihmann <kweihmann@outlook.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH] pypi: set SRC_URI with =, not with +=

Right, I sent an updated patch.

Alex

On Wed, 23 Jun 2021 at 09:01, Konrad Weihmann <kweihmann@outlook.com<mailto:kweihmann@outlook.com>> wrote:

That doesn't look completely right to me.

You're absolutely right about devtool expecting the tarball in as the 1st item, but this patch here breaks existing recipes like

SRC_URI += "file://some.patch"

inherit pypi

as the patch will now be dropped.



I would suggest to go for SRC_URI_prepend = "${PYPI_SRC_URI} " which fixes the issue *and* doesn't break exisiting setups



[-- Attachment #2: Type: text/html, Size: 5083 bytes --]

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

* Re: [OE-core] [PATCH] pypi: set SRC_URI with =, not with +=
  2021-06-23  9:26     ` Peter Kjellerstedt
@ 2021-06-23 10:17       ` Alexander Kanavin
  2021-06-24  7:21         ` Andre McCurdy
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Kanavin @ 2021-06-23 10:17 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: Konrad Weihmann, OE-core

[-- Attachment #1: Type: text/plain, Size: 1650 bytes --]

Frankly guys, I think maybe we should just break stuff in this case, and
have it fixed up properly, then try to guess what workaround might work.

From that perspective the original patch is the most clear.

Alex

On Wed, 23 Jun 2021 at 11:26, Peter Kjellerstedt <
peter.kjellerstedt@axis.com> wrote:

> I suggest you use =+ instead of _prepend to maintain expansion order.
> I.e., if someone does:
>
>
>
> inherit pypi
>
>
>
> SRC_URI = "http://some_url ${PYPI_SRC_URI}"
>
>
>
> However, any way you change it, you risk breaking someone’s use case, but
> I believe using =+ instead of += should be the least invasive change
> compared to the current version.
>
>
>
> //Peter
>
>
>
> *From:* openembedded-core@lists.openembedded.org <
> openembedded-core@lists.openembedded.org> *On Behalf Of *Alexander Kanavin
> *Sent:* den 23 juni 2021 10:34
> *To:* Konrad Weihmann <kweihmann@outlook.com>
> *Cc:* OE-core <openembedded-core@lists.openembedded.org>
> *Subject:* Re: [OE-core] [PATCH] pypi: set SRC_URI with =, not with +=
>
>
>
> Right, I sent an updated patch.
>
>
>
> Alex
>
>
>
> On Wed, 23 Jun 2021 at 09:01, Konrad Weihmann <kweihmann@outlook.com>
> wrote:
>
> That doesn't look completely right to me.
>
> You're absolutely right about devtool expecting the tarball in as the 1st
> item, but this patch here breaks existing recipes like
>
> SRC_URI += "file://some.patch"
>
> inherit pypi
>
> as the patch will now be dropped.
>
>
>
> I would suggest to go for SRC_URI_prepend = "${PYPI_SRC_URI} " which fixes
> the issue *and* doesn't break exisiting setups
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 4628 bytes --]

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

* Re: [OE-core] [PATCH] pypi: set SRC_URI with =, not with +=
  2021-06-23 10:17       ` Alexander Kanavin
@ 2021-06-24  7:21         ` Andre McCurdy
  2021-06-24  8:28           ` Alexander Kanavin
  0 siblings, 1 reply; 7+ messages in thread
From: Andre McCurdy @ 2021-06-24  7:21 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Peter Kjellerstedt, Konrad Weihmann, OE-core

On Wed, Jun 23, 2021 at 3:18 AM Alexander Kanavin
<alex.kanavin@gmail.com> wrote:
>
> Frankly guys, I think maybe we should just break stuff in this case, and have it fixed up properly, then try to guess what workaround might work.
>
> From that perspective the original patch is the most clear.

The typical ordering of variables etc in recipes is to put SRC_URI
before inherit.

From the perspective of trying to get recipes to stick to a standard
ordering of variables etc, _prepend seems to be the best solution.

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

* Re: [OE-core] [PATCH] pypi: set SRC_URI with =, not with +=
  2021-06-24  7:21         ` Andre McCurdy
@ 2021-06-24  8:28           ` Alexander Kanavin
  0 siblings, 0 replies; 7+ messages in thread
From: Alexander Kanavin @ 2021-06-24  8:28 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: Peter Kjellerstedt, Konrad Weihmann, OE-core

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

On Thu, 24 Jun 2021 at 09:21, Andre McCurdy <armccurdy@gmail.com> wrote:

> On Wed, Jun 23, 2021 at 3:18 AM Alexander Kanavin
> <alex.kanavin@gmail.com> wrote:
> >
> > Frankly guys, I think maybe we should just break stuff in this case, and
> have it fixed up properly, then try to guess what workaround might work.
> >
> > From that perspective the original patch is the most clear.
>
> The typical ordering of variables etc in recipes is to put SRC_URI
> before inherit.
>
> From the perspective of trying to get recipes to stick to a standard
> ordering of variables etc, _prepend seems to be the best solution.
>

That's fine with me, we should probably fix up gnomebase.bbclass as well,
as using = there adds friction to how SRC_URI must be set in the recipes.

Alex

[-- Attachment #2: Type: text/html, Size: 1265 bytes --]

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

end of thread, other threads:[~2021-06-24  8:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 19:27 [PATCH] pypi: set SRC_URI with =, not with += Alexander Kanavin
2021-06-23  7:01 ` Konrad Weihmann
2021-06-23  8:34   ` [OE-core] " Alexander Kanavin
2021-06-23  9:26     ` Peter Kjellerstedt
2021-06-23 10:17       ` Alexander Kanavin
2021-06-24  7:21         ` Andre McCurdy
2021-06-24  8:28           ` Alexander Kanavin

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.