PEP621 (Storing project metadata in pyproject.toml) and PEP631 (Dependency specification in pyproject.toml based on PEP 508) define a clear way how metadata and dependencies should be stored. Both of them have the status "accepted". It would be good if poetry would use that.
For example, I've noticed that poetry init generates a pretty similar pyproject.toml, but puts the metadata in a poetry-specific section.
The status of _PEP 621_ is still "Draft". But yes, I guess it's a valid request (assuming it actually gets accepted and depending under which form). It might take a while though... the way I see it, there are still too many uncertainties
Uh, interesting. My bad. However, PEP-631 is accepted. Do you see uncertainties there as well?
At some point, I thought there was an intention to merge the text of 631 into 621, to avoid having to refer to two documents, since 631 is rather short and unsurprising. Don't know if it will happen, or if it stays as 2 separate documents. I lost track of that conversation. And there are some more points of 621 that are still being discussed.
Now, if I put myself in the shoes of poetry:
Personally I am curious to see how poetry will handle this. There is always the _dynamic_ escape hatch for dependencies. If I were _poetry_, I would probably try to offer both dependency notations (the existing _poetry_ notation as _dynamic_ and the new/old PEP 631 one). I had suggested a compromise hybrid notation here but it didn't gain any traction at all (probably because too complex to parse, I don't know).
there was an intention to merge the text of 631 into 621
It's mentioned in the abstract of PEP-0631. However, I don't know when this will happen and where the discussion around that is.
PEP 631 could definitely be seen as a step backwards.
I'm surprised by that. Why do you think so? To me, it seems like a step towards more standardization and thus positive.
I would probably try to offer both dependency notations
Yes, I think that would be desirable just to not break a working setup for anybody. Is the poetry dependency notation more powerful or even different at all?
Is the poetry dependency notation more powerful or even different at all?
It's all in the discussions, particularly this one, I don't want to repeat things and take them out of context:
The discussion about how the dependencies should be defined within PEP-621 was quite said and frustrating for us as poetry maintainers. But I will not go into details now...
As @sdispater has said somewhere in the discussion, poetry will probably not be one of the earlier adopters of PEP-621 now PEP-631 is accepted. We have a problem here now: On the one hand, we want to support as many standards as possible and on the other, user experience is an important topic for us. And we believe that PEP-631 will be a step backwards compared to what we have now. A dilemma we have to discuss. :(
PEP 621's status is now provisionally accepted as of 8 days ago.
From the point of view of a package dev., having a build tool-independent metadata specification in pyproject.toml is useful to be able to parse metadata from the file without adding build tool-specific references elsewhere, and without duplicating information.
Use case examples:
project.scripts.*: when building container images, to determine which file to reference as to be executed.project.requires-python: to determine which Python versions to run tests against.project.optional-dependencies.test: to install test dependencies.I have been using/parsing all of the above based on the PEP 621/631 drafts, and duplicating this info in pyproject.toml for now from the tool.poetry sections.
Fundamentally, project metadata is not only used by build tools, so having Poetry support (provisionally) accepted standards for these allows the developer to use the metadata for other cases without duplication, and having this support from Poetry would be fantastic :)
Additionally, PEP 621 is now referenced at https://packaging.python.org/specifications/declaring-project-metadata/.
Most helpful comment
At some point, I thought there was an intention to merge the text of 631 into 621, to avoid having to refer to two documents, since 631 is rather short and unsurprising. Don't know if it will happen, or if it stays as 2 separate documents. I lost track of that conversation. And there are some more points of 621 that are still being discussed.
Now, if I put myself in the shoes of poetry:
Personally I am curious to see how poetry will handle this. There is always the _dynamic_ escape hatch for dependencies. If I were _poetry_, I would probably try to offer both dependency notations (the existing _poetry_ notation as _dynamic_ and the new/old PEP 631 one). I had suggested a compromise hybrid notation here but it didn't gain any traction at all (probably because too complex to parse, I don't know).