pdm-project / pdm

A modern Python package and dependency manager supporting the latest PEP standards
https://pdm-project.org
MIT License
7.82k stars 387 forks source link

PDM run from outside path, dependencies path as argument #819

Closed bolinocroustibat closed 2 years ago

bolinocroustibat commented 2 years ago

I don't know if this feature request is out of scope and/or impossible, or if it's already possible in some way.

Is your feature request related to a problem? Please describe.

It would be great to be able to use PDM as well not only locally when working in a specific PDM-set project directory, but also on a staging or production server, getting rid of virtual environments completely. For this, it would be great if we could execute a Python project with the pdm run command not only from the project directory but from anywhere (from a cron, or from a systemd file fro example), and still take into account the project dependencies context.

Describe the solution you'd like

We could, for example, pass a path to the project pyproject.toml and dependencies as an argument to the pdm run command, like pdm run /var/www/myproject/manage.py --path /var/www/myproject/pyproject.toml and/or have a descriptor of the path of the __pypackages__ in .pdm.lock. Does that make sense?

frostming commented 2 years ago

you may need to look at the -p option

frostming commented 2 years ago

Closing since already supported