forked from square/pyfu-usb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (26 loc) · 931 Bytes
/
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
VENV_DIR := .venv
VENV_PYTHON := $(VENV_DIR)/bin/python
$(VENV_DIR):
@echo "Setting up virtual environment and pre-commit hooks..."
@python -m venv $@
@$(VENV_PYTHON) -m pip install --upgrade --quiet pip -i https://pypi.python.org/simple
@$(VENV_PYTHON) -m pip install --upgrade --quiet --editable ".[dev]" -i https://pypi.python.org/simple
@$(VENV_PYTHON) -m pre_commit install --install-hooks
@echo "Setup complete."
.PHONY: setup
setup: | $(VENV_DIR)
.PHONY: pre_commit
pre_commit: | $(VENV_DIR)
@export PATH=$(VENV_DIR)/bin:$$PATH; $(VENV_PYTHON) -m pre_commit run --all-files
.PHONY: test
test: | $(VENV_DIR)
$(VENV_DIR)/bin/coverage run $(VENV_DIR)/bin/pytest -s --log-cli-level=INFO tests/
.PHONY: coverage
coverage: test
$(VENV_DIR)/bin/coverage report
.PHONY: wheel
wheel: | $(VENV_DIR)
$(VENV_PYTHON) setup.py bdist_wheel
.PHONY: clean
clean:
@rm -rf $(VENV_DIR) *.egg-info/ dist/ build/ .pytest_cache/