python-poetry / python-poetry/poetry
Arbitrary Equality Requirements
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
Hi, I think poetry should support arbitrary equality requirements as described in PEP 440. Current behavior is problematic in case of the following usage:
[tool.poetry.dependencies]
xgboost= [
{version = "0.81+upstream", markers = "sys_platform == 'linux'", source="***"},
{version = "0.81", markers = "sys_platform != 'linux'", source="***"},
]
Results in only the 0.81+upstream version ever being installed (as though installed with pip install xgboost==0.81, which too installs 0.81+upstream if available)
I propose to make the following requirement legal
[tool.poetry.dependencies]
xgboost= [
{version = "0.81+upstream", markers = "sys_platform == 'linux'", source="***"},
{version = "===0.81", markers = "sys_platform != 'linux'", source="***"},
]
Which will install 0.81+upstream on linux systems and 0.81 on non-linux systems (install as though with pip install xgboost===0.81)
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
The issue names no source files, tests, or entry points. Start by reading PEP 440's arbitrary-equality section and reproducing the xgboost dependency examples; trace Poetry's requirement parsing and resolution behavior, with done meaning ===0.81 is accepted and selects the requested versions under the stated platform markers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100