-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
101 lines (91 loc) · 2.1 KB
/
pyproject.toml
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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "alexi"
dynamic = ["version"]
description = "\"ALexi, EXtracteur d'Information adélois\""
readme = "README.md"
license = "MIT"
authors = [
{ name = "David Huggins-Daines", email = "[email protected]" },
]
dependencies = [
"beautifulsoup4",
"joblib",
"lxml",
"pdfplumber",
"scikit-learn",
"sklearn-crfsuite",
"lunr[languages]",
"unidecode",
"natsort",
]
[project.optional-dependencies]
dev = [
"black",
"isort",
"flake8",
"flake8-bugbear",
"mypy",
"coverage",
"pytest",
"pytest-cov",
]
yolo = [
"huggingface-hub",
"ultralytics",
]
api = [
"fastapi[standard]",
]
[project.scripts]
alexi = "alexi.cli:main"
[tool.hatch.version]
path = "alexi/__init__.py"
[tool.hatch.build.targets.sdist]
include = [
"/alexi",
]
[tool.pytest.ini_options]
testpaths = ["test"]
addopts = "--cov=alexi --cov-report html"
[tool.hatch.envs.default]
features = [ "dev", "api", "yolo" ]
[tool.hatch.envs.default.env-vars]
# Avoid downloading gigabytes of CUDA junk
PIP_EXTRA_INDEX_URL = "https://download.pytorch.org/whl/cpu"
UV_EXTRA_INDEX_URL = "https://download.pytorch.org/whl/cpu"
[tool.hatch.envs.gpu.env-vars]
# Disable PyTorch CPU respository
PIP_EXTRA_INDEX_URL = ""
UV_EXTRA_INDEX_URL = ""
[tool.hatch.envs.default.scripts]
test = [
"pytest", "coverage html"
]
lint = [
"black --check alexi",
"isort --profile black --check-only alexi test",
"flake8 --color=never alexi test",
"mypy --non-interactive --install-types alexi",
]
format = [
"black alexi test",
"isort alexi test",
]
train = [
"""python scripts/train_crf.py \\
--features text+layout+structure --labels bonly \\
--outfile alexi/models/crf.joblib.gz \\
data/*.csv data/patches/*.csv""",
"""python scripts/train_crf.py \\
--features text+layout --labels bonly \\
--outfile alexi/models/crf.vl.joblib.gz \\
data/*.csv data/patches/*.csv""",
"""python scripts/train_crf_seq.py \\
--outfile alexi/models/crfseq.joblib.gz \\
data/*.csv data/patches/*.csv""",
]
[tool.isort]
profile = "black"