Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow installing packages without changing pyproject.toml #2907

Open
SamoylovMD opened this issue May 28, 2024 · 3 comments
Open

Allow installing packages without changing pyproject.toml #2907

SamoylovMD opened this issue May 28, 2024 · 3 comments
Labels
⭐ enhancement Improvements for existing features

Comments

@SamoylovMD
Copy link

I want to migrate my team to PDM as a default build manager. We use PyCharm as IDE with remote debug server, which works upon installation of pydevd-pycharm package for the specific PyCharm version (more info). Each member of my team uses different version of PyCharm, however pyproject.toml is shared across the team so I cannot add my own version there because it won't work for the rest of the team.

I didn't find a way to install a package into project virtualenv without modifying pyproject.toml. Did I miss something, or is this feature not implemented? If it's not — I propose to add some option to pdm add command to avoid modification of pyproject.toml, much alike there is an option --no-lock for pdm add. Alternatively, maybe there is a way to allow pdm install accept package definitions as argument so it would install not from lockfile but a direct package into environment?

tldr: allow package installation to environment without adding it to shared files.

@SamoylovMD SamoylovMD added the ⭐ enhancement Improvements for existing features label May 28, 2024
@pawamoy
Copy link
Contributor

pawamoy commented May 28, 2024

It might be possible to use a hook such as post_install to run a pip install command inside the venv (or outside, but targetting the venv's site-packages with the -t option). If you can detect the version of PyCharm currently installed on the system, then maybe you can automatically compute which version of pydevd-pycharm to install from the hook.

@sanmai-NL
Copy link
Contributor

Is pdm add --global usable for you? This should be part of provisioning the workstations of your team members, rather than part of working on a specific software product (pyproject.toml).

@ramnes
Copy link

ramnes commented Sep 11, 2024

Not usable in my use case, because we version our devtools (with mise) and want to provide standard developer environments. Ended up managing the virtualenv with Python itself and installing pdm within the virtualenv, so that pip install ipython (for example) can be used.

(PS: coucou @pawamoy 👋 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement Improvements for existing features
Projects
None yet
Development

No branches or pull requests

4 participants