Allow different versions in (dev) sections
See original GitHub issueIs your feature request related to a problem? Please describe.
I would be very helpful if versions are resolved/locked separately for different sections. Currently, the pdm.cli.actions.do_lock
procedure locks whatever the highest version between all sections is. pdm.cli.actions.do_sync
then looks at the lock file and installs the version it finds there, regardless of the specification given in the section that it is locking for.
pdm.cli.actions.do_lock
appears to mention this feature in the TODO at the top of the function, but I could not find a github issue for it.
Describe the solution you’d like
A simplified example pyproject.toml would be
dependencies = [
"pdm"
]
[tool.pdm.dev-dependencies]
dev = [
"-e pdm @ git+https://github.com/pdm-project/pdm"
]
pdm install --prod
would install the latest version from the package index, while pdm install -d
would install the package from the git repo.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How do I override nested NPM dependency versions?
Overrides provide a way to replace a package in your dependency tree with another version, or another package entirely. These changes can be...
Read more >Install multiple versions of a dependency · Issue #5499 - GitHub
I support multiple versions of Express. During development I want to be able to test my application with different versions of my dependency....
Read more >How to Install Multiple Versions of the Same Package in NPM
You can use this Node package manager (nvm) to handle different versions of Node.
Read more >How to switch Node.js versions with NVM - LogRocket Blog
Learn about Node Version Manager (NVM), a Node.js version management tool that quickly installs and switches Node versions from the CLI.
Read more >Installing Multiple Versions of Node.js Using nvm - SitePoint
Michael and James introduce nvm, a handy command-line tool that allows you to install multiple versions of Node.js and switch between them ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@frostming Any new thoughts on how to approach this. I’ve currently taken your naive approach above and run the install in parallel for all combinations of dependency groups specified by the user (i.e. main/local, main/deploy, main/prod), and then generate a requirements file for each configuration that is stored in the repo. This solution allows us to use the correct version of our project dependencies during local development, local deployment, and production release. However, I’m not happy with the solution although it works pretty well for us so far.
Some thoughts:
If this is an opt-in functionality, is there anything wrong with it being slower?
Perhaps multiple processes can be used to help improve performance in this case.
It seems like the need for this is becoming more common as monorepo strategies are becoming more popular again. It would be nice if pdm could support this case, and in particular, the use case for the same editable and local package being able to live side-by-side. Maybe the latter can be a separate feature/use case.
I just also want to add that this would be very useful for me. Apart from #1432 which was just merged, this is the only other thing missing for my usual workflow for co-developing different packages.