Skip to content
This repository was archived by the owner on Jul 16, 2022. It is now read-only.

Clarification on multiple virtual environments for a project #37

Open
hoangthienan95 opened this issue Apr 30, 2022 · 1 comment
Open

Comments

@hoangthienan95
Copy link

The multiple virtual environments for one project is great. From what I understand, it just changes the python interpreter version right? Or does it create a whole new environment that I can add packages of different versions than the original environment?

Use case: I use a package X along with other packages (Y, Z for example ) for my project. I want to use them all with python 3.8 . However, package X developers pin exact version requirements for multiple packages including Y and Z (in order to, per my understanding, ease maintaining efforts).

I cannot use the latest versions with Y and Z with package X in the same environment so I want to create multiple python 3.8 environments, one with Y and Z at latest version and one with X,Y,Z. I want both environments to be associated with the project and their package versions to both be listed in pyproject.toml file so users can recreate these two environments and reproduce my data analysis (project is not a python package).

Is this currently possible with PDM?

@frostming
Copy link
Contributor

frostming commented May 1, 2022

Is this currently possible with PDM?

No unfortunately. PDM resolves dependencies in a way that it honors all requirement specifications, not some. That is, if X requires Y==1 and Z==2, you can't get other versions of Y and Z in the resolution.

For this kind of multi environment management, I recommend tox and it is very easy to use it with PDM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants