From a3922092d4160489266d9c649c3a411436cb1d02 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Sun, 26 Nov 2023 16:17:09 -0800 Subject: [PATCH] removed venv reference in makefiles since using nix --- Makefile | 20 ++++++++++---------- shell.nix | 15 ++++++++------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index a55ad8706..518d2d3d5 100644 --- a/Makefile +++ b/Makefile @@ -15,24 +15,24 @@ py4web/assets/py4web.app.%.zip: apps/% egrep "\.(py|html|css|js|png|jpg|gif|json|yaml|md|txt|mm|ico)$$" | \ zip -@ $(addprefix ../../, $@) docs: - .venv/bin/pip install -U -r docs/requirements.txt + pip install -U -r docs/requirements.txt cd docs; ./updateDocs.sh html test: - .venv/bin/pip install -U -r test-requirements.txt - .venv/bin/python -m pytest --cov=py4web --cov-report html:cov.html -v tests/ + pip install -U -r test-requirements.txt + python -m pytest --cov=py4web --cov-report html:cov.html -v tests/ setup: - .venv/bin/python py4web.py setup apps - .venv/bin/python py4web.py set_password + python py4web.py setup apps + python py4web.py set_password run: - .venv/bin/python py4web.py run -p password.txt apps + python py4web.py run -p password.txt apps upgrade-utils: find apps -name "utils.js" -exec cp apps/_dashboard/static/js/utils.js {} \; upgrade-vue: curl -L https://unpkg.com/vue/dist/vue.min.js > apps/_dashboard/static/js/vue.min.js find apps -name "vue.min.js" -exec cp apps/_dashboard/static/js/vue.min.js {} \; build: clean assets - .venv/bin/pip install --upgrade build - .venv/bin/pip install --upgrade twine - .venv/bin/python -m build + pip install --upgrade build + pip install --upgrade twine + python -m build deploy: build - .venv/bin/python -m twine upload dist/* + python -m twine upload dist/* diff --git a/shell.nix b/shell.nix index b65e0d394..0c5b35d53 100644 --- a/shell.nix +++ b/shell.nix @@ -10,7 +10,7 @@ let }; # This is the Python version that will be used. - myPython = pkgs.python310; + myPython = pkgs.python311; pythonWithPkgs = myPython.withPackages (pythonPkgs: with pythonPkgs; [ pip @@ -28,6 +28,7 @@ let # my python and packages pythonWithPkgs pkgs.memcached + pkgs.redis # other packages needed for compiling python libs pkgs.readline @@ -38,17 +39,17 @@ let shellHook = '' # Allow the use of wheels. SOURCE_DATE_EPOCH=$(date +%s) - + VENV_PATH=/home/$USER/.nix-venvs$(pwd)/venv${myPython.version} # Augment the dynamic linker path export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${lib-path}" # Setup the virtual environment if it doesn't already exist. - if test ! -d .venv; then - python -m venv .venv + if test ! -d $VENV_PATH; then + python -m venv $VENV_PATH fi - .venv/bin/pip install -U -r requirements.txt - source .venv/bin/activate - export PYTHONPATH=`pwd`.venv/${myPython.sitePackages}/:$PYTHONPATH + $VENV_PATH/bin/pip install -U -r requirements.txt + source $VENV_PATH/bin/activate + export PYTHONPATH=$VENV_PATH/${myPython.sitePackages}/:$PYTHONPATH ''; }; in