Files
customer_zero_test_r36/Makefile
Mandel WebGUI Bot 2a6ca54da8 initial commit
2026-06-04 20:26:15 +02:00

62 lines
2.1 KiB
Makefile

.PHONY: fail-if-no-virtualenv all install loaddata test lint black debug undebug
all: install migrate loaddata collectstatic
fail-if-no-virtualenv:
ifndef VIRTUAL_ENV # check for a virtualenv in development environment
ifndef PYENVPIPELINE_VIRTUALENV # check for jenkins pipeline virtualenv
$(error this makefile needs a virtualenv)
endif
endif
ifndef PIP_INDEX_URL
PIP_INDEX_URL=https://pypi.mandelblog.com/mandel/testing/+simple/
endif
ifndef EXTRAS
EXTRAS="[test]"
endif
install: fail-if-no-virtualenv
PIP_INDEX_URL=${PIP_INDEX_URL} pip install --pre --editable .${EXTRAS} setuptools==80.9.0 wheel --upgrade --upgrade-strategy=eager --use-deprecated=legacy-resolver
python -c 'from pathlib import Path; import sysconfig; p=Path(sysconfig.get_paths()["purelib"])/"straight"/"plugin"/"loaders.py"; t=p.read_text() if p.exists() else ""; n="\nfrom imp import find_module\n"; p.write_text(t.replace(n, "\n")) if p.exists() and n in t else None'
migrate:
manage.py migrate --no-input
loaddata:
-manage.py loaddemodata
collectstatic:
manage.py collectstatic --no-input --verbosity=0
lint: fail-if-no-virtualenv
cat customer_zero_test_r36/ocyan.json |python3 -m json.tool 1>/dev/null
ruff format --check --exclude "migrations" customer_zero_test_r36
ruff check --select I --exclude "migrations" --output-format concise customer_zero_test_r36
python -m compileall -q setup.py customer_zero_test_r36
black:
@echo "No formatter configured in template; add your preferred formatter here."
test: fail-if-no-virtualenv
@coverage run --source='customer_zero_test_r36' `which manage.py` test
@coverage report
@coverage xml
@coverage html
run: fail-if-no-virtualenv lint test migrate collectstatic
manage.py runserver
debug: fail-if-no-virtualenv
PIP_INDEX_URL=${PIP_INDEX_URL} pip install --pre ocyan.plugin.debug
undebug:
PIP_INDEX_URL=${PIP_INDEX_URL} pip uninstall -y ocyan.plugin.debug
live:
@echo "Did you update the version in setup.py? [y/N]" && read ans && [ $$ans = y ]
rm -fr dist
rm -fr build*
version --plugin=wheel --skip-tag
devpi --index=projects/production upload dist/*