GNU bug report logs - #69997
Should ‘guix import pypi’ get dependencies from pyproject files?

Previous Next

Package: guix;

Reported by: Ludovic Courtès <ludovic.courtes <at> inria.fr>

Date: Mon, 25 Mar 2024 16:16:05 UTC

Severity: normal

Done: Sharlatan Hellseher <sharlatanus <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69997 in the body.
You can then email your comments to 69997 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to lars <at> 6xq.net, marius <at> gnu.org, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, tanguy <at> bioneland.org, jgart <at> dismail.de, bug-guix <at> gnu.org:
bug#69997; Package guix. (Mon, 25 Mar 2024 16:16:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludovic.courtes <at> inria.fr>:
New bug report received and forwarded. Copy sent to lars <at> 6xq.net, marius <at> gnu.org, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, tanguy <at> bioneland.org, jgart <at> dismail.de, bug-guix <at> gnu.org. (Mon, 25 Mar 2024 16:16:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludovic.courtes <at> inria.fr>
To: bug-guix <at> gnu.org
Subject: Should ‘guix import pypi’
 get dependencies from pyproject files?
Date: Mon, 25 Mar 2024 12:06:51 +0100
Hello Python team!

Should ‘guix import pypi’ attempt to get dependency information from
‘pyproject.toml’, in addition to ‘requirements.txt’ and wheel ‘METADATA’
as it already does?

It might be more complicated than we’d like: in some cases, that file
seems to be used as a “trampoline” to Poetry.  For instance, in
python-pypugjs, the ‘requires’ bit delegates everything to Poetry:

--8<---------------cut here---------------start------------->8---
[tool.poetry]
name = "pypugjs"
version = "5.9.4"
description = ""
authors = ["Andy Grabow <andy <at> freilandkiwis.de>"]
license = "MIT"

[tool.poetry.dependencies]
python = "^3.8"
Jinja2 = "^3.1.1"
Mako = "^1.1.3"
tornado = "^6.0.4"
six = "^1.15.0"
coverage = "^6.3.2"
nose = "^1.3.7"
Flask = "^2.1.1"
charset-normalizer = "^2.1.0"
flake8 = "^4.0.1"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
--8<---------------cut here---------------end--------------->8---

Thoughts?

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Mon, 25 Mar 2024 19:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: 69997 <at> debbugs.gnu.org
Subject: Re: bug#69997: Should ‘guix import pypi’ get dependencies from pyproject files?
Date: Mon, 25 Mar 2024 19:28:31 +0000
[Message part 1 (text/plain, inline)]
Hi Lido!

> Should ‘guix import pypi’ attempt to get dependency
> information fromn‘pyproject.toml’, in addition to
> ‘requirements.txt’ and wheel ‘METADATA’ as it already does?

It's quite a common practice in modern Python just to include
 pyproject.toml, that fact makes importing long chains problematic.

It would be nice to have common yaml/toml parser for that task.

Oleg
[Message part 2 (text/html, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Tue, 26 Mar 2024 13:46:03 GMT) Full text and rfc822 format available.

Message #11 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Tanguy LE CARROUR <tanguy <at> bioneland.org>
To: 69997 <at> debbugs.gnu.org,
 Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: Munyoki Kilyungi <me <at> bonfacemunyoki.com>,
 Sharlatan Hellseher <sharlatanus <at> gmail.com>, Lars-Dominik Braun <lars <at> 6xq.net>,
 jgart <jgart <at> dismail.de>, Marius Bakke <marius <at> gnu.org>
Subject: Re: bug#69997: Should ‘guix import pypi’
 get dependencies from pyproject files?
Date: Tue, 26 Mar 2024 08:54:17 +0100
Hi Ludo’,


Quoting Ludovic Courtès (2024-03-25 12:06:51)
> Should ‘guix import pypi’ attempt to get dependency information from
> ‘pyproject.toml’, in addition to ‘requirements.txt’ and wheel ‘METADATA’
> as it already does?
> 
> It might be more complicated than we’d like: in some cases, that file
> seems to be used as a “trampoline” to Poetry.  For instance, in
> python-pypugjs, the ‘requires’ bit delegates everything to Poetry:

Short answer: no! 😁

I’m pretty sure you know everything that I’m about to write, but better
say it out loud…

For a "standard modern" project managed with Poetry, the Python source
package contains `PKG-INFO` and `pyproject.toml ` that both contain
the run time dependencies. The wheel package only contains `METADATA` that
lists the dependencies. The source only contains a `pyproject.toml`.
To make the installed package as small as possible, tests files and
uncompiled assets are not (should not be) included.
From a Guix stand point, it’s better to build from source to be able to
run the test suite.

For the `python-pypugjs` you used as an example, we build from source,
so I guess the question does not arise. If we were to use the packages
available on PyPI, what I said above is *NOT* confirmed 😱:
- wheel (`.whl`) only contains `METADATA` with the dependencies; **BUT**
- source (`.tar.gz`) contains `PKG-INFO` (without dependency information),
  `pyproject.toml` (with dep’) and `setup.py` (also with dep’).

… "fun" fact, the information in `pyproject.toml` are **NOT** the same as
the one in `setup.py`!? 🤯 `pyproject.toml` says that `nose` is a run time
dependency (which it is not), but `setup.py` properly lists it in `tests_require`.

So, my answer would be: do not import from PyPI! Yes, I know, it’s radical! 😅
But if you have to, rely on the wheel’s `METADATA` file.

I hope this make sense. … I’m not really sure any more! 😅

Regards,

-- 
Tanguy




Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Tue, 26 Mar 2024 16:06:02 GMT) Full text and rfc822 format available.

Message #14 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludovic.courtes <at> inria.fr>
To: Tanguy LE CARROUR <tanguy <at> bioneland.org>
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 Munyoki Kilyungi <me <at> bonfacemunyoki.com>, Lars-Dominik Braun <lars <at> 6xq.net>,
 jgart <jgart <at> dismail.de>, Marius Bakke <marius <at> gnu.org>, 69997 <at> debbugs.gnu.org
Subject: Re: bug#69997: Should ‘guix import
 pypi’ get dependencies from pyproject files?
Date: Tue, 26 Mar 2024 17:04:52 +0100
Hello!

Tanguy LE CARROUR <tanguy <at> bioneland.org> skribis:

> I’m pretty sure you know everything that I’m about to write, but better
> say it out loud…

Nope, I know nothing (I’ve just been told about using ‘pyproject.toml’
and it seemed to kinda make sense. :-))

