forked from AI-Riksarkivet/htrflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
140 lines (122 loc) · 3.48 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
[project]
name = "htrflow"
version = "0.2.1"
description = "htrflow is developed at Riksarkivet's AI-lab as an open-source package to simplify HTR"
readme = "README.md"
license = {file = "LICENSE"}
authors = [{email = "[email protected]"}]
keywords = ["htr", "htrflow", "ocr"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
requires-python = ">=3.10,<3.13"
dependencies = [
"jinja2 >= 3.1.3",
"numpy",
"opencv-python >=4.6.0",
"tqdm >=4.66.2,<5",
"xmlschema >=3.0.2,<4",
"typer>=0.12.0",
"rich >=13.7.1",
"jiwer >=3.0.4",
"pandas",
"pagexml-tools >=0.5.0",
"transformers[torch] >=4.44.1",
"huggingface-hub[cli] >=0.24.6",
"ultralytics >=8.0.225",
"pydantic>=2.9.2",
]
[project.urls]
Documentation = "https://ai-riksarkivet.github.io/htrflow"
Repository = "https://github.com/AI-Riksarkivet/htrflow"
[project.scripts]
htrflow = "htrflow.cli:app"
[tool.uv]
dev-dependencies = [
"mypy >=1.8.0",
"pre-commit >=3.6.2",
"pytest >=8.0.1",
"pytest-cov >=4.1.0",
"pytest-github-actions-annotate-failures >=0.2.0",
"python-dotenv >=1.0.1",
"ruff >=0.6.2",
"uv>=0.4.12",
"lorem",
"tox-uv>=1.13.0",
]
[project.optional-dependencies]
docs = [
"mike >=2.1.1",
"mkdocs-jupyter >=0.24.6",
"mkdocs-material >=9.5.10",
"mkdocstrings[python] >=0.20",
"mkdocs-table-reader-plugin >=2.2.2",
"mkdocs-git-revision-date-localized-plugin >=1.2.6",
"termynal >=0.12.1",
"mkdocs-swagger-ui-tag >=0.6.10"
]
teklia = [
"pylaia==1.1.2; python_version == '3.10'"
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.pytest.ini_options]
addopts = "-v --cov htrflow --cov-report term-missing --no-cov-on-fail"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"gpu: marks tests as gpu (deselect with '-m \"not gpu\"')",
"openmmlab: marks tests as openmmlab (deselect with '-m \"not openmmlab\"')",
"teklia: marks tests as teklia (deselect with '-m \"not teklia\"')"
]
pythonpath = "src"
testpaths = ["tests/unit", "tests/integration"]
[tool.coverage.run]
source = ["src/htrflow"]
[tool.coverage.report]
exclude_lines = [
"if __name__ == .__main__.:",
"pragma: no cover",
"def __repr__",
"if self\\.debug",
"raise AssertionError",
"raise NotImplementedError",
]
# Formatting and linting (tool.ruff)
[tool.ruff]
line-length = 119
target-version = "py310"
exclude = ["*.ipynb"]
[tool.ruff.lint]
ignore = ["C901", "E741", "W605"]
select = ["C", "E", "F", "I", "W"]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401", "F403", "F811"]
# Disable line length limit in cli.py. This allows Typer CLI arguments
# and their documentation to use one line each, increasing readability.
"cli.py" = ["E501"]
[tool.ruff.lint.isort]
known-first-party = ["htrflow"]
lines-after-imports = 2
# Typing (tool.mypy)
[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
exclude = ['venv', '.venv', "tests", "docs"]
ignore_missing_imports = true
mypy_path = "src"
no_implicit_optional = true
no_implicit_reexport = true
show_error_codes = true
strict_equality = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true