-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (46 loc) · 1.9 KB
/
Makefile
File metadata and controls
65 lines (46 loc) · 1.9 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
.PHONY: docs build typecheck test develop develop-debug rust-test rust-fmt rust-fmt-check bench rust-data build-iso639 build-territories build-addresses build-names
check: build typecheck test
# Release build by default: the ICU4X trie-heavy transliteration path is
# ~100x slower in debug and benchmark numbers are meaningless there. Use
# `make develop-debug` for fast Rust-iteration cycles where speed of the
# compiled code doesn't matter.
develop:
maturin develop --manifest-path rust/Cargo.toml --release
develop-debug:
maturin develop --manifest-path rust/Cargo.toml
rust-test:
cargo test --manifest-path rust/Cargo.toml
# Format Rust sources in place. CI runs `cargo fmt --check` so drift
# fails the build; this target is the one-command local fix. Run it
# before committing Rust changes.
rust-fmt:
cargo fmt --manifest-path rust/Cargo.toml
rust-fmt-check:
cargo fmt --manifest-path rust/Cargo.toml --check
bench:
python benchmarks/bench_transliteration.py
typecheck:
mypy --strict rigour
test:
pytest --cov rigour --cov-report term-missing --cov-report html tests
fetch-scripts:
curl -o resources/text/scripts.txt https://www.unicode.org/Public/UCD/latest/ucd/Scripts.txt
fetch: fetch-scripts
build-iso639:
python genscripts/generate_langs.py
build-territories:
python genscripts/generate_territories.py
build-addresses:
python genscripts/generate_addresses.py
build-names:
python genscripts/generate_names.py
build-text:
python genscripts/generate_text.py
build: build-iso639 build-territories build-addresses build-names build-text
# Regenerate Rust-consumed data artifacts (under rust/data and
# rust/src/generated). Generators are dual-emit — running them produces the
# Rust artifacts alongside the existing Python ones, which keeps the two
# from drifting. CI calls this + git-diffs to catch stale checkins.
rust-data: build-names build-text build-territories
docs:
mkdocs build -c -d site