forked from pdm-project/pdm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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#1111
- Loading branch information
Hashem Nasarat
committed
Jun 3, 2022
1 parent
23ab30b
commit b20434b
Showing
5 changed files
with
97 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix a bug where dependencies with `requires-python` pre-release versions caused `pdm update` to fail with `InvalidPyVersion`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters