Python packages installed via config.packages
leak into Python VIRTUAL_ENV
#1717
Labels
bug
Something isn't working
config.packages
leak into Python VIRTUAL_ENV
#1717
Describe the bug
I don't know the reason why we add
devenv.profile
toPYTHONPATH
, but we do:devenv/src/modules/languages/python.nix
Line 487 in 6c987a8
I don't know if it is a bug, edge-case or by-design.
I came to this rabbit hole as one environment we are using devenv for specifies a dependency in
config.packages
and also inpyproject.toml
and I was surprised that the former overrides the latter.Is there a reason for setting
PYTHONPATH
? It may make sense in cases wherevenv.enable = false
, so it can be used as an ad-hoc environment, but I think it should not be set in thevenv.enable = true
case. Maybe a.pth
file could be injected to the virtual env, pointing to the profile, so it would behave as a fallback for packages not already present in the virtual environment.To reproduce
Version
devenv 1.3.1 (x86_64-linux)
P.S.
PYTHONPATH
is also adjusted by the individual package's setup-hooks, so it may not be a devenv-only issue. It may be a good idea ifdevenv
would be able to clearPYTHONPATH
altogether whenvenv.enable
is set 🤔. This could wreak havoc iflanguages.python.package
is different from the defaultpkgs.python
package, as those could contain extensions compiled for a different version.The text was updated successfully, but these errors were encountered: