You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When one or more of the pre-commit.hooks are enabled while languages.python.enable = true; and languages.python.version is set to something different than the default version of python in nixpkgs the resulting shell will have a $PYTHONPATH with site-packages from the specific version created in the venv, and site-packages from the default version of python plus additional packages from other python libraries used by pre-commit.hooks.
The resulting shell can have multiple libraries conflicting with each other for me this manifests as cffi library: Exception: Version mismatch: this is the 'cffi' package version 1.17.1, located in '/nix/store/bw9h2axgbrd7fs9zbz00dx5a9404xqqn-python3.12-cffi-1.17.1/lib/python3.12/site-packages/cffi/api.py'. When we import the top-level '_cffi_backend' extension module, we get version 1.15.1, located in '<redactect>/.venv/lib/python3.11/site-packages/_cffi_backend.cpython-311-x86_64-linux-gnu.so'. The two versions should be equal; check your installation.
I expect with the pre-commit hook enabled that $PYTHONPATH would be the same as without it enabled and whatever dependencies are needed to run the hook would be isolated from the devshell.
Version
Paste the output of $ devenv version here or tell us if you're using flakes.
$ devenv version
devenv 1.3.1 (x86_64-linux)
The text was updated successfully, but these errors were encountered:
Describe the bug
When one or more of the
pre-commit.hooks
are enabled whilelanguages.python.enable = true;
andlanguages.python.version
is set to something different than the default version of python innixpkgs
the resulting shell will have a$PYTHONPATH
with site-packages from the specific version created in the venv, and site-packages from the default version of python plus additional packages from other python libraries used bypre-commit.hooks
.The resulting shell can have multiple libraries conflicting with each other for me this manifests as cffi library:
Exception: Version mismatch: this is the 'cffi' package version 1.17.1, located in '/nix/store/bw9h2axgbrd7fs9zbz00dx5a9404xqqn-python3.12-cffi-1.17.1/lib/python3.12/site-packages/cffi/api.py'. When we import the top-level '_cffi_backend' extension module, we get version 1.15.1, located in '<redactect>/.venv/lib/python3.11/site-packages/_cffi_backend.cpython-311-x86_64-linux-gnu.so'. The two versions should be equal; check your installation.
To reproduce
Please provide an Short, Self Contained, Correct (Compilable), Example by creating a gist using
devenv.nix
,devenv.yaml
, and optionallydevenv.lock
.Make sure to include full logs and what you expected to happen.
devenv.nix
devenv.yaml
Note that it doesn't have to be a python based hook, any will cause the issue from my testing.
devenv.nix
I expect with the pre-commit hook enabled that
$PYTHONPATH
would be the same as without it enabled and whatever dependencies are needed to run the hook would be isolated from the devshell.Version
Paste the output of
$ devenv version
here or tell us if you're using flakes.The text was updated successfully, but these errors were encountered: