-
Notifications
You must be signed in to change notification settings - Fork 55
/
Makefile
59 lines (42 loc) · 1.39 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
# use virtualenv or virtualenv-wrapper location based on availability
ifdef WORKON_HOME
VIRTUALENV = $(WORKON_HOME)/mollie-api-python
endif
ifndef VIRTUALENV
VIRTUALENV = $(PWD)/env
endif
PYTHON_VERSION = 3.8
PYTHON = $(VIRTUALENV)/bin/python
.PHONY: virtualenv
virtualenv: $(VIRTUALENV) # alias
$(VIRTUALENV):
$(shell which python$(PYTHON_VERSION)) -m venv $(VIRTUALENV)
$(PYTHON) -m pip install --upgrade pip setuptools wheel
.PHONY: develop
develop: mollie_api_python.egg-info # alias
mollie_api_python.egg-info: virtualenv
$(PYTHON) -m pip install -r test_requirements.txt
$(PYTHON) -m pip install -e .
.PHONY: test
test: develop
$(PYTHON) -m flake8
$(PYTHON) -m mypy --config mypy.ini mollie/
$(PYTHON) -m pytest
# Jinja, https://data.safetycli.com/v/70612/97c
$(PYTHON) -m safety check --ignore 70612
dist/mollie_api_python-*-py3-none-any.whl: virtualenv
$(PYTHON) -m pip install --upgrade build
$(PYTHON) -m build --wheel
dist/mollie-api-python-*.tar.gz: virtualenv
$(PYTHON) -m pip install --upgrade build
$(PYTHON) -m build --sdist
.PHONY: build
build: dist/mollie_api_python-*-py3-none-any.whl dist/mollie-api-python-*.tar.gz
.PHONY: clean
clean:
rm -f -r build/ dist/ htmlcov/ .eggs/ mollie_api_python.egg-info .pytest_cache .mypy_cache
find . -type f -name '*.pyc' -delete
find . -type d -name __pycache__ -delete
.PHONY: realclean
realclean: clean
rm -f -r $(VIRTUALENV)