-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (51 loc) · 1.54 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
include .githooks/Makefile
.DEFAULT_GOAL := usage
usage:
@echo 'Use the following make commands to interact with the project in a quick way'
@echo '---------------------------------------------------------------------------'
@echo ''
@echo '[1] init: Setup pipenv'
@echo '[2] usage: Show the available options of this Makefile'
@echo '[3] test: Run test suite'
@echo '[4] run: Run the myip command from the bin/ directory'
export PIPENV_VENV_IN_PROJECT := 1
.venv/base: Pipfile
pipenv install --dev
touch .venv/base
.venv/deploy: .venv/base
pipenv run pip install --upgrade twine
touch .venv/deploy
tmp/:
mkdir tmp
init := .venv/base $(setup-webhooks) tmp/
mypy: $(init)
pipenv run mypy src
flake8: $(init)
pipenv run flake8
pytest: $(init)
pipenv run pytest
test-all-versions:
@for py_version in 3.6 3.7; do \
echo 'TESTING Python version: '$$py_version ; \
echo '===========================' ; \
docker run -v "$(PWD):/workdir" -w "/workdir" \
-v "/workdir/.venv" -v "/workdir/tmp/" \
python:$$py_version /bin/bash -c "pip install pipenv --upgrade && make test" ; \
done
build: $(init)
rm -rf build dist .eggs whatsmyip.egg-info
pipenv run python setup.py sdist bdist_wheel
test: mypy flake8 pytest build
run: $(init)
pipenv run ./bin/myip
release-testpypi: build .venv/deploy
pipenv run twine upload --repository-url "https://test.pypi.org/legacy/" dist/*
.PHONY: \
usage \
mypy \
flake8 \
test \
test-all-versions \
run \
build \
release-testpypi