-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
113 lines (86 loc) · 2.8 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
.PHONY: help clean clean-pyc clean-build list test test-dbg test-cov test-all coverage release sdist install deps develop upload path minor major
project-name = neuro_pypes
version-var := "__version__ = "
version-string := $(shell grep $(version-var) $(project-name)/version.py)
version := $(subst __version__ = ,,$(version-string))
help:
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "lint - check style with flake8"
@echo "test - run tests quickly with the default Python"
@echo "test-cov - run tests with the default Python and report coverage"
@echo "test-dbg - run tests and debug with pdb"
@echo "testall - run tests on every Python version with tox"
@echo "coverage - check code coverage quickly with the default Python"
@echo "docs - generate Sphinx HTML documentation"
@echo "install - install"
@echo "develop - install in development mode"
@echo "deps - install dependencies"
@echo "dev_deps - install dependencies for development"
@echo "release - package a release in wheel and tarball and upload it to PyPI"
@echo "patch - bumpversion patch"
@echo "minor - bumpversion minor"
@echo "major - bumpversion major"
install:
pipenv install
pipenv run python setup.py install
develop:
pipenv install --dev
pipenv run python setup.py develop
pipenv run pre-commit install
condaenv:
conda env create -f=./environment.yml
clean: clean-build clean-pyc clean-pyenv
clean-build:
rm -fr build/
rm -fr dist/
rm -fr *.egg-info
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
find . -name '*.log*' -delete
clean-pyenv:
pipenv --rm
lint:
pipenv run flake8 $(project-name)/
test: test-src test_docs
test-src:
pipenv run py.test -v neuro_pypes/
test-cov:
pipenv run py.test --cov-report term-missing --cov=$(project-name)
test-dbg:
pipenv run py.test --pdb
test-all:
pipenv run tox
coverage:
pipenv run coverage run --source $(project-name) setup.py test
pipenv run coverage report -m
test_docs:
pipenv run pytest -s docs/
docs:
rm -f docs/$(project-name).rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ $(project-name)
$(MAKE) -C docs clean
$(MAKE) -C docs html
open docs/_build/html/index.html
tag: clean
@echo "Creating git tag v$(version)"
git tag v$(version)
git push --tags
patch:
pipenv run bumpversion patch
minor:
pipenv run bumpversion minor
major:
pipenv run bumpversion major
build:
pipenv run python setup.py sdist --formats gztar bdist_wheel
upload:
pipenv run python setup.py sdist upload
release: clean-build clean-pyc build upload tag
docker:
if [ ! -d neuro_ansible ]; then git clone [email protected]:Neurita/neuro_ansible.git; fi
cd neuro_ansible; pipenv run packer build packer/neuro_docker-run.json