-
Notifications
You must be signed in to change notification settings - Fork 3
/
justfile
68 lines (55 loc) · 1.94 KB
/
justfile
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
# Copied from https://github.com/ibis-project/ibis/blob/master/justfile
# list justfile recipes
default:
just --list
# initialize development environment (but don't activate it)
install:
uv sync --all-extras
# format code
fmt:
uv run ruff check --fix mismo docs
uv run ruff format mismo docs
# lint code
lint:
uv run ruff check mismo docs
uv run ruff format --check mismo docs
# run tests
test *FILES:
uv run pytest {{FILES}}
# include --dev-addr localhost:8001 to avoid conflicts with other mkdocs instances
# serve docs for live editing
docs:
PYDEVD_DISABLE_FILE_VALIDATION=1 uv run mkdocs serve --dev-addr localhost:8001
# build docs to the site/ directory
docs-build:
PYDEVD_DISABLE_FILE_VALIDATION=1 uv run mkdocs build
# publish docs
docs-publish:
uv run mkdocs gh-deploy --force
# run the timing benchmark suite
# just bench -k test_benchmark_us_census_geocode[100]
bench *args:
uv run pytest --benchmark-only --benchmark-enable --benchmark-autosave {{args}}
benchmark *args:
uv run bench {{args}}
# run timing benchmarks and compare with a previous run
benchcmp number *args:
just bench --benchmark-compare {{ number }} {{ args }}
# update dependencies
update:
uv lock --update
#install libpostal to the system, a dependency for the pypostal python package
install-libpostal datadir="/tmp/postal":
#!/usr/bin/env bash
if [ "$(uname)" = "Linux" ]; then sudo apt-get install curl autoconf automake libtool pkg-config; fi
if [ "$(uname)" = "Darwin" ]; then brew install curl autoconf automake libtool pkg-config; fi
git clone https://github.com/openvenues/libpostal
cd libpostal
./bootstrap.sh
if [ "$(uname)" = "Linux" ]; then ./configure --datadir={{datadir}}; fi
if [ "$(uname)" = "Darwin" ]; then ./configure --datadir={{datadir}} --disable-sse2; fi
make -j4
sudo make install
if [ "$(uname)" = "Linux" ]; then sudo ldconfig; fi
cd ..
rm -rf libpostal