Add parsing of pyproject.toml
Summary 💡
UV uses the PEP 518 and PEP 621 specs for its pyproject.toml
In pyproject.toml,
- The project's description is at
project.description - Dependencies are at
project.dependencies, with dev dependencies atdependency-groups.dev - License is at
project.license.text - Version is at
project.version
However, if you want to add support for poetry,
- The project's description is at
tool.poetry.description - Dependencies are at
tool.poetry.dependencieswith dev dependencies attool.poetry.group.dev.dependencies(these are formatted as a dictionary, with a<dependency> = <version>arrangement - License is at
tool.poetry.license - Version is at
tool.poetry.version
There are a couple other key-value pairs available, but these seem to be the main ones.
Motivation 🔦
Adding support for Python's pyproject.toml specification.
I noticed that #345 was opened for the same thing, but it was marked as completed even though I don't see it in the repository.
requirements.txtandrequirements-*.txtwithsetup.pyand/orsetup.cfgpyproject.toml(Poetry format)pyproject.toml(UV format)Pipfile
Any that I'm missing? :laughing:
I think we should focus most of our efforts on the format specified by the PEPs. Ideally, IMO, other tools (like poetry) should move towards a unified standard, much like how every Node package manager can read package.json.
Yep, those should be it. I think it is best to add support for requirements.txt and uv styled pyproject.toml. Poetry doesn't seem as common as uv, so it can be of less priority. I have never seen a pip file though 😅