add a Makefile

This commit is contained in:
Andreas Zweili 2020-10-11 14:01:39 +02:00
parent cbf18ea608
commit a1093c32a7
1 changed files with 46 additions and 0 deletions

46
Makefile Normal file
View File

@ -0,0 +1,46 @@
SHELL=/bin/bash
.PHONY: dist/restic_qt
dist/restic-qt: venv
( \
. venv/bin/activate; \
pyinstaller -F url2markdown; \
)
venv: venv/bin/activate
venv/bin/activate: requirements.txt
test -d venv || python3 -m venv venv
. venv/bin/activate; pip3 install wheel; pip3 install -Ur requirements.txt
touch venv/bin/activate
init:
rm -rf venv
python3 -m venv venv
. venv/bin/activate
( \
pip3 install -r requirements.txt; \
pip3 install -e .; \
TEST_REPO=/tmp/test-resticqt; \
export RESTIC_REPOSITORY=$$TEST_REPO; \
export RESTIC_PASSWORD='foo'; \
rm -rf $$TEST_REPO; \
mkdir $$TEST_REPO; \
restic init; \
)
test:
@. venv/bin/activate
@( \
cd tests/; \
pytest; \
)
clean: distclean
rm -rf build/
rm -rf venv/
find -iname "*.pyc" -delete
distclean:
rm -rf dist/