-
Notifications
You must be signed in to change notification settings - Fork 88
/
pyproject.toml
319 lines (289 loc) · 7.58 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "normcap"
version = "0.4.1"
description = "OCR-powered screen-capture tool to capture information instead of images."
keywords = ["screenshot", "ocr", "capture", "clipboard"]
license = "GPLv3"
authors = ["dynobo <dynobo@mailbox.org>"]
readme = "README.md"
homepage = "https://dynobo.github.io/normcap/"
repository = "https://github.com/dynobo/normcap"
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Utilities",
"Topic :: Multimedia :: Graphics :: Capture :: Screen Capture",
"Intended Audience :: End Users/Desktop",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
]
include = [
"README.md",
"CHANGELOG",
"LICENSE",
"normcap/**/*.icns",
"normcap/**/*.ico",
"normcap/**/*.png",
"normcap/**/*.svg",
]
[tool.poetry.urls]
"FAQs" = "https://dynobo.github.io/normcap/#faqs"
"Issues" = "https://github.com/dynobo/normcap/issues"
[tool.poetry.scripts]
normcap = "normcap.app:main"
[tool.poetry.dependencies]
python = ">=3.9,<3.12"
PySide6-Essentials = "6.4.2"
jeepney = "^0.8.0"
[tool.poetry.group.dev.dependencies]
black = ">=23.1.0"
briefcase = "0.3.14"
coverage = { extras = ["toml"], version = "^6.4.2" }
coveralls = ">=3.3.1"
Levenshtein = ">=0.20.1"
mdformat-gfm = ">=0.3.5"
mypy = ">=0.991"
pre-commit = ">=3.0.2"
pydeps = ">=1.11.0"
pytest = ">=7.2.1"
pytest-cov = ">=4.0.0"
pytest-qt = ">=4.2.0"
pytest-xvfb = "^2.0.0"
rope = ">=1.7.0"
ruff = ">=0.0.239"
tbump = ">=6.9.0"
toml = ">=0.10.2"
types-toml = ">=0.10.8.1"
typing-extensions = "^4.4.0"
pip-audit = "^2.4.14"
[tool.poetry.group.analysis]
optional = true
[tool.poetry.group.analysis.dependencies]
radon = ">=5.1.0"
viztracer = ">=0.15.3"
vulture = "^2.4"
[tool.black]
line-length = 88
include = '''
(
^/tests/.*py
| ^/normcap/.*py
)
'''
exclude = '''
(
__pycache__
)
'''
[tool.ruff]
target-version = "py39"
line-length = 88
exclude = [".vscode", ".venv", "linux"]
select = [
"F", # Pyflakes
"E", # pycodestyle
"I", # Isort
"D", # pydocstyle
"W", # warning
"UP", # pyupgrad
"N", # pep8-naming
"S", # flake8-bandits
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"A", # flake8-builtins
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"T20", # flake8-print
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"ANN", # flake8-annotations
"SIM", # flake8-simplify
"PTH", # flake8-use-pathlib
"RUF", # meta rules (unused noqa)
"PL", # meta rules (unused noqa)
]
ignore = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"ANN101", # Missing type annotation for `self` in method
"UP007", # Use X | Y for type annotations
]
per-file-ignores = { "tests*" = ["S101", "ANN", "D", "PLR2004"] }
[tool.ruff.pydocstyle]
convention = "google"
[tool.mypy]
files = ["normcap/**/*.py", "tests/**/*.py", "bundle/**/*.py"]
follow_imports = "skip"
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
qt_api = "pyside6"
xvfb_width = 1920
xvfb_height = 1080
addopts = ["--durations=7"]
markers = [
"gui: tests which require a graphical interface to run",
"skip_on_gh: tests which are not supported during CI/CD on github",
]
[tool.coverage.run]
source = ["normcap"]
[tool.briefcase]
project_name = "NormCap"
bundle = "eu.dynobo"
version = "0.4.1"
url = "https://github.com/dynobo/normcap"
license = "GPLv3"
author = 'dynobo'
author_email = "dynobo@mailbox.org"
[tool.briefcase.app.normcap]
formal_name = "NormCap"
description = "OCR-powered screen-capture tool to capture information instead of images"
sources = ["normcap"]
icon = "bundle/imgs/normcap"
installer_icon = "bundle/imgs/normcap_install"
installer_background = "bundle/imgs/normcap_install_bg"
# ONHOLD: Switch to pyside6-essentials, once build works with Ubuntu 20.04+
requires = ["pyside6", "jeepney"]
cleanup_paths = [
# Globs
"**/[pP]y[sS]ide6/*[qQ]t*[oO]pen[gG][lL]*",
"**/*.debug",
"**/*[bB]odymovin*",
"**/*[lL]abs*",
"**/*[qQ]t[xX]ml*",
"**/*[qQ]t*[bB]luetooth*",
"**/*[qQ]t*[cC]harts*",
"**/*[qQ]t*[dD]ata[vV]isualization*",
"**/*[qQ]t*[dD]esigner*",
"**/*[qQ]t*[hH]elp*",
"**/*[qQ]t*[mM]ultimedia*",
"**/*[qQ]t*[pP]ositioning*",
"**/*[qQ]t*[pP]df*",
"**/*[qQ]t*[pP]rint[sS]upport*",
"**/*[qQ]t*[rR]emote[oO]bjects*",
"**/*[qQ]t*[sS]ensor*",
"**/*[qQ]t*[sS]erial*",
"**/*[qQ]t*[sS]hader[tT]ools*",
"**/*[qQ]t*[sS]ql*",
"**/*[qQ]t*[sS]tate[mM]achine*",
"**/*[qQ]t*[tT]est*",
"**/*[qQ]t*[wW]eb[cC]hannel*",
"**/*[qQ]t*[wW]eb[eE]ngine*",
"**/*[qQ]t*[wW]eb[sS]ockets*",
"**/*[qQ]t*3[dD]*",
"**/*[qQ]uick*",
"**/*[sS]cene*",
"**/*[sS]cxml*",
"**/*[uU]i[tT]ools*",
"**/*[vV]irtual[kK]eyboard*",
"**/*[wW]eb[vV]iew*",
"**/*QtQml*",
"**/bin/pyside6-*",
"**/libQt6Nfc*",
"**/render*",
"**/PySide6/[aA]ssistant*",
"**/PySide6/[dD]esigner*",
"**/PySide6/[lL]inguist*",
# Folders
"**/__pycache__",
"**/docs",
"**/examples",
"**/libexec",
"**/plugins/assetimporters",
"**/plugins/canbus",
"**/plugins/designer",
"**/plugins/printsupport",
"**/plugins/qmltooling",
"**/plugins/sceneparsers",
"**/plugins/sensors",
"**/plugins/sqldrivers",
"**/PySide6/Examples",
"**/Qt/qml/QtQml",
"**/Qt/resources",
"**/Qt/translations",
"**/tests",
"**/typesystems",
# Files
"**/icudtl.dat",
"**/PySide6/lrelease",
"**/PySide6/lupdate",
]
[tool.briefcase.app.normcap.macOS]
requires = ["std-nslog==1.0.0"]
[tool.briefcase.app.normcap.linux]
system_requires = [
"tesseract-ocr",
"libnotify-bin",
"pkg-config",
"build-essential",
"libtiff-dev",
"libpng-dev",
"libjpeg-dev",
"libfuse2",
"libwayland-dev",
"wayland-protocols",
"meson",
"git",
"software-properties-common", # required for apt-add-repository
# "wl-clipboard", Only available on Ubuntu 20.04+
]
dockerfile_extra_content = """
USER root
# Upgrade Tesseract 4 to 5
RUN apt-add-repository ppa:alex-p/tesseract-ocr-devel
RUN apt-get update -y && apt-get upgrade --with-new-pkgs -y
# Build wl-clipboard
RUN git clone https://github.com/bugaevc/wl-clipboard.git
RUN meson build wl-clipboard && ninja -C build
RUN mv build/src/wl-copy /usr/bin/ && rm -rf wl-clipboard
USER brutus
"""
[tool.briefcase.app.normcap.windows]
[tool.tbump]
[tool.tbump.version]
current = "0.4.1"
regex = '''
(?P<major>\d+)
\.
(?P<minor>\d+)
\.
(?P<patch>\d+)
((?P<extra>.+))?
'''
[tool.tbump.git]
message_template = "Bump to {new_version}"
tag_template = "v{new_version}"
[[tool.tbump.file]]
# Poetry version and Briefcase version
src = "pyproject.toml"
search = 'version = "{current_version}"'
[[tool.tbump.file]]
src = "normcap/__init__.py"
search = '__version__ = "{current_version}"'
[[tool.tbump.file]]
src = "docs/index.html"
[[tool.tbump.file]]
src = "README.md"
search = 'NormCap-{current_version}-'
[[tool.tbump.file]]
src = "README.md"
search = 'download/v{current_version}/'
[[tool.tbump.file]]
src = "bundle/normcap.wxs"
search = 'ProductVersion = "{current_version}"'
[[tool.tbump.before_commit]]
name = "check changelog"
cmd = "grep -q {new_version} CHANGELOG"