You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using pdm, I noticed that versions with a .dev suffix (e.g., prefect 3.1.3.dev1) are not correctly identified as prerelease versions. From examining the code, it appears that the current logic only recognizes versions with {a|b|rc}N suffixes as prereleases. This means that .dev versions are mistakenly treated as stable releases, which can cause issues when managing dependencies.
To reproduce
Add a dependency with a .dev version, such as prefect 3.1.3.dev1
Attempt to constrain updates to stable releases only
Observe that .dev versions are not treated as prereleases.
Expected Behavior
Versions with a .dev suffix should be identified as prerelease versions, similar to versions with {a|b|rc}N suffixes, to ensure consistency and prevent unstable versions from being installed when only stable releases are desired.
Add a dependency with a .dev version, such as prefect 3.1.3.dev1
Attempt to constrain updates to stable releases only
Observe that .dev versions are not treated as prereleases.
I don't understand these steps, can you make it clear with commands? How did you add the dependency and how did you constrain updates to stable releases only? @tyong920
Basically if a prerelease has been locked in the lock file, following updates will respect and allow prereleases.
@frostming Thank you very much for your prompt response and insightful feedback!
Bingo! Your note, “Basically, if a prerelease has been locked in the lock file, following updates will respect and allow prereleases”, was exactly on point. Following this advice led me to identify the actual root cause: a transitive dependency in our project directly specifies dependencies = ["prefect>=3.0.0rc1"], which permits prerelease versions and is the underlying reason for the unexpected .dev version installations.
Thanks again for your valuable input, which helped clarify this situation!
Describe the bug
When using pdm, I noticed that versions with a .dev suffix (e.g., prefect 3.1.3.dev1) are not correctly identified as prerelease versions. From examining the code, it appears that the current logic only recognizes versions with {a|b|rc}N suffixes as prereleases. This means that .dev versions are mistakenly treated as stable releases, which can cause issues when managing dependencies.
To reproduce
Expected Behavior
Versions with a .dev suffix should be identified as prerelease versions, similar to versions with {a|b|rc}N suffixes, to ensure consistency and prevent unstable versions from being installed when only stable releases are desired.
Environment Information
PDM version:
2.20.1
Python Interpreter:
/home/projects/p-g/.venv/bin/python (3.12)
Project Root:
/home/projects/p-g
Local Packages:
{
"implementation_name": "cpython",
"implementation_version": "3.12.4",
"os_name": "posix",
"platform_machine": "x86_64",
"platform_release": "5.4.0-150-generic",
"platform_system": "Linux",
"platform_version": "#167~18.04.1-Ubuntu SMP Wed May 24 00:51:42 UTC 2023",
"python_full_version": "3.12.4",
"platform_python_implementation": "CPython",
"python_version": "3.12",
"sys_platform": "linux"
}
pdm -v output
No response
Additional Context
No response
Are you willing to submit a PR to fix this bug?
The text was updated successfully, but these errors were encountered: