1- .PHONY : clean clean-test clean-pyc clean-build docs help
1+ .PHONY : clean clean-test clean-pyc clean-build clean-venv docs help install dist release test test-all
22.DEFAULT_GOAL := help
33define BROWSER_PYSCRIPT
44import os, webbrowser, sys
@@ -28,16 +28,17 @@ BROWSER := python -c "$$BROWSER_PYSCRIPT"
2828help :
2929 @python -c " $$ PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST )
3030
31- clean : clean-build clean-pyc clean-test # # remove all build, test, coverage and Python artifacts
31+ clean : clean-build clean-pyc clean-test clean-venv # # remove all build, test, coverage, Python artifacts and virtualenv
3232
3333
3434clean-build : # # remove build artifacts
3535 rm -fr build/
3636 rm -fr dist/
3737 rm -fr trust_pypi_example/rust/target
3838 rm -fr .eggs/
39+ rm -f * .so * .dylib * .dll
3940 find . -name ' *.egg-info' -exec rm -fr {} +
40- find . -name ' *.egg' -exec rm -f {} +
41+ find . -name ' *.egg' -exec rm -fr {} +
4142
4243clean-pyc : # # remove Python file artifacts
4344 find . -name ' *.pyc' -exec rm -f {} +
@@ -50,52 +51,53 @@ clean-test: ## remove test and coverage artifacts
5051 rm -f .coverage
5152 rm -fr htmlcov/
5253
53- lint : # # check style with flake8
54- flake8 trust_pypi_example tests
55-
56- test : # # run tests quickly with the default Python
57- py.test
58-
54+ clean-venv :
55+ rm -rf venv
5956
57+ lint : venv # # check style with flake8
58+ venv/bin/flake8 trust_pypi_example tests
6059
61- cargo-test : # # build rust lib for local testing. DO NOT USE ON TRAVIS. Cross needs to build for the target
62- cargo test --manifest-path trust_pypi_example/rust/Cargo.toml --release
60+ test : venv # # This will use py.test because of pytest-runner
61+ venv/bin/python setup.py check
62+ venv/bin/python setup.py test
6363
64- cargo-build : # # build rust lib for local testing. DO NOT USE ON TRAVIS. Cross needs to build for the target
65- cargo build --manifest-path trust_pypi_example/rust/Cargo.toml --release
64+ venv : # # set up a virtualenv that will by python and install dependencies
65+ python -m virtualenv venv || python -m venv venv
66+ venv/bin/pip install -r requirements_dev.txt
6667
67- cross-build : clean
68- cross build --manifest-path trust_pypi_example/rust/Cargo.toml --target $$ TARGET --release
6968
70- test-all : # # run tests on every Python version with tox
71- tox
69+ test-all : venv # # run tests on every Python version with tox
70+ venv/bin/ tox
7271
73- coverage : # # check code coverage quickly with the default Python
74- coverage run --source trust_pypi_example -m pytest
72+ coverage : venv # # check code coverage quickly with the default Python
73+ venv/bin/ coverage run --source trust_pypi_example -m pytest
7574
76- coverage report -m
77- coverage html
75+ venv/bin/ coverage report -m
76+ venv/bin/ coverage html
7877 $(BROWSER ) htmlcov/index.html
7978
80- docs : # # generate Sphinx HTML documentation, including API docs
79+ docs : venv # # generate Sphinx HTML documentation, including API docs
8180 rm -f docs/trust_pypi_example.rst
8281 rm -f docs/modules.rst
83- sphinx-apidoc -o docs/ trust_pypi_example
82+ venv/bin/ sphinx-apidoc -o docs/ trust_pypi_example
8483 $(MAKE ) -C docs clean
8584 $(MAKE ) -C docs html
8685 $(BROWSER ) docs/_build/html/index.html
8786
88- servedocs : docs # # compile the docs watching for changes
89- watchmedo shell-command -p ' *.rst' -c ' $(MAKE) -C docs html' -R -D .
87+ servedocs : venv docs # # compile the docs watching for changes
88+ venv/bin/ watchmedo shell-command -p ' *.rst' -c ' $(MAKE) -C docs html' -R -D .
9089
91- release : clean # # package and upload a release
92- python setup.py sdist upload
93- python setup.py bdist_wheel upload
90+ release : venv clean # # package and upload a release
91+ venv/bin/ python setup.py sdist upload
92+ venv/bin/ python setup.py bdist_wheel upload
9493
95- dist : clean # # builds source and wheel package
96- python setup.py sdist
97- python setup.py bdist_wheel
94+ dist : venv clean # # builds source and wheel package
95+ venv/bin/ python setup.py sdist
96+ venv/bin/ python setup.py bdist_wheel
9897 ls -l dist
9998
100- install : clean # # install the package to the active Python's site-packages
101- python setup.py install
99+ install : venv clean # # install the package to the active Python's site-packages
100+ venv/bin/python setup.py install
101+
102+
103+ local-test : clean test coverage dist install
0 commit comments