> For a "standard modern" project managed with Poetry, the Python source
> package contains `PKG-INFO` and `pyproject.toml ` that both contain
> the run time dependencies. The wheel package only contains `METADATA` that
> lists the dependencies. The source only contains a `pyproject.toml`.
> To make the installed package as small as possible, tests files and
> uncompiled assets are not (should not be) included.
> From a Guix stand point, it’s better to build from source to be able to
> run the test suite.
>
> For the `python-pypugjs` you used as an example, we build from source,
> so I guess the question does not arise. If we were to use the packages
> available on PyPI, what I said above is *NOT* confirmed 😱:
> - wheel (`.whl`) only contains `METADATA` with the dependencies; **BUT**
> - source (`.tar.gz`) contains `PKG-INFO` (without dependency information),
>   `pyproject.toml` (with dep’) and `setup.py` (also with dep’).
>
> … "fun" fact, the information in `pyproject.toml` are **NOT** the same as
> the one in `setup.py`!? 🤯 `pyproject.toml` says that `nose` is a run time
> dependency (which it is not), but `setup.py` properly lists it in `tests_require`.

Oh my, such a mess.

> So, my answer would be: do not import from PyPI! Yes, I know, it’s radical! 😅
> But if you have to, rely on the wheel’s `METADATA` file.
>
> I hope this make sense. … I’m not really sure any more! 😅

It does!

But then I mean, we could offer, say, ‘guix import upstream https://…’,
and that thing could parse ‘setup.py’ or similar to produce a package
definition from that.  Maybe that’s what you had in mind: import
straight from upstream rather than via PyPI?

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Tue, 26 Mar 2024 16:56:02 GMT) Full text and rfc822 format available.

