forked from andrew000/FTL-Extract
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 1.51 KB
/
Makefile
File metadata and controls
58 lines (46 loc) · 1.51 KB
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
52
53
54
55
56
57
58
py_code_dir = src/ftl_extract
docs_dir = docs
docs_source_dir = $(docs_dir)/source
reports_dir = reports
tests_dir = tests
ifeq ($(OS),Windows_NT)
mkdir_cmd := $(shell if not exist $(reports_dir) mkdir $(reports_dir))
else
mkdir_cmd := $(shell mkdir -p $(reports_dir))
endif
.PHONY: lint
lint:
echo "Running ruff..."
uv run ruff check --config pyproject.toml --diff $(py_code_dir) $(tests_dir)
echo "Running MyPy..."
uv run mypy --config-file pyproject.toml
.PHONY: format
format:
echo "Running ruff check with --fix..."
uv run ruff check --config pyproject.toml --fix --unsafe-fixes $(py_code_dir) $(tests_dir)
echo "Running ruff..."
uv run ruff format --config pyproject.toml $(py_code_dir) $(tests_dir)
echo "Running isort..."
uv run isort --settings-file pyproject.toml $(py_code_dir) $(tests_dir)
.PHONY: livehtml
livehtml:
uv run sphinx-autobuild "$(docs_source_dir)" "$(docs_dir)/_build/html" $(SPHINXOPTS) $(O)
.PHONY: test
test:
echo "Running tests..."
uv run pytest -vv --cov=$(py_code_dir) --cov-report=html --cov-report=term --cov-config=.coveragerc $(tests_dir)
.PHONY: test-coverage
test-coverage:
echo "Running tests with coverage..."
$(mkdir_cmd)
uv run pytest -vv --cov=$(py_code_dir) --cov-config=.coveragerc --html=$(reports_dir)/tests/index.html tests/
uv run coverage html -d $(reports_dir)/coverage
.PHONY: outdated
outdated:
uv tree --universal --outdated
.PHONY: sync
sync:
uv sync --reinstall-package ftl_extract --extra dev --extra tests
.PHONY: build
build:
uv build --wheel --sdist