python-poetry / python-poetry/poetry
Wrong metadata generated for old Python versions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption).
- OS version and name: Ubuntu 20.04.2 LTS / WSL2
- Poetry version: 1.1.5
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/tueda/4c591340c44139b31093a84c4e63d05e#file-pyproject-toml
Issue
Although Poetry doesn't run with old Python versions like 2.6, as far as I understand, developing packages supporting Python 2.6 should be still supported by Poetry (running with a newer Python).
But it seems that source distributions and wheels generated by poetry build have wrong metadata for old Python versions.
Example:
[tool.poetry.dependencies]
python = "~2.6 || ~2.7 || ^3.2"
Poetry generates:
Metadata-Version: 2.1
Name: example
Version: 0.1.0
Summary:
Author: Your Name
Author-email: you@example.com
Requires-Python: >=2.7, !=3.0.*, !=3.1.*
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
So, 2.6 is omitted in Requires-Python (same for python_requires in setup.py). 3.2 and 3.3 are also missing in the classifiers.
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
Reproduce the issue with the linked pyproject.toml and poetry build, then inspect the generated source-distribution and wheel metadata. Check how the Python constraint becomes Requires-Python and classifiers; done means Python 2.6 appears in Requires-Python and Python 3.2 and 3.3 are represented in the classifiers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100