|
|
@ -1,7 +1,7 @@ |
|
|
|
.PHONY: docs help tests |
|
|
|
.PHONY: docs help tests |
|
|
|
|
|
|
|
|
|
|
|
# The path to source code to be counted with cloc.
|
|
|
|
# The path to source code to be counted with cloc.
|
|
|
|
CLOC_PATH := scripttease
|
|
|
|
PACKAGE_NAME := scripttease
|
|
|
|
|
|
|
|
|
|
|
|
# The directory where test coverage is generated.
|
|
|
|
# The directory where test coverage is generated.
|
|
|
|
COVERAGE_PATH := docs/build/html/coverage
|
|
|
|
COVERAGE_PATH := docs/build/html/coverage
|
|
|
@ -17,6 +17,18 @@ help: |
|
|
|
@cat Makefile | grep "^#>" | sed 's/\#\> //g';
|
|
|
|
@cat Makefile | grep "^#>" | sed 's/\#\> //g';
|
|
|
|
@echo ""
|
|
|
|
@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 - Generate documentation.
|
|
|
|
docs: lines |
|
|
|
docs: lines |
|
|
|
cd docs && make dirhtml;
|
|
|
|
cd docs && make dirhtml;
|
|
|
@ -25,18 +37,23 @@ docs: lines |
|
|
|
open docs/build/coverage/python.txt;
|
|
|
|
open docs/build/coverage/python.txt;
|
|
|
|
open docs/build/html/index.html;
|
|
|
|
open docs/build/html/index.html;
|
|
|
|
|
|
|
|
|
|
|
|
#> clean - Remove pyc files.
|
|
|
|
#> clean - Remove pyc files and documentation builds.
|
|
|
|
clean: |
|
|
|
clean: |
|
|
|
find . -name '*.pyc' -delete;
|
|
|
|
find . -name '*.pyc' -delete;
|
|
|
|
|
|
|
|
(cd docs && make clean);
|
|
|
|
|
|
|
|
|
|
|
|
# lines - Generate lines of code report.
|
|
|
|
# lines - Generate lines of code report.
|
|
|
|
lines: |
|
|
|
lines: |
|
|
|
rm -f docs/source/_data/cloc.csv;
|
|
|
|
rm -f docs/source/_data/cloc.csv;
|
|
|
|
echo "files,language,blank,comment,code" > 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;
|
|
|
|
tail -n +2 tmp.csv >> docs/source/_data/cloc.csv;
|
|
|
|
rm tmp.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 - Run unit tests and generate coverage report.
|
|
|
|
tests: |
|
|
|
tests: |
|
|
|
coverage run --source=. -m pytest;
|
|
|
|
coverage run --source=. -m pytest;
|
|
|
|