How to properly switch from a released dependency to a pre-release #3075
-
Here's a work flow that did not work out quite well for me. Maybe anybody can help with it. BTW: I am still using pdm in version 2.16.1 currently At our company, we store the applications and libraries developed in two company internal pypi repositories: one for the released versions and for the pre-released (aka "dev") versions. The additional, company internal pypi index are configured in pyproject.toml: [tool.pdm.resolution]
respect-source-order = true
allow-prereleases = false # set this to true if prereleases like development versions shall be resolved
[[tool.pdm.source]]
name = "company_pypi_default" # this is just a proxy to official pypi.org/simple index
url = "https://company_server/repository/company_pypi_default/simple"
verify_ssl = false
[[tool.pdm.source]]
name = "company_pypi_internal"
url = "https://company_server/repository/company_pypi_internal/simple"
verify_ssl = false
[[tool.pdm.source]]
# only pre-releases/development versions are stored in the dev pypi repo
name = "company_pypi_internal_dev"
url = "https://company_server/repository/company_pypi_internal_dev/simple"
verify_ssl = false Given I am developing on an app that depends on an internal library (no prerelease), the dependency is configured as follows: dependencies = [
"InternalLibrary>=1.1.0",
] This works well, But when I want to install the latest "dev" version for [tool.pdm.resolution]
allow-prereleases = true In the After changing this, I ran Am I thinking it wrong? Am I missing a configuration or command to make this scenario work? Thanks in advance. Appendix: Here's the term output from running WARNING: Lockfile hash doesn't match pyproject.toml, packages may be outdated
Updating the lock file...
🔒 Lock failed
ERROR: Unable to find a resolution for internallibrary
Please make sure the package name is correct.
See C:\Users\[user]\AppData\Local\pdm\pdm\Logs\pdm-lock-j1g8h8zz.log for detailed debug log.
[ResolutionImpossible]: Unable to find a resolution
WARNING: Add '-v' to see the detailed traceback And here's the debug log:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 13 replies
-
To some extend, I can answer my question by myself: Development versions are handled like pre-releases (see https://packaging.python.org/en/latest/discussions/versioning/): It only worked when I changed my dependency from dependencies = [
"InternalLibrary>=1.1.0",
] to dependencies = [
"InternalLibrary>1.1.0",
] Please note the difference in
Can anybody tell me if this is expected (to have to change the dependency even though Python resolves it differently? |
Beta Was this translation helpful? Give feedback.
It might be because PDM stops at the first index that satisfies the dependency specifier, in the order you configured them.
1.1.0
, not satisfied1.1.1.dev0
, satisfiedTry moving the dev index above the release one in
pyproject.toml
and see if you get the behavior you want 🤷