Message #17 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Tanguy LE CARROUR <tanguy <at> bioneland.org>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 Munyoki Kilyungi <me <at> bonfacemunyoki.com>, Lars-Dominik Braun <lars <at> 6xq.net>,
 jgart <jgart <at> dismail.de>, Marius Bakke <marius <at> gnu.org>, 69997 <at> debbugs.gnu.org
Subject: Re: bug#69997: Should ‘guix import pypi’
 get dependencies from pyproject files?
Date: Tue, 26 Mar 2024 17:55:23 +0100
Hi,


Quoting Ludovic Courtès (2024-03-26 17:04:52)
> Tanguy LE CARROUR <tanguy <at> bioneland.org> skribis:
> > So, my answer would be: do not import from PyPI! Yes, I know, it’s radical! 😅
> > But if you have to, rely on the wheel’s `METADATA` file.
> >
> > I hope this make sense. … I’m not really sure any more! 😅
> 
> It does!
> 
> But then I mean, we could offer, say, ‘guix import upstream https://…’,
> and that thing could parse ‘setup.py’ or similar to produce a package
> definition from that.

I’m not against a good-old-generic-solution®, but this one might be
a bit… too generic. It contains no mention to Python, so the next logical step
would be `guix import URL`. Not that I would not like it, though! 😁

So I would say… let’s wait and see what the others think. In the
meantime, I’ll have to dive deeper in the PEP and the actual importer
code.


> Maybe that’s what you had in mind: import straight from upstream rather than via PyPI?

I actually had nothing in mind! I blacked out after sending this email.
Too many emotions at once, I guess! I had no clue it was such a mess. 😅

-- 
Tanguy




Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Tue, 26 Mar 2024 17:15:02 GMT) Full text and rfc822 format available.

Message #20 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Tanguy LE CARROUR <tanguy <at> bioneland.org>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 Munyoki Kilyungi <me <at> bonfacemunyoki.com>, Lars-Dominik Braun <lars <at> 6xq.net>,
 jgart <jgart <at> dismail.de>, Marius Bakke <marius <at> gnu.org>, 69997 <at> debbugs.gnu.org
Subject: Re: bug#69997: Should ‘guix import pypi’
 get dependencies from pyproject files?
Date: Tue, 26 Mar 2024 18:14:10 +0100
Hi,

Quoting Tanguy LE CARROUR (2024-03-26 17:55:23)
> Quoting Ludovic Courtès (2024-03-26 17:04:52)
> > Tanguy LE CARROUR <tanguy <at> bioneland.org> skribis:
> > > So, my answer would be: do not import from PyPI! Yes, I know, it’s radical! 😅
> > > But if you have to, rely on the wheel’s `METADATA` file.
> > >
> > > I hope this make sense. … I’m not really sure any more! 😅
> > 
> > It does!
> > 
> > But then I mean, we could offer, say, ‘guix import upstream https://…’,
> > and that thing could parse ‘setup.py’ or similar to produce a package
> > definition from that.
> […]
> So I would say… let’s wait and see what the others think. In the
> meantime, I’ll have to dive deeper in the PEP and the actual importer
> code.

According to PEP 427 [1] a.k.a. Binary distribution format [2], if you
go for packaged/PyPI then we should go for `METADATA`.

[1]: https://peps.python.org/pep-0427/
[2]: https://packaging.python.org/en/latest/specifications/binary-distribution-format/#the-dist-info-directory

But, as stated earlier, we should build from source, to make sure we can
run the test suite. Active projects should slowly migrate to PEP 517 [3]
`pyproject.toml`. But, this is not a solution! 😱 This is actually yet
another problem! 😵

[3]: https://peps.python.org/pep-0517/

Each build system relies on it’s own file organization. For instance, Poetry
looks for a `[tool.poetry.dependencies]` section in the file. So the
importer should be "build system aware", which leads us to… `guix import poetry URL`!?
Not really generic any more! 😞

I guess we should sleep on it…

-- 
Tanguy




Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Wed, 27 Mar 2024 06:50:03 GMT) Full text and rfc822 format available.

Message #23 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Lars-Dominik Braun <lars <at> 6xq.net>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: Tanguy Le Carrour <tanguy <at> bioneland.org>,
 Munyoki Kilyungi <me <at> bonfacemunyoki.com>, jgart <jgart <at> dismail.de>,
 Marius Bakke <marius <at> gnu.org>, Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 69997 <at> debbugs.gnu.org
Subject: Re: bug#69997: Should ‘guix import pypi’ get dependencies from pyproject files?
Date: Wed, 27 Mar 2024 07:49:27 +0100
Hey Ludo,

> Should ‘guix import pypi’ attempt to get dependency information from
> ‘pyproject.toml’, in addition to ‘requirements.txt’ and wheel ‘METADATA’
> as it already does?

yes it should. It’s the next logical step after having a
pyproject-build-system. The python-team branch (not sure whether Ricardo
had time to merge it yet) adds a TOML parser to Guix as a first step.

> It might be more complicated than we’d like: in some cases, that file
> seems to be used as a “trampoline” to Poetry.  For instance, in
> python-pypugjs, the ‘requires’ bit delegates everything to Poetry:

The file is always a trampoline to other build systems, like setuptools
or poetry. That’s (unfortunately) by design, see the [build-system]
section.

> [tool.poetry.dependencies]
> python = "^3.8"
> Jinja2 = "^3.1.1"
> Mako = "^1.1.3"
> tornado = "^6.0.4"
> six = "^1.15.0"
> coverage = "^6.3.2"
> nose = "^1.3.7"
> Flask = "^2.1.1"
> charset-normalizer = "^2.1.0"
> flake8 = "^4.0.1"

That’s unfortunate, because the
specification includes a common field for dependencies:
https://packaging.python.org/en/latest/specifications/pyproject-toml/#dependencies-optional-dependencies
I guess we’ll have to deal with these idiosyncracies as well :(

Lars





Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Thu, 28 Mar 2024 18:11:02 GMT) Full text and rfc822 format available.

Message #26 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludovic.courtes <at> inria.fr>
To: Tanguy LE CARROUR <tanguy <at> bioneland.org>
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 Munyoki Kilyungi <me <at> bonfacemunyoki.com>, Lars-Dominik Braun <lars <at> 6xq.net>,
 jgart <jgart <at> dismail.de>, Marius Bakke <marius <at> gnu.org>, 69997 <at> debbugs.gnu.org
Subject: Re: bug#69997: Should ‘guix import
 pypi’ get dependencies from pyproject files?
Date: Thu, 28 Mar 2024 19:09:49 +0100
Hi,

Tanguy LE CARROUR <tanguy <at> bioneland.org> skribis:

> Quoting Ludovic Courtès (2024-03-26 17:04:52)

[...]

>> But then I mean, we could offer, say, ‘guix import upstream https://…’,
>> and that thing could parse ‘setup.py’ or similar to produce a package
>> definition from that.
>
> I’m not against a good-old-generic-solution®, but this one might be
> a bit… too generic. It contains no mention to Python, so the next logical step
> would be `guix import URL`. Not that I would not like it, though! 😁

Well, this has been on my mind for a long time.  Such a tool could
provide at least a useful package skeleton even for software using CMake
or Autotools.

> So I would say… let’s wait and see what the others think. In the
> meantime, I’ll have to dive deeper in the PEP and the actual importer
> code.

Looks like consensus among you Pythonistas has yet to be reached
regarding whether ‘pyproject.toml’ data would be a useful addition.  :-)

We’ll see!

Ludo’.

PS: I hear more and more long-time Python developers dismayed by the sad
    state of packaging and code evolution in Python.  In Guile land, we
    say: refugees welcome!  Come discover a great language and a great
    community (together with their own set of problems).




Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Fri, 29 Mar 2024 07:47:01 GMT) Full text and rfc822 format available.

