From 2425648aac3d117dc8c7d248c2c721b3e18c5293 Mon Sep 17 00:00:00 2001 From: fruchti Date: Sun, 18 Dec 2022 12:35:44 +0100 Subject: [PATCH] Use virtual environment instead of nix packages --- .envrc | 6 ++- .gitignore | 1 + requirements.txt | 99 ++++++++++++++++++++++++++++++++++++++++++++++++ shell.nix | 33 +++++++++------- 4 files changed, 124 insertions(+), 15 deletions(-) create mode 100644 requirements.txt diff --git a/.envrc b/.envrc index 65326bb..5e03e1f 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,5 @@ -use nix \ No newline at end of file +use nix + +VIRTUAL_ENV="$PWD/venv" +export VIRTUAL_ENV +PATH_add "$VIRTUAL_ENV/bin" \ No newline at end of file diff --git a/.gitignore b/.gitignore index fbf9b1f..f156aa7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ __pycache__ .ipynb_checkpoints +venv plots/* !.gitkeep \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c1787fd --- /dev/null +++ b/requirements.txt @@ -0,0 +1,99 @@ +anyio==3.6.2 +argon2-cffi==21.3.0 +argon2-cffi-bindings==21.2.0 +arrow==1.2.3 +asttokens==2.2.1 +attrs==22.1.0 +autopep8==2.0.1 +backcall==0.2.0 +beautifulsoup4==4.11.1 +bleach==5.0.1 +cffi==1.15.1 +comm==0.1.2 +contourpy==1.0.6 +cycler==0.11.0 +debugpy==1.6.4 +decorator==5.1.1 +defusedxml==0.7.1 +entrypoints==0.4 +executing==1.2.0 +fastjsonschema==2.16.2 +fonttools==4.38.0 +fqdn==1.5.1 +idna==3.4 +ipykernel==6.19.2 +ipython==8.7.0 +ipython-genutils==0.2.0 +ipywidgets==8.0.3 +isoduration==20.11.0 +jedi==0.18.2 +Jinja2==3.1.2 +jsonpointer==2.3 +jsonschema==4.17.3 +jupyter==1.0.0 +jupyter-console==6.4.4 +jupyter-events==0.5.0 +jupyter_client==7.4.8 +jupyter_core==5.1.0 +jupyter_server==2.0.1 +jupyter_server_terminals==0.4.2 +jupyterlab-pygments==0.2.2 +jupyterlab-widgets==3.0.4 +kiwisolver==1.4.4 +MarkupSafe==2.1.1 +matplotlib==3.6.2 +matplotlib-inline==0.1.6 +mistune==2.0.4 +nbclassic==0.4.8 +nbclient==0.7.2 +nbconvert==7.2.6 +nbformat==5.7.0 +nest-asyncio==1.5.6 +noise==1.2.2 +notebook==6.5.2 +notebook_shim==0.2.2 +numpy==1.23.5 +opencv-python==4.6.0.66 +packaging==22.0 +pandocfilters==1.5.0 +parso==0.8.3 +pexpect==4.8.0 +pickleshare==0.7.5 +Pillow==9.3.0 +platformdirs==2.6.0 +prometheus-client==0.15.0 +prompt-toolkit==3.0.36 +psutil==5.9.4 +ptyprocess==0.7.0 +pure-eval==0.2.2 +pycairo==1.23.0 +pycodestyle==2.10.0 +pycparser==2.21 +Pygments==2.13.0 +pyparsing==3.0.9 +pyrsistent==0.19.2 +python-dateutil==2.8.2 +python-json-logger==2.0.4 +PyYAML==6.0 +pyzmq==24.0.1 +qtconsole==5.4.0 +QtPy==2.3.0 +rfc3339-validator==0.1.4 +rfc3986-validator==0.1.1 +scipy==1.9.3 +Send2Trash==1.8.0 +six==1.16.0 +sniffio==1.3.0 +soupsieve==2.3.2.post1 +stack-data==0.6.2 +terminado==0.17.1 +tinycss2==1.2.1 +tomli==2.0.1 +tornado==6.2 +traitlets==5.7.1 +uri-template==1.2.0 +wcwidth==0.2.5 +webcolors==1.12 +webencodings==0.5.1 +websocket-client==1.4.2 +widgetsnbextension==4.0.4 diff --git a/shell.nix b/shell.nix index e8d9bce..0e1b6ad 100644 --- a/shell.nix +++ b/shell.nix @@ -1,15 +1,20 @@ { pkgs ? import {} }: -let - pythonWithPackages = pkgs.python3.withPackages (p: with p; [ - pycairo - numpy - jupyter - ipykernel - matplotlib - scipy - opencv4 - noise - autopep8 - ]); -in -pythonWithPackages.env \ No newline at end of file + +pkgs.mkShell { + name = "plotter-env"; + buildInputs = with pkgs; [ + python310 + python310Packages.venvShellHook + autoPatchelfHook + ]; + propagatedBuildInputs = with pkgs; [ + stdenv.cc.cc.lib + ]; + + venvDir = "./venv"; + postVenvCreation = '' + pip install -U pip setuptools wheel + pip install -r requirements.txt + autoPatchelf ./venv + ''; +}