-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (54 loc) · 1.52 KB
/
Copy pathMakefile
File metadata and controls
66 lines (54 loc) · 1.52 KB
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
PYTHON ?= python
PIP ?= pip
VENV_DIR ?=
CONDA_ENV ?=
ifdef VENV_DIR
# Virtual environment activation
ifeq ($(OS),Windows_NT)
ACTIVATE_CMD := . $(VENV_DIR)/Scripts/activate
else
ACTIVATE_CMD := . $(VENV_DIR)/bin/activate
endif
else ifdef CONDA_ENV
CONDA ?= conda
ACTIVATE_CMD := . $$($(CONDA) info --base)/etc/profile.d/conda.sh && $(CONDA) activate $(CONDA_ENV)
else
ACTIVATE_CMD := :
endif
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
rm -rf htmlcov
rm -rf .coverage
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
install-deps:
$(ACTIVATE_CMD) && \
$(PIP) install -r requirements/dev.txt && \
$(PIP) install -r requirements/app.txt
install:
$(ACTIVATE_CMD) && \
$(PIP) install --editable .
pre-commit:
$(ACTIVATE_CMD) && \
pre-commit run --all-files
test: pre-commit
$(ACTIVATE_CMD) && \
$(PYTHON) -m pytest -v --cov=pymortem --cov-report=term-missing --cov-report=xml:coverage.xml && \
coverage-badge -f -o coverage.svg
build: clean
$(ACTIVATE_CMD) && \
$(PIP) install wheel && \
$(PYTHON) setup.py sdist bdist_wheel
check-dist: build
$(ACTIVATE_CMD) && \
$(PIP) install twine && \
$(PYTHON) -m twine check dist/*
publish-test: check-dist
$(ACTIVATE_CMD) && \
$(PYTHON) -m twine upload --verbose --repository-url https://test.pypi.org/legacy/ dist/*
publish: check-dist
$(ACTIVATE_CMD) && \
$(PYTHON) -m twine upload dist/*
.PHONY: clean install-deps install pre-commit test build lint format check-dist publish-test publish