-
-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InvalidPyVersion raised when trying to add a coverage
dependency
#1111
Comments
We also started seeing these errors today in our CI jobs. I can't tell yet which project it is from though 🤔 From 621 metadata it sounds like prerelease versions should be valid. |
Ours was also due to coverage 6.4.1 which now specifies in setup.py: extras_require={
# Enable pyproject.toml support.
'toml': ['tomli; python_full_version<="3.11.0a6"'],
}, This was done do resolve nedbat/coveragepy#1390 |
Recently, coverage 6.4.1 listed its requirements with an alpha version of python and this broke PDM's version parsing: extras_require={ 'toml': ['tomli; python_full_version<="3.11.0a6"'], }, Prerelease `requires-python` versions *are* valid, per these specifications: * https://peps.python.org/pep-0440/ * https://peps.python.org/pep-0621/#requires-python * https://packaging.python.org/en/latest/specifications/core-metadata/#requires-python Therefore this commit adds missing parsing support for `{a|b|rc}[N]` pre-release specifiers which are used by python language releases: * https://docs.python.org/3/faq/general.html#how-does-the-python-version-numbering-scheme-work This bug meant that projects that directly or indirectly depended on coverage were unable to update pdm.lock using commands like `update` `add` `lock` and `install` because `pdm.models.versions.Version` would raise: pdm.exceptions.InvalidPyVersion: 3.11.0a6: Prereleases or postreleases are not supported for python version specifers. Until this is fixed, projects can workaround this by depending on: "coverage<6.4", "coverage[toml]<6.4", Fixes pdm-project#1111
I added a pull request which fixes the issue. Until its merged, as a workaround, you can add
to |
Recently, coverage 6.4.1 listed its requirements with an alpha version of python and this broke PDM's version parsing: extras_require={ 'toml': ['tomli; python_full_version<="3.11.0a6"'], }, Prerelease `requires-python` versions *are* valid, per these specifications: * https://peps.python.org/pep-0440/ * https://peps.python.org/pep-0621/#requires-python * https://packaging.python.org/en/latest/specifications/core-metadata/#requires-python Therefore this commit adds missing parsing support for `{a|b|rc}[N]` pre-release specifiers which are used by python language releases: * https://docs.python.org/3/faq/general.html#how-does-the-python-version-numbering-scheme-work This bug meant that projects that directly or indirectly depended on coverage were unable to update pdm.lock using commands like `update` `add` `lock` and `install` because `pdm.models.versions.Version` would raise: pdm.exceptions.InvalidPyVersion: 3.11.0a6: Prereleases or postreleases are not supported for python version specifers. Until this is fixed, projects can workaround this by depending on: "coverage<6.4", "coverage[toml]<6.4", Fixes pdm-project#1111
Recently, coverage 6.4.1 listed its requirements with an alpha version of python and this broke PDM's version parsing: extras_require={ 'toml': ['tomli; python_full_version<="3.11.0a6"'], }, Prerelease `requires-python` versions *are* valid, per these specifications: * https://peps.python.org/pep-0440/ * https://peps.python.org/pep-0621/#requires-python * https://packaging.python.org/en/latest/specifications/core-metadata/#requires-python Therefore this commit adds missing parsing support for `{a|b|rc}[N]` pre-release specifiers which are used by python language releases: * https://docs.python.org/3/faq/general.html#how-does-the-python-version-numbering-scheme-work This bug meant that projects that directly or indirectly depended on coverage were unable to update pdm.lock using commands like `update` `add` `lock` and `install` because `pdm.models.versions.Version` would raise: pdm.exceptions.InvalidPyVersion: 3.11.0a6: Prereleases or postreleases are not supported for python version specifers. Until this is fixed, projects can workaround this by depending on: "coverage<6.4", "coverage[toml]<6.4", Fixes pdm-project#1111
…1112) * Fix crash if dependencies have prerelease requires-python versions Recently, coverage 6.4.1 listed its requirements with an alpha version of python and this broke PDM's version parsing: extras_require={ 'toml': ['tomli; python_full_version<="3.11.0a6"'], }, Prerelease `requires-python` versions *are* valid, per these specifications: * https://peps.python.org/pep-0440/ * https://peps.python.org/pep-0621/#requires-python * https://packaging.python.org/en/latest/specifications/core-metadata/#requires-python Therefore this commit adds missing parsing support for `{a|b|rc}[N]` pre-release specifiers which are used by python language releases: * https://docs.python.org/3/faq/general.html#how-does-the-python-version-numbering-scheme-work This bug meant that projects that directly or indirectly depended on coverage were unable to update pdm.lock using commands like `update` `add` `lock` and `install` because `pdm.models.versions.Version` would raise: pdm.exceptions.InvalidPyVersion: 3.11.0a6: Prereleases or postreleases are not supported for python version specifers. Until this is fixed, projects can workaround this by depending on: "coverage<6.4", "coverage[toml]<6.4", Fixes #1111 * Remove workaround for pre-release python in global environment Since prereleases are now supported in python specifiers (in the previous commit), we can remove the workaround (from commit 8e72609 for #932) that converted a python prerelease version to a specifier range. Co-authored-by: Hashem Nasarat <hnasarat@beta.team>
…1112) * Fix crash if dependencies have prerelease requires-python versions Recently, coverage 6.4.1 listed its requirements with an alpha version of python and this broke PDM's version parsing: extras_require={ 'toml': ['tomli; python_full_version<="3.11.0a6"'], }, Prerelease `requires-python` versions *are* valid, per these specifications: * https://peps.python.org/pep-0440/ * https://peps.python.org/pep-0621/#requires-python * https://packaging.python.org/en/latest/specifications/core-metadata/#requires-python Therefore this commit adds missing parsing support for `{a|b|rc}[N]` pre-release specifiers which are used by python language releases: * https://docs.python.org/3/faq/general.html#how-does-the-python-version-numbering-scheme-work This bug meant that projects that directly or indirectly depended on coverage were unable to update pdm.lock using commands like `update` `add` `lock` and `install` because `pdm.models.versions.Version` would raise: pdm.exceptions.InvalidPyVersion: 3.11.0a6: Prereleases or postreleases are not supported for python version specifers. Until this is fixed, projects can workaround this by depending on: "coverage<6.4", "coverage[toml]<6.4", Fixes pdm-project/pdm#1111 * Remove workaround for pre-release python in global environment Since prereleases are now supported in python specifiers (in the previous commit), we can remove the workaround (from commit 8e7260968ac for #932) that converted a python prerelease version to a specifier range. Co-authored-by: Hashem Nasarat <hnasarat@beta.team>
Steps to reproduce
pdm add "coverage==6.4.1"
Actual behavior
InvalidPyVersion raised
Expected behavior
The dependency was successfully added without errors
Environment Information
The text was updated successfully, but these errors were encountered: