diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..46cba4c --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,8 @@ +global-exclude *.log *.pyc *.swp +recursive-exclude _scraps * +recursive-exclude docs * +recursive-exclude sandbox * +recursive-exclude tests * +include DESCRIPTION.txt +include VERSION.txt +include LICENSE.txt diff --git a/Makefile b/Makefile index 9f5d2ff..ebe95b4 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: docs help tests # The path to source code to be counted with cloc. -CLOC_PATH := scripttease +PACKAGE_NAME := scripttease # The directory where test coverage is generated. COVERAGE_PATH := docs/build/html/coverage @@ -17,6 +17,18 @@ help: @cat Makefile | grep "^#>" | sed 's/\#\> //g'; @echo "" +#> dist - Create a distribution of the package. +dist: + cp DESCRIPTION.txt $(PACKAGE_NAME)/; + cp LICENSE.txt $(PACKAGE_NAME)/; + cp VERSION.txt $(PACKAGE_NAME)/; + @rm -Rf build/*; + @rm -Rf dist/*; + @rm -Rf *.egg-info; + python setup.py sdist bdist_wheel; + twine check dist/*; + rm $(PACKAGE_NAME)/*.txt; + #> docs - Generate documentation. docs: lines cd docs && make dirhtml; @@ -25,18 +37,23 @@ docs: lines open docs/build/coverage/python.txt; open docs/build/html/index.html; -#> clean - Remove pyc files. +#> clean - Remove pyc files and documentation builds. clean: find . -name '*.pyc' -delete; + (cd docs && make clean); # lines - Generate lines of code report. lines: rm -f docs/source/_data/cloc.csv; echo "files,language,blank,comment,code" > docs/source/_data/cloc.csv; - cloc $(CLOC_PATH) --csv --quiet --unix --report-file=tmp.csv + cloc $(PACKAGE_NAME) --csv --quiet --unix --report-file=tmp.csv tail -n +2 tmp.csv >> docs/source/_data/cloc.csv; rm tmp.csv; +#> publish - Publish to PYPI. +publish: + twine upload --repository-url https://upload.pypi.org/legacy/ dist/*; + #> tests - Run unit tests and generate coverage report. tests: coverage run --source=. -m pytest;