-
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 (#…
…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>
- Loading branch information
1 parent
211ba15
commit 0727a7b
Showing
6 changed files
with
98 additions
and
44 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
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