Repository navigation
Different Python versions in monorepo #2675
Replies: 1 comment
|
Yes—keep the projects as independent PDM projects inside the same Git repository. Each project can have its own For example, assuming pdm use -p packages/legacy 3.9
pdm install -p packages/legacy
pdm run -p packages/legacy python -V
pdm use -p packages/modern 3.12
pdm install -p packages/modern
pdm run -p packages/modern python -VWith PDM 2.13+ and the default
One version-specific distinction: PDM 2.28+ also has experimental workspaces. Workspace members share the root environment and lock file, so a single workspace is a different setup from the independent environments described above. For projects that actually need different runtimes, keep them independent rather than registering them as members of one workspace. References: virtual environments, CLI options, workspace environment sharing. |
Uh oh!
There was an error while loading. Please reload this page.
I am thinking abouit moving to a monorepo structure.
I have a couple of libraries/projects that require different Python versions (3.12 all the way down to 3.9). I am wondering if/how I can use different Python versions in a monorepo?
I can declare the
requires-pythonpart in every individualpyproject.tomlfile in my libraries/projects accordingly. But isn't this related to have dedicated.venvfor every project? How is this going to work?All reactions