-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
53 lines (38 loc) · 1.55 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
.PHONY: test help fmt install-editable lint install
VENV?=.venv
PIP=$(VENV)/bin/pip
PY=$(VENV)/bin/python
help: ## list targets with short description
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9._-]+:.*?## / {printf "\033[1m\033[36m%-38s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
test: $(VENV)/init ## run pytest
. $(VENV)/bin/activate && pytest -rA -vvs --log-level INFO
cov: $(VENV)/init ## run pytest
. $(VENV)/bin/activate && coverage run --module pytest && coverage report
lint: $(VENV)/init ## run flake8 to check the code
. $(VENV)/bin/activate && flake8 src/ tests/ && mypy -m pytest_archon
install-editable: $(VENV)/init
. $(VENV)/bin/activate && $(PIP) install -e '.[dev]'
install: $(VENV)/init
. $(VENV)/bin/activate && $(PIP) install '.[dev]'
fmt: $(VENV)/init ## run black to format the code
. $(VENV)/bin/activate && black src/ tests/
fmt-check: $(VENV)/init ## run black to format the code
. $(VENV)/bin/activate && black --check src/ tests/
clean:
rm -rf dist/ build/ *.egg-info
build: clean $(VENV)/init ## build the pkg
$(PY) -m build
publish-test: build
$(PY) -m twine upload --repository testpypi dist/*
publish: build
. $(VENV)/bin/activate && check-manifest
. $(VENV)/bin/activate && check-wheel-contents
. $(VENV)/bin/activate && pyroma .
$(PY) -m twine check dist/*
$(PY) -m twine upload dist/*
test-install:
$(PIP) install --index-url https://test.pypi.org/simple/ --no-deps pytest-archon-jwb
$(VENV)/init: pyproject.toml Makefile ## init the virtual environment
python -m venv $(VENV)
$(PIP) install --upgrade build twine
touch $@