-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (39 loc) · 1.06 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
sources = sksmithy tests
clean-folders:
rm -rf __pycache__ */__pycache__ */**/__pycache__ \
.pytest_cache */.pytest_cache */**/.pytest_cache \
.ruff_cache */.ruff_cache */**/.ruff_cache \
.mypy_cache */.mypy_cache */**/.mypy_cache \
.screenshot_cache \
site build dist htmlcov .coverage .tox
lint:
ruff version
ruff format $(sources)
ruff check $(sources) --fix
ruff clean
# Requires pytest-xdist (pip install pytest-xdist)
test:
pytest tests -n auto
# Requires pytest-cov (pip install pytest-cov)
test-cov:
pytest tests --cov=sksmithy -n auto
# Requires coverage (pip install coverage)
coverage:
rm -rf .coverage
(rm docs/img/coverage.svg) || (echo "No coverage.svg file found")
coverage run -m pytest
coverage report -m
coverage-badge -o docs/img/coverage.svg
types:
mypy $(sources)
check: lint test-cov types clean-folders
docs-serve:
mkdocs serve
docs-deploy:
mkdocs gh-deploy
pypi-push:
rm -rf dist
hatch build
hatch publish
get-version :
@echo $(shell grep -m 1 version pyproject.toml | tr -s ' ' | tr -d '"' | tr -d "'" | cut -d' ' -f3)