1- LIBRARY_NAME ="ioexpander"
2- LIBRARY_VERSION = $( shell grep __version__ ${LIBRARY_NAME}/__init__.py | awk -F" = " '{print substr($$2,2,length($$2) -2)}' | awk -F"." '{print $$1"."$$2"."$$3}' )
1+ LIBRARY_NAME := $( shell hatch project metadata name 2> /dev/null)
2+ LIBRARY_VERSION := $( shell hatch version 2> /dev/null )
33
44.PHONY : usage install uninstall check pytest qa build-deps check tag wheel sdist clean dist testdeploy deploy
55usage :
6+ ifdef LIBRARY_NAME
67 @echo "Library: ${LIBRARY_NAME}"
78 @echo "Version: ${LIBRARY_VERSION}\n"
9+ else
10+ @echo "WARNING: You should 'make dev-deps'\n"
11+ endif
812 @echo "Usage: make <target>, where target is one of:\n"
913 @echo "install: install the library locally from source"
1014 @echo "uninstall: uninstall the local library"
11- @echo " build-deps: install essential python build dependencies"
12- @echo " test-deps: install essential python test dependencies"
15+ @echo "dev-deps: install Python dev dependencies"
1316 @echo "check: perform basic integrity checks on the codebase"
1417 @echo "qa: run linting and package QA"
15- @echo " pytest: run python test fixtures"
16- @echo " wheel: build python .whl files for distribution"
17- @echo " sdist: build python source distribution"
18- @echo " clean: clean python build and dist directories"
19- @echo " dist: build all python distribution files"
20- @echo " testdeploy: build all and deploy to test PyPi"
21- @echo " deploy: build all and deploy to PyPi"
22- @echo " tag: tag the repository with the current version"
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"
2324
2425install :
2526 ./install.sh --unstable
2627
2728uninstall :
2829 ./uninstall.sh
2930
30- build-deps :
31- python3 -m pip install build
32-
33- test-deps :
34- python3 -m pip install tox
31+ dev-deps :
32+ python3 -m pip install -r requirements-dev.txt
3533 sudo apt install dos2unix
3634
3735check :
@@ -49,20 +47,14 @@ nopost:
4947tag :
5048 git tag -a " v${LIBRARY_VERSION} " -m " Version ${LIBRARY_VERSION} "
5149
52- wheel : check
53- python3 -m build --wheel
54-
55- sdist : check
56- python3 -m build --sdist
50+ build : check
51+ @hatch build
5752
5853clean :
5954 -rm -r dist
6055
61- dist : clean wheel sdist
62- ls dist
63-
64- testdeploy : dist
56+ testdeploy : build
6557 twine upload --repository-url https://test.pypi.org/legacy/ dist/*
6658
67- deploy : nopost dist
59+ deploy : nopost build
6860 twine upload dist/*
0 commit comments