1+ LIBRARY_VERSION =$(shell cat library/setup.py | grep version | awk -F"'" '{print $$2}')
2+ LIBRARY_NAME =$(shell cat library/setup.py | grep name | awk -F"'" '{print $$2}')
3+
14.PHONY : usage install uninstall
25usage :
6+ @echo " Library: ${LIBRARY_NAME} "
7+ @echo " Version: ${LIBRARY_VERSION} \n"
38 @echo " Usage: make <target>, where target is one of:\n"
49 @echo " install: install the library locally from source"
510 @echo " uninstall: uninstall the local library"
11+ @echo " check: peform basic integrity checks on the codebase"
612 @echo " python-readme: generate library/README.rst from README.md"
713 @echo " python-wheels: build python .whl files for distribution"
814 @echo " python-sdist: build python source distribution"
915 @echo " python-clean: clean python build and dist directories"
10- @echo " python-dist: build all python distribution files"
16+ @echo " python-dist: build all python distribution files"
17+ @echo " python-testdeploy: build all and deploy to test PyPi"
18+ @echo " tag: tag the repository with the current version"
1119
1220install :
1321 ./install.sh
1422
1523uninstall :
1624 ./uninstall.sh
1725
26+ check :
27+ @echo " Checking for trailing whitespace"
28+ @! grep -IUrn --color " [[:blank:]]$$ " --exclude-dir=sphinx --exclude-dir=.tox --exclude-dir=.git --exclude=PKG-INFO
29+ # @echo "Checking for DOS line-endings"
30+ # @! grep -IUrn --color "" --exclude-dir=sphinx --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile
31+ @echo " Checking library/CHANGELOG.txt"
32+ @cat library/CHANGELOG.txt | grep ^${LIBRARY_VERSION}
33+ @echo " Checking library/${LIBRARY_NAME} /__init__.py"
34+ @cat library/${LIBRARY_NAME} /__init__.py | grep " ^__version__ = '${LIBRARY_VERSION} '"
35+
36+ tag :
37+ git tag -a " v${LIBRARY_VERSION} " -m " Version ${LIBRARY_VERSION} "
38+
1839python-readme : library/README.rst
1940
2041python-license : library/LICENSE.txt
@@ -40,5 +61,8 @@ python-clean:
4061python-dist : python-clean python-wheels python-sdist
4162 ls library/dist
4263
43- python-deploy : python-dist
64+ python-testdeploy : python-dist
65+ twine upload --repository-url https://test.pypi.org/legacy/ library/dist/*
66+
67+ python-deploy : check python-dist
4468 twine upload library/dist/*
0 commit comments