jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
9.39k stars 263 forks source link

Alternative backends for python venv #1971

Open Adirelle opened 5 months ago

Adirelle commented 5 months ago

The core python plugin can be set up to automatically create a virtual environment if it does not exist. In its current state, it only uses venv but there are alternative tools, like pipenv, poetry or pdm, to cite a few.

Would it be possible to add an option to the python core plugin to select which backend to use? This could be handled either by hardcoding the list of the backends in the plugin with the right commands to use, or by allowing the user to specify the command to create the virtual environment.

e.g. either

[env]
_.python.venv = { path = ".venv", create = true, backend = "pdm" } 

or

[tools]
pdm = "latest"
[env]
_.python.venv = { path = ".venv", create = true, command = "pdm sync" } 
jdx commented 5 months ago

I like this idea