-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
157 lines (136 loc) 路 4.39 KB
/
Copy pathpyproject.toml
File metadata and controls
157 lines (136 loc) 路 4.39 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
[build-system]
build-backend = "hatchling.build"
requires = [
"hatchling>=1.18",
"hatch-vcs>=0.4",
]
[project]
name = "ajt-lancet"
dynamic = ["version"]
description = "OCR snipping tool for reading manga."
readme = "README.md"
requires-python = ">=3.13"
license = { file = "LICENSE" }
keywords = ["AJATT", "OCR"]
authors = [
{ name = "Ajatt-Tools and contributors" },
]
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"beartype>=0.22.9",
"PyQt6>=6.8.0",
"pillow>=12.1.0",
"pynput>=1.8.1", # "pynput @ git+https://github.com/moses-palmer/pynput.git@fixup/listener-thread-handle",
"fire>=0.7.1",
"jaconv>=0.5.0",
"loguru>=0.7.0",
"numpy>=2.4.0",
"torch>=2.11", # https://pypi.org/project/torch/
"transformers>=5.6.2,<5.14", # needed by manga_ocr; pin up to 5.13 to avoid unexpected breakage.
"opencv-python-headless>=4.13", # needed to 'import cv2', used by comic text detector
"torchvision", # needed by comic text detector
"pyclipper", # needed by comic text detector
"shapely", # needed by comic text detector
"requests", # needed to download comic_text_detector model 'comictextdetector.pt'
"fugashi>=1.5.0", # needed by bert_japanese/tokenization_bert_japanese.py
"unidic_lite>=1.0.8", # needed by bert_japanese/tokenization_bert_japanese.py
"zala>=26.4.26.0",
# Or use a local folder:
#"zala @ git+file:///home/ren/Documents/Projects/Zala",
]
[project.optional-dependencies]
# To use: hatch shell dev (or pip install .[dev])
dev = [
"opencv-python>=4.5.0", # Full version with GUI support for comic_text_detector training/debug scripts
]
[tool.hatch.metadata]
allow-direct-references = true
[project.urls]
Documentation = "https://github.com/Ajatt-Tools/lancet#readme"
Issues = "https://github.com/Ajatt-Tools/lancet/issues"
Source = "https://github.com/Ajatt-Tools/lancet"
[project.scripts]
lancet = "lancet.__main__:main"
[tool.hatch.version]
source = "vcs"
path = "lancet/__about__.py"
[tool.hatch.build.hooks.vcs]
version-file = "lancet/__about__.py"
[tool.hatch.envs.types]
extra-dependencies = [
"mypy>=1.0.0",
]
[tool.hatch.envs.types.scripts]
check = "mypy --install-types --non-interactive {args:lancet tests}"
[tool.hatch.build.targets.wheel]
packages = ["lancet", "comic_text_detector"]
[tool.coverage.run]
source_pkgs = ["lancet", "tests"]
branch = true
parallel = true
omit = [
"lancet/__about__.py",
]
[tool.coverage.paths]
lancet = ["lancet", "*/lancet/lancet"]
tests = ["tests", "*/lancet/tests"]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.black]
line-length = 120
target-version = ['py313']
extend-exclude = "comic_text_detector"
[tool.isort]
profile = "black"
[tool.hatch.envs.hatch-test]
# https://hatch.pypa.io/latest/config/internal/testing/
# https://hatch.pypa.io/latest/tutorials/testing/overview/
dependencies = [
"mypy>=1.0.0",
"pytest",
"pytest-asyncio",
"pytest-xdist",
]
parallel = true
randomize = true
[[tool.hatch.envs.hatch-test.matrix]]
# https://hatch.pypa.io/latest/tutorials/testing/overview/#testing-projects
# Pin the test environment to the same Python minor version as CI and release builds.
python = ["3.14", ]
[tool.hatch.envs.dev]
features = ["dev"]
description = "Development environment with full opencv-python (includes GUI support)"
[tool.hatch.envs.hatch-static-analysis]
# https://hatch.pypa.io/latest/how-to/static-analysis/behavior/
dependencies = ["black", "flake8", "isort", "pyupgrade"]
[tool.hatch.envs.hatch-static-analysis.scripts]
format-check = [
"black --check --diff lancet tests",
"isort --check-only --diff lancet tests",
]
format-fix = [
"bash \"$(git rev-parse --show-toplevel)/scripts/format.sh\"", # run as: hatch fmt -f
]
lint-check = "flake8 --max-line-length 120 --extend-ignore E203 lancet tests"
lint-fix = "lint-check"
[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "session"
filterwarnings = [
"ignore:There is no current event loop",
]
# Build-only dependencies for PyInstaller binary creation
[dependency-groups]
binary = [
"pyinstaller",
"pip_system_certs", # For SSL verification in PyInstaller binaries
]