|
| 1 | +LIBRARY_NAME := $(shell hatch project metadata name 2> /dev/null) |
| 2 | +LIBRARY_VERSION := $(shell hatch version 2> /dev/null) |
| 3 | + |
| 4 | +.PHONY: usage install uninstall check pytest qa build-deps check tag wheel sdist clean dist testdeploy deploy |
| 5 | +usage: |
| 6 | +ifdef LIBRARY_NAME |
| 7 | + @echo "Library: ${LIBRARY_NAME}" |
| 8 | + @echo "Version: ${LIBRARY_VERSION}\n" |
| 9 | +else |
| 10 | + @echo "WARNING: You should 'make dev-deps'\n" |
| 11 | +endif |
| 12 | + @echo "Usage: make <target>, where target is one of:\n" |
| 13 | + @echo "install: install the library locally from source" |
| 14 | + @echo "uninstall: uninstall the local library" |
| 15 | + @echo "dev-deps: install Python dev dependencies" |
| 16 | + @echo "check: perform basic integrity checks on the codebase" |
| 17 | + @echo "qa: run linting and package QA" |
| 18 | + @echo "pytest: run Python test fixtures" |
| 19 | + @echo "clean: clean Python build and dist directories" |
| 20 | + @echo "build: build Python distribution files" |
| 21 | + @echo "testdeploy: build and upload to test PyPi" |
| 22 | + @echo "deploy: build and upload to PyPi" |
| 23 | + @echo "tag: tag the repository with the current version\n" |
| 24 | + |
| 25 | +install: |
| 26 | + ./install.sh --unstable |
| 27 | + |
| 28 | +uninstall: |
| 29 | + ./uninstall.sh |
| 30 | + |
| 31 | +dev-deps: |
| 32 | + python3 -m pip install -r requirements-dev.txt |
| 33 | + sudo apt install dos2unix shellcheck |
| 34 | + |
| 35 | +check: |
| 36 | + @bash check.sh |
| 37 | + |
| 38 | +shellcheck: |
| 39 | + shellcheck *.sh |
| 40 | + |
| 41 | +qa: |
| 42 | + tox -e qa |
| 43 | + |
| 44 | +pytest: |
| 45 | + tox -e py |
| 46 | + |
| 47 | +nopost: |
| 48 | + @bash check.sh --nopost |
| 49 | + |
| 50 | +tag: |
| 51 | + git tag -a "v${LIBRARY_VERSION}" -m "Version ${LIBRARY_VERSION}" |
| 52 | + |
| 53 | +build: check |
| 54 | + @hatch build |
| 55 | + |
| 56 | +clean: |
| 57 | + -rm -r dist |
| 58 | + |
| 59 | +testdeploy: build |
| 60 | + twine upload --repository testpypi dist/* |
| 61 | + |
| 62 | +deploy: nopost build |
| 63 | + twine upload dist/* |
0 commit comments