-
Notifications
You must be signed in to change notification settings - Fork 424
/
Copy pathMakefile
51 lines (41 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
# Makefile for running tests
# Python executable and pytest command
PYTHON = python3
PYTEST = pytest
# Default target
.DEFAULT_GOAL := help
# Help target
help:
@echo "NSETools Makefile commands:"
@echo "-------------------------"
@echo "make dev : Install all development dependencies"
@echo "make test : Run tests with coverage report in terminal"
@echo "make cov : Generate coverage XML report"
@echo "make clean : Remove Python cache files"
@echo "make pristine : Remove all installed packages from virtualenv"
@echo "make build : Build the package"
@echo "-------------------------"
# Install packages for development
dev:
pip install --upgrade pip
pip install ipython pytest pytest-cov build setuptools wheel twine
pip install -e .
# Target to run the tests
test:
$(PYTEST) --cov=nsetools --cov-report=term -v
cov:
$(PYTEST) --cov=nsetools --cov-report=xml -v
# Clean up pycache files
clean:
find . -type d -name "__pycache__" -exec rm -r {} +
find . -type d -name ".pytest_cache" -exec rm -r {} +
rm -rf dist
# Remove all installed packages in the venv (pristine)
pristine:
pip list --disable-pip-version-check | awk 'NR>2 {print $$1}' | grep -v "^pip$$" | xargs -r pip uninstall -y
build:
pip install --upgrade pip
pip install twine build setuptools wheel
python -m build
publish:
@echo "twine upload --username __token__ --password <API-TOKEN> dist/*"