Message #29 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Tanguy LE CARROUR <tanguy <at> bioneland.org>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 Munyoki Kilyungi <me <at> bonfacemunyoki.com>, Lars-Dominik Braun <lars <at> 6xq.net>,
 jgart <jgart <at> dismail.de>, Marius Bakke <marius <at> gnu.org>, 69997 <at> debbugs.gnu.org
Subject: Re: bug#69997: Should ‘guix import pypi’
 get dependencies from pyproject files?
Date: Fri, 29 Mar 2024 08:46:01 +0100
Hi Ludo’,


Quoting Ludovic Courtès (2024-03-28 19:09:49)
> Tanguy LE CARROUR <tanguy <at> bioneland.org> skribis:
> 
> > Quoting Ludovic Courtès (2024-03-26 17:04:52)
> 
> [...]
> 
> >> But then I mean, we could offer, say, ‘guix import upstream https://…’,
> >> and that thing could parse ‘setup.py’ or similar to produce a package
> >> definition from that.
> >
> > I’m not against a good-old-generic-solution®, but this one might be
> > a bit… too generic. It contains no mention to Python, so the next logical step
> > would be `guix import URL`. Not that I would not like it, though! 😁
> 
> Well, this has been on my mind for a long time.  Such a tool could
> provide at least a useful package skeleton even for software using CMake
> or Autotools.
> 
> > So I would say… let’s wait and see what the others think. In the
> > meantime, I’ll have to dive deeper in the PEP and the actual importer
> > code.
> 
> Looks like consensus among you Pythonistas has yet to be reached
> regarding whether ‘pyproject.toml’ data would be a useful addition.  :-)

I have to admit that the Zen of Python [1] "There should be one-- and preferably only one --
obvious way to do it." has been recently difficult to follow packaging-wise!

[1]: https://peps.python.org/pep-0020

Even Poetry, the one I’ve been using for years, as made questionable
decisions [2] and I have to admit that I had a look at the competitors.

[2]: https://python-poetry.org/docs/faq/#why-does-poetry-not-adhere-to-semantic-versioning


> PS: I hear more and more long-time Python developers dismayed by the sad
>     state of packaging and code evolution in Python.  In Guile land, we
>     say: refugees welcome!  Come discover a great language and a great
>     community (together with their own set of problems).

Thanks for the kind invitation, but… I have an acute form of parens-itis.
Seeing more that a pair of parenthesis on a single line make my eyes bleed! 😅
And… `#` is for comments, every other use is complete heresy and those
who go against the creed should suffer! … isn’t that what the parentheses
are for?! 😉

Any way, thanks again for caring about Python!

Regards,

-- 
Tanguy




Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Fri, 29 Mar 2024 09:07:01 GMT) Full text and rfc822 format available.

Message #32 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludovic.courtes <at> inria.fr>
To: Tanguy LE CARROUR <tanguy <at> bioneland.org>
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 Munyoki Kilyungi <me <at> bonfacemunyoki.com>, Lars-Dominik Braun <lars <at> 6xq.net>,
 jgart <jgart <at> dismail.de>, Marius Bakke <marius <at> gnu.org>, 69997 <at> debbugs.gnu.org
Subject: Re: bug#69997: Should ‘guix import
 pypi’ get dependencies from pyproject files?
Date: Fri, 29 Mar 2024 10:06:31 +0100
Tanguy LE CARROUR <tanguy <at> bioneland.org> skribis:

>> PS: I hear more and more long-time Python developers dismayed by the sad
>>     state of packaging and code evolution in Python.  In Guile land, we
>>     say: refugees welcome!  Come discover a great language and a great
>>     community (together with their own set of problems).
>
> Thanks for the kind invitation, but… I have an acute form of parens-itis.
> Seeing more that a pair of parenthesis on a single line make my eyes bleed! 😅
> And… `#` is for comments, every other use is complete heresy and those
> who go against the creed should suffer! … isn’t that what the parentheses
> are for?! 😉

Worry not! As part of our refugees-welcome effort, “we” have put
together tools and guides to help you feel at home:

  https://hg.sr.ht/~arnebab/wisp
  https://www.draketo.de/py2guile

