-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (49 loc) · 1.26 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
.PHONY: default
default:
.PHONY: install-deps
install-deps:
pipenv install --dev
.PHONY: update-deps
update-deps:
pipenv update --dev
.PHONY: check
check: lint test
.PHONY: lint
lint:
pipenv run black --check .
pipenv run isort --check .
pipenv run pyflakes .
.PHONY: test
test: run-unit-tests run-integration-tests
.PHONY: run-unit-tests
run-unit-tests:
pipenv run pytest -vv --cov --cov-report term-missing tests/unit
.PHONY: run-integration-tests
run-integration-tests:
pipenv run pytest -vv --capture=no tests/integration
.PHONY: get-pipenv
get-pipenv:
curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
.PHONY: upload-to-pypi
upload-to-pypi: dist
ifndef PYPI_API_TOKEN
$(error PYPI_API_TOKEN is not defined)
endif
@pipenv run twine upload \
--username __token__ \
--password $(PYPI_API_TOKEN) \
$</*
dist.tar: dist
rm --force $@
tar --create --file $@ $<
.PHONY: dist
dist:
pipenv run python setup.py bdist_wheel
.PHONY: bump-version
bump-version:
ifndef V
$(error V is not defined)
endif
sed -i 's/__version__ = "[0-9].[0-9].[0-9]"/__version__ = "$(V)"/g' enapter/__init__.py
grep --files-with-matches --recursive 'enapter==[0-9].[0-9].[0-9]' examples \
| xargs -n 1 sed -i 's/enapter==[0-9].[0-9].[0-9]/enapter==$(V)/g'