Provide an environment variable to automatically create or require a virtual environment #243
brettcannon
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Like how Hatch creates an environment automatically, having a way to signal to the Launcher that an environment should always be used by a project might be helpful.
The way I currently see it in my head is:
PY_CREATE_VIRTUALENV) that when set means the Launcher will create a virtual environment if one isn't found.PY_CREATE_VIRTUALENVis anything but the empty string or1, it's used as the command to pass to the selected Python interpreter to create the virtual environment (not sure if string substitution like{version}when a version is specified/found would be useful).pyproject.tomlis found in the current or parent folders to act as an anchor point for the workspace.I'm not sure if automatic installation into that environment makes sense.
It might also make more sense to not have this built in but instead to have a
py pipsubcommand (see #222 ) which will do the creation as necessary. Insteadpycould have aPY_REQUIRE_VIRTUALENVinstead which will refuse to run if apyproject.tomlis found but no virtual environment (similar to whatPIP_REQUIRE_VIRTUALENVdoes).Beta Was this translation helpful? Give feedback.
All reactions