|
|
|
@ -29,6 +29,9 @@ BROWSER := python -c "$$BROWSER_PYSCRIPT"
@@ -29,6 +29,9 @@ BROWSER := python -c "$$BROWSER_PYSCRIPT"
|
|
|
|
|
help: |
|
|
|
|
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) |
|
|
|
|
|
|
|
|
|
venvexists: ## helper to check if a virtual environment exists
|
|
|
|
|
@test -x .venv/bin/python || { echo "No virtual environment found, please run 'make devenv'"; exit 1; } |
|
|
|
|
|
|
|
|
|
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
|
|
|
|
|
|
|
|
|
|
clean-build: ## remove build artifacts
|
|
|
|
@ -50,44 +53,36 @@ clean-test: ## remove test and coverage artifacts
@@ -50,44 +53,36 @@ clean-test: ## remove test and coverage artifacts
|
|
|
|
|
rm -f .coverage |
|
|
|
|
rm -fr htmlcov/ |
|
|
|
|
|
|
|
|
|
lint: ## reformat with black and check style with flake8
|
|
|
|
|
isort ordr3 |
|
|
|
|
isort tests |
|
|
|
|
black ordr3 tests |
|
|
|
|
flake8 ordr3 tests |
|
|
|
|
|
|
|
|
|
test: lint ## run tests quickly, stop on first error
|
|
|
|
|
pytest tests -x -l --last-failed --disable-warnings -m "not fun" |
|
|
|
|
|
|
|
|
|
testfun: lint ## run functional tests, stop on first error
|
|
|
|
|
pytest tests -x -l -m "fun" |
|
|
|
|
lint: venvexists ## reformat and check style with ruff
|
|
|
|
|
.venv/bin/ruff format ordr3 tests |
|
|
|
|
.venv/bin/ruff check ordr3 tests |
|
|
|
|
|
|
|
|
|
testall: lint ## run all tests
|
|
|
|
|
pytest tests -l |
|
|
|
|
test: lint ## run tests quickly, stop on first error
|
|
|
|
|
.venv/bin/pytest tests --stepwise --disable-warnings -m "not functional" |
|
|
|
|
|
|
|
|
|
coverage: lint ## functional test suite, check code coverage and open coverage report
|
|
|
|
|
pytest tests --cov=ordr3 -l -m "fun" |
|
|
|
|
coverage html |
|
|
|
|
$(BROWSER) htmlcov/index.html |
|
|
|
|
testfunctional: lint ## run functional tests, stop on first error
|
|
|
|
|
.venv/bin/pytest tests --stepwise -m "functional" |
|
|
|
|
|
|
|
|
|
coverall: lint ## full test suite, check code coverage and open coverage report
|
|
|
|
|
pytest tests --cov=ordr3 -l |
|
|
|
|
coverage html |
|
|
|
|
$(BROWSER) htmlcov/index.html |
|
|
|
|
testall: lint ## run all tests
|
|
|
|
|
.venv/bin/pytest tests |
|
|
|
|
|
|
|
|
|
tox: ## run fully isolated tests with tox
|
|
|
|
|
tox |
|
|
|
|
tox: venvexists ## run fully isolated tests with tox
|
|
|
|
|
.venv/bin/tox |
|
|
|
|
|
|
|
|
|
install: ## install updated project.toml with flint
|
|
|
|
|
flit install --pth-file |
|
|
|
|
install: venvexists ## install updated project.toml
|
|
|
|
|
.venv/bin/pip3 install --upgrade pip wheel |
|
|
|
|
.venv/bin/pip3 install -e ".[dev,docs,test]" |
|
|
|
|
|
|
|
|
|
devenv: ## setup development environment
|
|
|
|
|
prepareenv: ## helper to create virtual environment and install basic packages
|
|
|
|
|
rm -fr .venv/ |
|
|
|
|
python3 -m venv --prompt ordr3 .venv |
|
|
|
|
.venv/bin/pip3 install --upgrade pip |
|
|
|
|
.venv/bin/pip3 install "flit>3.2" |
|
|
|
|
.venv/bin/flit install --pth-file |
|
|
|
|
.venv/bin/pip3 install --upgrade pip wheel |
|
|
|
|
.venv/bin/pip3 install -e ".[dev,test]" |
|
|
|
|
|
|
|
|
|
devenv: prepareenv ## setup development environment including precommit hooks
|
|
|
|
|
.venv/bin/pre-commit install --install-hooks |
|
|
|
|
|
|
|
|
|
repo: devenv ## complete project setup with development environment and git repo
|
|
|
|
|
repo: prepareenv ## complete project setup with development environment and git repo
|
|
|
|
|
git init . |
|
|
|
|
git branch -m main |
|
|
|
|
git add . |
|
|
|
|