-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
46 lines (37 loc) · 1.29 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
SHELL := $(shell which bash)
PROJECT := cbox
ACTIVATE_VENV = source activate ${PROJECT}
CONDA_REQS := "conda-requirements.txt"
TEST_REQS := "test-requirements.txt"
PROJECT_VERSION := 0.4.0
setup-env:
-conda create -y -n ${PROJECT} ipython
${ACTIVATE_VENV} && \
conda install -y --file ${CONDA_REQS}
test-setup: setup-env
${ACTIVATE_VENV} && pip install -r ${TEST_REQS}
test: clean validate
${ACTIVATE_VENV} && \
export PYTHONPATH=./$(PROJECT):$$PYTHONPATH && \
py.test --cov $(PROJECT)/ --cov-report=term --cov-report=html --junitxml=report.xml -s -v tests/test_*.py
clean:
find ./tests/ -name '*.py[co]' -exec rm {} \;
rm -rf build dist $(PROJECT).egg-info
rm -f nosetests.xml
rm -f .coverage
rm -rf .cache/
rm -rf htmlcov/
validate:
${ACTIVATE_VENV} && flake8 setup.py $(PROJECT)/ tests/ examples/
build-dist: clean
${ACTIVATE_VENV} && \
export PYTHONPATH=./$(PROJECT):$$PYTHONPATH && \
python setup.py sdist bdist_wheel
gpg --detach-sign -a dist/cbox-*.tar.gz
gpg --detach-sign -a dist/cbox-*.whl
upload-pypi: clean test build-dist
twine upload dist/cbox-${PROJECT_VERSION}.tar.gz dist/cbox-${PROJECT_VERSION}.tar.gz.asc
twine upload dist/cbox-${PROJECT_VERSION}-py3-none-any.whl dist/cbox-${PROJECT_VERSION}-py3-none-any.whl.asc
all:
$(error please pick a target)
.PHONY: clean validate