Skip to content

Commit

Permalink
Better (but not completely fixed) treatment of venv
Browse files Browse the repository at this point in the history
- get rid of requirements check for recreation

- store .devenv_interpreter because the venv
  python binary resolves to the origin
  python of the wrapper, not the wrapper
  python

In practice, merging this commit will mean that

a) the invocation of pip install -r will
need to take care of any changed requirements.

b) the venv, once created, will never be recreated
unless the Python wrapper changes.  The Python
wrapper doesn't seem to change when you add
Python packages to your packages = list, I'm
not sure what the other circumstances might be.

In reality, this fix sucks because the venv is
not actually based on the wrapper.  The wrapper,
in fact, seems to never get used.  That will
need to be addressed in some other commit, though.
  • Loading branch information
mcdonc committed Dec 18, 2023
1 parent 8cf32ef commit e1b1d28
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/modules/languages/python.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ let
devenv_interpreter_path="$(${pkgs.coreutils}/bin/cat "$VENV_PATH/.devenv_interpreter" 2> /dev/null|| false )"
venv_python="$(${readlink} "$devenv_interpreter_path")"
echo $profile_python
echo $venv_python
if [ -z $venv_python ] || [ $profile_python != $venv_python ]
then
echo "Python interpreter changed, rebuilding Python venv..."
Expand Down

0 comments on commit e1b1d28

Please sign in to comment.