Skip to content

Commit

Permalink
removed venv reference in makefiles since using nix
Browse files Browse the repository at this point in the history
  • Loading branch information
mdipierro committed Nov 27, 2023
1 parent 60f4b4d commit a392209
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
15 changes: 8 additions & 7 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,6 +28,7 @@ let
# my python and packages
pythonWithPkgs
pkgs.memcached
pkgs.redis

# other packages needed for compiling python libs
pkgs.readline
Expand All @@ -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
Expand Down

0 comments on commit a392209

Please sign in to comment.