1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
version := `python -c "from imgviz.__init__ import __version__; print(__version__)"`
default:
@just --summary --unsorted
publish: clean
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi
@git push origin main
@python -c 'import github2pypi' &>/dev/null || (echo "\"pip install github2pypi\"?"; exit 1)
@python -c 'import build' &>/dev/null || (echo "\"pip install build\"?"; exit 1)
@which twine &>/dev/null || (echo "\"pip install twine\"?"; exit 1)
@git tag "v{{version}}" && git push origin "v{{version}}"
python -m build --sdist --wheel .
twine upload dist/*
clean:
@find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
@rm -rf src/*.egg-info/ build/ dist/ .tox/
format:
isort .
black .
lint:
flake8 .
black --check .
isort --check .
test:
@python -m pytest -sxv tests/
|