-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (68 loc) · 3.09 KB
/
Copy pathMakefile
File metadata and controls
95 lines (68 loc) · 3.09 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
.PHONY: install lint format test test-cov gold-corpus gold-bench gold-bench-id-extract gold-table build-id-extract build-core build-cli build-api clean-id-extract clean-core clean-cli clean-api publish-core publish-cli publish-api publish-core-test publish-cli-test publish-api-test
install:
uv pip install -e ./packages/id-extract --system
uv pip install -e ./packages/pdf-anonymizer-core --system
uv pip install -e ./packages/pdf-anonymizer-cli --system
uv pip install -e ./packages/pdf-anonymizer-api --system
uv pip install -e .[dev] --system
lint:
uv run ruff check .
format:
uv run ruff format .
uv run ruff check . --select I --fix
test:
uv run pytest
test-cov:
uv run pytest --cov=id_extract --cov=pdf_anonymizer_core --cov=pdf_anonymizer_cli --cov=pdf_anonymizer_api --cov-report=term-missing --cov-report=xml:coverage.xml --cov-fail-under=$(COV_FAIL_UNDER)
# Floor set after the first measured run on this branch (77%). Do not invent 90%.
COV_FAIL_UNDER ?= 70
gold-corpus:
uv run python scripts/download_gold_corpus.py
gold-bench:
uv run python scripts/run_gold_benchmark.py --write-baseline
gold-bench-id-extract:
uv run python scripts/run_id_extract_benchmark.py --write-baseline
gold-table:
uv run python scripts/eval_public_table.py --output tests/eval/baselines/public_eval_table.md
docs-serve:
uv run mkdocs serve
docs-build:
uv run mkdocs build
# -----------------------------
# Packaging & Publishing
# -----------------------------
ID_EXTRACT_PKG_DIR=packages/id-extract
CORE_PKG_DIR=packages/pdf-anonymizer-core
CLI_PKG_DIR=packages/pdf-anonymizer-cli
API_PKG_DIR=packages/pdf-anonymizer-api
clean-id-extract:
rm -rf $(ID_EXTRACT_PKG_DIR)/dist $(ID_EXTRACT_PKG_DIR)/build $(ID_EXTRACT_PKG_DIR)/*.egg-info
clean-core:
rm -rf $(CORE_PKG_DIR)/dist $(CORE_PKG_DIR)/build $(CORE_PKG_DIR)/*.egg-info
clean-cli:
rm -rf $(CLI_PKG_DIR)/dist $(CLI_PKG_DIR)/build $(CLI_PKG_DIR)/*.egg-info
clean-api:
rm -rf $(API_PKG_DIR)/dist $(API_PKG_DIR)/build $(API_PKG_DIR)/*.egg-info
# Build distributions (sdist+wheel)
build-id-extract: clean-id-extract
cd $(ID_EXTRACT_PKG_DIR) && uvx --from build pyproject-build .
build-core: clean-core
cd $(CORE_PKG_DIR) && uvx --from build pyproject-build .
build-cli: clean-cli
cd $(CLI_PKG_DIR) && uvx --from build pyproject-build .
build-api: clean-api
cd $(API_PKG_DIR) && uvx --from build pyproject-build .
# Publish to TestPyPI (set TWINE_USERNAME=__token__ and TWINE_PASSWORD to the TestPyPI token)
publish-core-test: build-core
cd $(CORE_PKG_DIR) && uvx --from twine twine upload --repository testpypi dist/*
publish-cli-test: build-cli
cd $(CLI_PKG_DIR) && uvx --from twine twine upload --repository testpypi dist/*
publish-api-test: build-api
cd $(API_PKG_DIR) && uvx --from twine twine upload --repository testpypi dist/*
# Publish to PyPI (set TWINE_USERNAME=__token__ and TWINE_PASSWORD to the PyPI token)
publish-core: build-core
cd $(CORE_PKG_DIR) && uvx --from twine twine upload dist/*
publish-cli: build-cli
cd $(CLI_PKG_DIR) && uvx --from twine twine upload dist/*
publish-api: build-api
cd $(API_PKG_DIR) && uvx --from twine twine upload dist/*