I'm using pdm for while now and I'm now experimenting with a monorepo.
I currently have the issue, that pdm lock generates all dependencies in the dev-group. So using "pdm install --prod" in deployment will install nothing at all. Of course I could use "pdm install --dev", but I would like to exclude other dev-dependencies in deployment.
This can be replicated here as well, as soon as the original pdm.lock-file is deleted and regenerated with a simple "pdm lock"-call.
I assume this is based on the fact, that all subpackages are defined (as editables) in the dev section of [tool.pdm.dev-dependencies] in the pyproject.toml in the root-folder
Steps to reproduce:
clone repository
create virtual environment
install pdm in venv
delete pdm.lock
run "pdm lock"
I'm currently using:
PDM, version 2.17.3
Python 3.11.8
Am I missing something or is "pdm lock" not working as intended (anymore).
Adding the dependencies from dev in [tool.pdm.dev-dependencies] in the pyproject.toml in the root-folder as non-editable and running "pdm lock" will add the default group in pdm.lock as well. "pdm install --prod" now works. Although the documentation strictly speaks against using the same dependency in the dev- and default-group.
But there is also another issue and the reason why I found the issue above:
Imagine I have two microservices as well as some own libraries used by these microservices in my monorepo. How can I install only the dependencies of the target microservice? "pdm install --prod -p services/service1" will result in "Candidate not found" for the own library. Just "pdm install --prod" will install all dependencies as well as both microservices bloating the Docker-image. "pdm export -p services/service1/ -L pdm.lock --no-hashes" doesn't generate an error but will also export all dependencies of the project.
Is pdm not made for such a use case or am I missing something?
Hi,
I'm using pdm for while now and I'm now experimenting with a monorepo. I currently have the issue, that pdm lock generates all dependencies in the dev-group. So using "pdm install --prod" in deployment will install nothing at all. Of course I could use "pdm install --dev", but I would like to exclude other dev-dependencies in deployment. This can be replicated here as well, as soon as the original pdm.lock-file is deleted and regenerated with a simple "pdm lock"-call. I assume this is based on the fact, that all subpackages are defined (as editables) in the dev section of [tool.pdm.dev-dependencies] in the pyproject.toml in the root-folder
Steps to reproduce:
I'm currently using: PDM, version 2.17.3 Python 3.11.8
Am I missing something or is "pdm lock" not working as intended (anymore).
Adding the dependencies from dev in [tool.pdm.dev-dependencies] in the pyproject.toml in the root-folder as non-editable and running "pdm lock" will add the default group in pdm.lock as well. "pdm install --prod" now works. Although the documentation strictly speaks against using the same dependency in the dev- and default-group.
But there is also another issue and the reason why I found the issue above: Imagine I have two microservices as well as some own libraries used by these microservices in my monorepo. How can I install only the dependencies of the target microservice? "pdm install --prod -p services/service1" will result in "Candidate not found" for the own library. Just "pdm install --prod" will install all dependencies as well as both microservices bloating the Docker-image. "pdm export -p services/service1/ -L pdm.lock --no-hashes" doesn't generate an error but will also export all dependencies of the project. Is pdm not made for such a use case or am I missing something?