:-)

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Fri, 29 Mar 2024 10:12:01 GMT) Full text and rfc822 format available.

Message #35 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Tanguy LE CARROUR <tanguy <at> bioneland.org>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 Munyoki Kilyungi <me <at> bonfacemunyoki.com>, Lars-Dominik Braun <lars <at> 6xq.net>,
 jgart <jgart <at> dismail.de>, Marius Bakke <marius <at> gnu.org>, 69997 <at> debbugs.gnu.org
Subject: Re: bug#69997: Should ‘guix import pypi’
 get dependencies from pyproject files?
Date: Fri, 29 Mar 2024 11:11:09 +0100
Quoting Ludovic Courtès (2024-03-29 10:06:31)
> Tanguy LE CARROUR <tanguy <at> bioneland.org> skribis:
> 
> >> PS: I hear more and more long-time Python developers dismayed by the sad
> >>     state of packaging and code evolution in Python.  In Guile land, we
> >>     say: refugees welcome!  Come discover a great language and a great
> >>     community (together with their own set of problems).
> >
> > Thanks for the kind invitation, but… I have an acute form of parens-itis.
> > Seeing more that a pair of parenthesis on a single line make my eyes bleed! 😅
> > And… `#` is for comments, every other use is complete heresy and those
> > who go against the creed should suffer! … isn’t that what the parentheses
> > are for?! 😉
> 
> Worry not! As part of our refugees-welcome effort, “we” have put
> together tools and guides to help you feel at home:
> 
>   https://hg.sr.ht/~arnebab/wisp
>   https://www.draketo.de/py2guile

😵… 😱… 🤯!

-- 
Tanguy




Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Sun, 15 Dec 2024 16:13:01 GMT) Full text and rfc822 format available.

Message #38 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Lars-Dominik Braun <lars <at> 6xq.net>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: Tanguy LE CARROUR <tanguy <at> bioneland.org>, 69997 <at> debbugs.gnu.org,
 Sharlatan Hellseher <sharlatanus <at> gmail.com>
Subject: Re: Should ‘guix import pypi’
 get dependencies from pyproject files?
Date: Sun, 15 Dec 2024 17:12:12 +0100
[Message part 1 (text/plain, inline)]
Hi,

> Should ‘guix import pypi’ attempt to get dependency information from
> ‘pyproject.toml’, in addition to ‘requirements.txt’ and wheel ‘METADATA’
> as it already does?

attached patches allow parsing the standardized pyproject.toml fields
for dependencies. This won’t work for poetry (we need a different
version parser for that), but it’s a start.

Lars

[0001-import-pypi-Support-extracting-dependencies-from-pyp.patch (text/plain, attachment)]
[0002-import-pypi-Add-python-wheel-to-native-inputs-if-set.patch (text/plain, attachment)]
[0003-import-pypi-Default-to-setuptools-as-build-system-in.patch (text/plain, attachment)]
[0004-import-pypi-Move-deduplication-to-final-processing-s.patch (text/plain, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Mon, 16 Dec 2024 01:32:02 GMT) Full text and rfc822 format available.

Message #41 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 69997 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Lars-Dominik Braun <lars <at> 6xq.net>
Subject: Should ‘guix import pypi’ get dependencies from pyproject files?
Date: Mon, 16 Dec 2024 01:30:31 +0000
[Message part 1 (text/plain, inline)]
Hi,

As it's pypi importer which improving refresh as well, may
it be pushed to master or we need it on team branch first?

Thanks,
Oleg
[Message part 2 (text/html, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Mon, 16 Dec 2024 09:01:02 GMT) Full text and rfc822 format available.

Message #44 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludovic.courtes <at> inria.fr>
To: Lars-Dominik Braun <lars <at> 6xq.net>
Cc: Tanguy LE CARROUR <tanguy <at> bioneland.org>, 69997 <at> debbugs.gnu.org,
 Sharlatan Hellseher <sharlatanus <at> gmail.com>
Subject: Re: Should ‘guix import pypi’ get dependencies from pyproject files?
Date: Mon, 16 Dec 2024 10:00:00 +0100
Hello,

Lars-Dominik Braun <lars <at> 6xq.net> skribis:

> attached patches allow parsing the standardized pyproject.toml fields
> for dependencies. This won’t work for poetry (we need a different
> version parser for that), but it’s a start.

Excellent!  The code LGTM (I can’t really tell about the Python side of
things).

> +               (list (guess-requirements-from-pyproject.toml dir)
> +                     (guess-requirements-from-requires.txt dir))))

It looks like we still take info from ‘requirements.txt’; is
‘pyproject.toml’ insufficient?

Anyhow, if others on the Python team approve, I guess you can go ahead
and push it.

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Mon, 16 Dec 2024 10:29:02 GMT) Full text and rfc822 format available.

Message #47 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: Tanguy LE CARROUR <tanguy <at> bioneland.org>, 69997 <at> debbugs.gnu.org,
 Lars-Dominik Braun <lars <at> 6xq.net>
Subject: Re: Should ‘guix import pypi’ get dependencies from pyproject files?
Date: Mon, 16 Dec 2024 10:26:42 +0000
Hi Ludovic,

> It looks like we still take info from ‘requirements.txt’; is
Python packaging ecosystem is not standradisied like in Julia
somteimes you may see all at once setup.cfg, setup.py, pyproject.toml,
 requirements*.txt (covering in separate files dev/install deps),

Poetry changed the game as it become popular but it does not follow
PEP in pyproject.toml and just
created it's own config field in it not copatible with pip.

This patch would help to refresh easely most of the astronomy packages
as they are on
pyproject.toml and failed to be refresh with guix refresh CLI.

Lars, do you have a commit access?

> Anyhow, if others on the Python team approve, I guess you can go ahead
and push it.

I vote for merge as well

Thanks,
Oleg




Information forwarded to bug-guix <at> gnu.org:
bug#69997; Package guix. (Mon, 16 Dec 2024 18:43:02 GMT) Full text and rfc822 format available.

Message #50 received at 69997 <at> debbugs.gnu.org (full text, mbox):

From: Lars-Dominik Braun <lars <at> 6xq.net>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>,
 Sharlatan Hellseher <sharlatanus <at> gmail.com>
Cc: 69997 <at> debbugs.gnu.org, Tanguy LE CARROUR <tanguy <at> bioneland.org>
Subject: Re: Should ‘guix import pypi’
 get dependencies from pyproject files?
Date: Mon, 16 Dec 2024 19:42:29 +0100
Hi,

> It looks like we still take info from ‘requirements.txt’; is
> ‘pyproject.toml’ insufficient?

correct. As a first quality of life improvement I would keep the other
information sources, but as we improve the importer further (by adding
poetry support for example), we need to fall back on them less often
I hope.

> Lars, do you have a commit access?

I have, but please go ahead and merge it into master. My available time
slots to work on Guix are quite limited, so merging my patches – even
though I have commit access – speeds things up.

Lars





Reply sent to Sharlatan Hellseher <sharlatanus <at> gmail.com>:
You have taken responsibility. (Mon, 16 Dec 2024 19:31:02 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludovic.courtes <at> inria.fr>:
bug acknowledged by developer. (Mon, 16 Dec 2024 19:31:02 GMT) Full text and rfc822 format available.

Message #55 received at 69997-done <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 69997-done <at> debbugs.gnu.org
Subject: Should ‘guix import pypi’ get dependencies from pyproject files?
Date: Mon, 16 Dec 2024 19:29:51 +0000
[Message part 1 (text/plain, inline)]
Hi,

Pushed as

a3ffb920f1 * master import: pypi: Move deduplication to final processing step.
c904350a81 * import: pypi: Default to setuptools as build system input.
d7890af335 * import: pypi: Add python-wheel to native inputs if setuptools is used.
8bb3bb19c2 * import: pypi: Support extracting dependencies from pyproject.toml.

to master.

--
Thanks,
Oleg
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 14 Jan 2025 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 27 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.