onefetch icon indicating copy to clipboard operation
onefetch copied to clipboard

Add parsing of pyproject.toml

Open NSPC911 opened this issue 5 months ago • 2 comments

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 at dependency-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.dependencies with dev dependencies at tool.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.

NSPC911 avatar Jul 23 '25 23:07 NSPC911

  • requirements.txt and requirements-*.txt with setup.py and/or setup.cfg
  • pyproject.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.

spenserblack avatar Jul 24 '25 15:07 spenserblack

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 😅

NSPC911 avatar Jul 24 '25 16:07 NSPC911