-
Notifications
You must be signed in to change notification settings - Fork 617
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
Feature request: include patchlevel in python venv #1239
Comments
Option 2 would be fine to me. No idea about the vscode issue, since I don't use it. I'm wondering why you're not using Poetry's own venv management support over direnv's |
We just want to use poetry as a package manager. We use a mix of poetry and pipenv, and it's nice for all venvs to be managed in the same way. |
@dne what are your thoughts on option 1? It seems nice to avoid changing the api of the direnv stdlib if possible. |
I'm not sure how it'd avoid having to start over with a new empty venv, for no reason, when Python is updated to a new fix release (same major/minor version)? |
You're right, it would create a brand new, empty venv each time the patch version is changed. That doesn't seem like a big deal to me, but maybe that's because we tightly control the exact version of python we're using on a project by project basis (using asdf). For us, the upgrades are very intentional and we want everyone on the same version of python. It sounds like maybe you're relying upon some floating (system level?) version of python? Then I can see how that would be annoying (system update results in effectively emptying out all your project venvs). I thought the intent of #1033 was something about vscode (as mentioned in #1035), but now I'm just realizing you haven't said anything about IDEs or vscode in this conversation, haha. |
Is your feature request related to a problem? Please describe.
At my company, we use poetry and we specify a full python patch version in our pyproject.toml. Example:
This means that whenever we upgrade Python versions, people need new venvs to get created, or else poetry will start to fail with errors like:
However, direnv currently only creates new venvs when the patch version of python changes, so people have to manually delete the old venv and run
direnv reload
whenever this happens. direnv's behavior here is intentional (see #1033 and #1035), and apparently has something to do with IDEs like vscode.Describe the solution you'd like
I'd like direnv to create a new venv whenever the python version changes at all (effectively, the behavior before the change in #1033). To avoid regressing on the vscode experience, I'd propose adding a little more functionality as well:
python-3.11
->python-3.11.7
).layout_python
to pick the level of granularity, or add a newlayout_python_full_version
with this behavior.I'd be happy to send in a PR implementing 1) or 2) if you're open to it!
(Also @dne and @offbyone as they both requested the original change.)
The text was updated successfully, but these errors were encountered: