-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (40 loc) · 1.37 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
DOCKER_RUN ?= docker run \
--name mm-client-builder \
--workdir /apps \
--mount type=bind,src=${PWD},dst=/apps \
--user "$(shell id -u):$(shell id -g)" \
--rm -it
lint:
${DOCKER_RUN} registry.ubicast.net/docker/flake8:latest make lint_local
lint_local:
flake8 .
deadcode:
${DOCKER_RUN} registry.ubicast.net/docker/vulture:latest make deadcode_local
deadcode_local:
vulture --exclude .eggs --min-confidence 90 .
test:
${DOCKER_RUN} registry.ubicast.net/docker/pytest:latest make test_local
test_local:
pytest tests/ -vv --color=yes --log-level=DEBUG --cov=mm_client ${PYTEST_ARGS}
publish:
make clean
@mkdir -p .local
${DOCKER_RUN} \
-e "TWINE_USERNAME=${TWINE_USERNAME}" \
-e "TWINE_PASSWORD=${TWINE_PASSWORD}" \
-v ${PWD}/.local:/.local \
registry.ubicast.net/docker/pytest:latest make publish_local
publish_local:
test -z "${TWINE_USERNAME}" \
&& $echo 'You have to define a value for "TWINE_USERNAME" in your environment' \
&& exit 1 || true
test -z "${TWINE_PASSWORD}" \
&& echo 'You have to define a value for "TWINE_PASSWORD" in your environment' \
&& exit 1 || true
pip install build twine
python -m build
python -m twine upload --repository pypi -u "${TWINE_USERNAME}" -p "${TWINE_PASSWORD}" dist/*
clean:
rm -rf .coverage .pytest_cache .local .eggs build dist *.egg-info
find . -type f -name *.pyc -delete
find . -type d -name __pycache__ -delete