forked from linux-automation/usbsdmux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (37 loc) · 1.41 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
PYTHON=python3
PYTHON_ENV_ROOT=envs
PYTHON_PACKAGING_VENV=$(PYTHON_ENV_ROOT)/$(PYTHON)-packaging-env
PYTHON_TESTING_ENV=$(PYTHON_ENV_ROOT)/$(PYTHON)-qa-env
.PHONY: clean
# packaging environment #######################################################
$(PYTHON_PACKAGING_VENV)/.created: REQUIREMENTS.packaging.txt
rm -rf $(PYTHON_PACKAGING_VENV) && \
$(PYTHON) -m venv $(PYTHON_PACKAGING_VENV) && \
. $(PYTHON_PACKAGING_VENV)/bin/activate && \
pip install --upgrade pip && \
pip install -r REQUIREMENTS.packaging.txt
date > $(PYTHON_PACKAGING_VENV)/.created
packaging-env: $(PYTHON_PACKAGING_VENV)/.created
sdist: packaging-env
. $(PYTHON_PACKAGING_VENV)/bin/activate && \
rm -rf dist *.egg-info && \
./setup.py sdist
_release: sdist
. $(PYTHON_PACKAGING_VENV)/bin/activate && \
twine upload dist/*
# helper ######################################################################
clean:
rm -rf $(PYTHON_ENV_ROOT)
envs: env packaging-env
# testing #####################################################################
$(PYTHON_TESTING_ENV)/.created: REQUIREMENTS.qa.txt
rm -rf $(PYTHON_TESTING_ENV) && \
$(PYTHON) -m venv $(PYTHON_TESTING_ENV) && \
. $(PYTHON_TESTING_ENV)/bin/activate && \
pip install pip --upgrade && \
pip install -r ./REQUIREMENTS.qa.txt && \
date > $(PYTHON_TESTING_ENV)/.created
qa: $(PYTHON_TESTING_ENV)/.created
. $(PYTHON_TESTING_ENV)/bin/activate && \
black --check --diff . && \
flake8