Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
117 lines (87 loc) · 3.09 KB
/
Copy pathMakefile
File metadata and controls
117 lines (87 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
SHELL := /usr/bin/env bash
build:
uv build
docs:
@echo "Building MkDocs site..."
uv run mkdocs build --strict
docsServe:
@echo "Serving MkDocs site at http://127.0.0.1:8000 ..."
uv run mkdocs serve -a 127.0.0.1:8000
fix:
uv run ruff check --fix src/
format:
uv run ruff format src/ tests/ scripts/ evaluation/
freezeDependencies:
# Update uv.lock from pyproject.toml without installing packages
uv lock
install:
uv sync --no-default-groups --frozen
installOptionals:
# uv sync --no-default-groups --extra openai --extra stanza --extra ollama --extra mistral --frozen
uv sync --all-extras
installDev:
uv sync --frozen
installPyPI:
uv pip install --pre cltk
installPyPITest:
pip install --index-url https://test.pypi.org/simple/ --no-deps cltk
lint:
uv run ruff check --fix src/
modelComparison:
@echo "Running model comparison script..."
uv run evaluation/compare_all_models.py
notebook:
uv run jupyter notebook notebooks
preCommitUpdate:
uv run pre-commit autoupdate && uv run pre-commit install --install-hooks && uv run pre-commit autoupdate
preCommitRun:
uv run pre-commit run --all-files
publishPyPI:
make build
uv publish
publishPyPITest:
make build
uv publish --publish-url https://test.pypi.org/legacy/ --check-url https://test.pypi.org/simple
publishPyPITestConfig:
uv publish --dry-run --publish-url https://test.pypi.org/legacy/ --check-url https://test.pypi.org/simple
simpleCheck:
@echo "Running simple end-to-end check of NLP("grc").analyize()..."
uv run scripts/example_greek_readers_guide.py
testSnapshot:
uv run pytest -k test_public_api_snapshot --snapshot-update
test: typing
@echo "Running tests with coverage..."
uv run pytest --cov=cltk --cov-report=term-missing
testIntegration:
@echo "Running integration tests..."
uv run pytest -m integration
docstrCoverage:
@echo "Measure and report on documentation coverage in Python modules..."
uv run interrogate -c pyproject.toml -vv src
typing:
uv run mypy --check-untyped-defs --html-report .mypy_cache src/cltk/ evaluation/ scripts/
testBuilt:
@set -euo pipefail; \
tmpdir=$$(mktemp -d); \
trap 'rm -rf "$$tmpdir"' EXIT; \
echo "Building wheel into $$tmpdir/dist ..."; \
uv build --out-dir $$tmpdir/dist; \
echo "Creating temp venv at $$tmpdir/venv ..."; \
python3 -m venv $$tmpdir/venv; \
$$tmpdir/venv/bin/python -m pip install --upgrade pip >/dev/null; \
echo "Exporting dev requirements ..."; \
uv export --group development --frozen --no-emit-project --no-editable > $$tmpdir/dev-requirements.txt; \
echo "Installing development dependencies ..."; \
$$tmpdir/venv/bin/python -m pip install -r $$tmpdir/dev-requirements.txt; \
whl_path=$$(ls $$tmpdir/dist/cltk-*.whl); \
echo "Installing built wheel with all extras ..."; \
$$tmpdir/venv/bin/python -m pip install "$$whl_path[stanza,openai,mistral,ollama]"; \
echo "Running pytest against installed wheel ..."; \
$$tmpdir/venv/bin/python -m pytest tests
uninstall:
uv pip uninstall -y cltk
updateDependencies:
uv lock --upgrade
updateSnapshot:
uv run pytest -k test_public_api_snapshot --snapshot-update
.PHONY: build docs docsServe test typing testBuilt