python-poetry / python-poetry/poetry
Add build-system.requires to lock file
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the FAQ and general documentation and believe that my question is not already covered.
Feature Request
Problem
A notable thing missing from poetry.lock are build-systems used to build from sdists.
This is useful in efforts like poetry2nix that uses Poetry metadata.
Nix build environments are constructed in a much stricter way where we cannot dynamically install/load build-systems.
Currently users of this tool have to resort to manually adding overrides into Nix code to work around this missing metadata.
This issue has been reported many times over the years in various forms:
- https://github.com/nix-community/poetry2nix/issues/568
- https://github.com/nix-community/poetry2nix/issues/1435
And has generally been a large source of maintenance that could be completely automated away.
Adding this metadata also has other uses such as building tools that can statically inspect the build-time dependency graph.
Solution
One more possible entries in poetry.lock:
build-system.requires
We only need to know build-system.requires & up front when constructing the build environment.
There is no need to add build-system.backend or build-system.backend-path.
The PyPi API does not have this metadata. It would need to be extracted from the sdist.
Note
Do note that this is not a suggestion to lock build systems, merely to add the contents of build-system.requires.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the poetry.lock generation path and how Poetry reads package metadata from sdists; the issue notes that the PyPI API does not provide build-system.requires. Trace where sdist metadata can be extracted without adding backend or backend-path. Done means poetry.lock records build-system.requires for applicable packages and existing lock behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100