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

Detect tox venvs #38

Open
f3flight opened this issue Mar 22, 2023 · 3 comments
Open

Detect tox venvs #38

f3flight opened this issue Mar 22, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@f3flight
Copy link

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

Many projects use tox to create venvs and run tests, etc.
There's a plugin for tox called tox-pdm which allows using pdm to install deps (to leverage pdm.lock, for example, i.e. for reproducible builds)
This is all great but the end user still cannot use pdm directly without either

  • creating yet another venv (.venv by default), which also requires setting up Python correctly (tox may have different Python binary set up)
  • or activating one of venvs in .tox folder (but that doesn't allow managing them via pdm venv command)

It would be great if pdm could see and manage venvs created by tox, or maybe even more generally, and venvs in the subfolders of the current project, and allow using them for commands such as "pdm lock" etc, including use by default.

Describe the solution you'd like

I see a few options:

  • pdm autodetects venvs inside ".tox" folder (or just searches for pyenv.cfg in all folders under project root and one folder down) - they show up in "pdm venv list" and can be used like any other venvs created by pdm
  • pdm option "venv.location" can find tox venvs if pointed to ".tox" - right now it expects certain folder names and ignores others - maybe a new option to disable/change name expectations, like "venv.simple_names = True"
  • new pdm option "venv.tox_working_dir = .tox" which will detect and allow using tox venvs
@f3flight f3flight added the enhancement New feature or request label Mar 22, 2023
@frostming frostming transferred this issue from pdm-project/pdm Mar 22, 2023
@frostming
Copy link
Contributor

This should be done in the plugin and contribution is welcomed

@f3flight
Copy link
Author

Hi @frostming , no problem, could you you point me to some doc or example plugin? I'll have a look

@frostming
Copy link
Contributor

frostming commented Mar 22, 2023

I think pdm-vscode is a simple example to demonstrate how to develop a plugin. And the docs are here: https://pdm.fming.dev/latest/plugin/write/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants