| 1 |
project := opentracing |
| 2 |
|
| 3 |
pytest := PYTHONDONTWRITEBYTECODE=1 py.test --tb short -rxs \ |
| 4 |
--cov-config .coveragerc --cov $(project) tests |
| 5 |
|
| 6 |
html_report := --cov-report=html |
| 7 |
test_args := --cov-report xml --cov-report term-missing |
| 8 |
|
| 9 |
.PHONY: clean-pyc clean-build docs clean testbed |
| 10 |
.DEFAULT_GOAL : help |
| 11 |
|
| 12 |
help: |
| 13 |
@echo "bootstrap - initialize local environement for development. Requires virtualenv." |
| 14 |
@echo "clean - remove all build, test, coverage and Python artifacts" |
| 15 |
@echo "clean-build - remove build artifacts" |
| 16 |
@echo "clean-pyc - remove Python file artifacts" |
| 17 |
@echo "clean-test - remove test and coverage artifacts" |
| 18 |
@echo "lint - check style with flake8" |
| 19 |
@echo "test - run tests quickly with the default Python" |
| 20 |
@echo "testbed - run testbed scenarios with the default Python" |
| 21 |
@echo "coverage - check code coverage quickly with the default Python" |
| 22 |
@echo "docs - generate Sphinx HTML documentation, including API docs" |
| 23 |
@echo "release - package and upload a release" |
| 24 |
@echo "dist - package" |
| 25 |
@echo "install - install the package to the active Python's site-packages" |
| 26 |
|
| 27 |
check-virtual-env: |
| 28 |
@echo virtual-env: $${VIRTUAL_ENV?"Please run in virtual-env"} |
| 29 |
|
| 30 |
bootstrap: check-virtual-env |
| 31 |
pip install -r requirements.txt |
| 32 |
pip install -r requirements-test.txt |
| 33 |
python setup.py develop |
| 34 |
|
| 35 |
clean: clean-build clean-pyc clean-test |
| 36 |
|
| 37 |
clean-build: |
| 38 |
rm -fr build/ |
| 39 |
rm -fr dist/ |
| 40 |
rm -fr .eggs/ |
| 41 |
find . -name '*.egg-info' -exec rm -fr {} + |
| 42 |
find . -name '*.egg' -exec rm -rf {} + |
| 43 |
|
| 44 |
clean-pyc: |
| 45 |
find . -name '*.pyc' -exec rm -f {} + |
| 46 |
find . -name '*.pyo' -exec rm -f {} + |
| 47 |
find . -name '*~' -exec rm -f {} + |
| 48 |
find . -name '__pycache__' -exec rm -fr {} + |
| 49 |
|
| 50 |
clean-test: |
| 51 |
rm -f .coverage |
| 52 |
rm -f coverage.xml |
| 53 |
rm -fr htmlcov/ |
| 54 |
|
| 55 |
lint: |
| 56 |
flake8 $(project) tests |
| 57 |
|
| 58 |
test: |
| 59 |
$(pytest) $(test_args) |
| 60 |
|
| 61 |
testbed: |
| 62 |
PYTHONDONTWRITEBYTECODE=1 python -m testbed |
| 63 |
|
| 64 |
jenkins: |
| 65 |
pip install -r requirements.txt |
| 66 |
pip install -r requirements-test.txt |
| 67 |
python setup.py develop |
| 68 |
CLAY_CONFIG=config/test.yaml $(pytest) $(test_args) --junit-xml=jenkins.xml |
| 69 |
|
| 70 |
coverage: |
| 71 |
coverage run --source $(project) setup.py test |
| 72 |
coverage report -m |
| 73 |
coverage html |
| 74 |
open htmlcov/index.html |
| 75 |
|
| 76 |
docs: |
| 77 |
pip show -q opentracing || python setup.py develop |
| 78 |
$(MAKE) -C docs clean |
| 79 |
$(MAKE) -C docs html |
| 80 |
|
| 81 |
release: clean |
| 82 |
@echo Please see README |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
dist: clean |
| 87 |
@echo Please see README |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
install: |
| 93 |
pip install -r requirements.txt |
| 94 |
pip install -r requirements-test.txt |
| 95 |
echo skipping pip install -r requirements-doc.txt |
| 96 |
python setup.py install |