-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
47 lines (36 loc) · 1.26 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
.PHONY: docs tests
PYTHON_FILES = cassis tests
clean:
rm -Rf build dkpro_cassis.egg-info dist
# Dependencies
pin:
rm requirements.txt requirements-dev.txt requirements-doc.txt
pip-compile -o requirements.txt pyproject.toml
pip-compile --extra dev -o requirements-dev.txt pyproject.toml
pip-compile --extra doc -o requirements-doc.txt pyproject.toml
init:
pip install --upgrade pip pip-tools
dependencies: init
pip-sync requirements.txt requirements-dev.txt
# Tests
unit-tests:
python -m pytest --cov=cassis --cov-branch --cov-fail-under=90 tests
tests: unit-tests integ-tests
coverage:
python -m pytest --cov=cassis --cov-branch --cov-fail-under=90 --cov-report=xml:coverage.xml -m "not performance" tests
# Static analysis/linting
format:
ruff format $(PYTHON_FILES)
lint:
# stop the build if there are Python syntax errors or undefined names
ruff check --select=E9,F63,F7,F82 --output-format=full $(PYTHON_FILES)
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
ruff check --exit-zero $(PYTHON_FILES)
# Docs
docs:
pip-sync requirements-doc.txt
cd docs && make html
# Building and publishing
build: unit-tests lint
python -m build