-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
72 lines (53 loc) · 1.6 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
NOOP=
SPACE=$(NOOP) $(NOOP)
DOCKER_REPO=dedoussis/asynction
PKG_VERSION=$(shell git describe --abbrev=0 --tags)
DOCKER_TAG=$(DOCKER_REPO):$(PKG_VERSION)
all-install: $(wildcard requirements*.txt)
pip install -r $(subst $(SPACE), -r ,$?)
%-install: %.txt
pip install -r $<
clean: clean-pyc clean-build clean-tests clean-mypy
clean-pyc:
find . -name '*.pyc' -exec rm -rf {} +
find . -name '*.pyo' -exec rm -rf {} +
find . -name '*~' -exec rm -rf {} +
clean-build:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
clean-tests:
rm -rf .pytest_cache
rm -rf .coverage* coverage.*
rm -rf .hypothesis
clean-mypy:
rm -rf .mypy_cache
typecheck:
mypy --package asynction --config-file setup.cfg
test-unit:
pytest -vvv --mypy --cov asynction --cov-report xml --cov-report term tests/unit
test-integration:
pytest -vvv --mypy tests/integration
test-e2e: clean
docker-compose -f tests/e2e/docker-compose.yml up --build --abort-on-container-exit --exit-code-from test_runner
format:
black .
isort .
lint:
flake8 asynction tests
black --check --diff .
isort . --check-only
release: dist
twine upload dist/*
dist: clean
PKG_VERSION=$(PKG_VERSION) python setup.py sdist bdist_wheel
ls -l dist
docs/% example/%:
$(MAKE) -C $(@D) $(@F:.%=%)
docker-build:
docker build --build-arg VERSION=$(PKG_VERSION) -t $(DOCKER_TAG) .
docker-push:
docker push $(DOCKER_TAG)
docker tag $(DOCKER_TAG) $(DOCKER_REPO):latest
docker push $(DOCKER_REPO):latest
.PHONY: all-install clean clean-pyc clean-build clean-tests clean-mypy typecheck test-unit test-integration test-e2e format lint release dist docker-build docker-push