-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
182 lines (156 loc) · 5.13 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
[tool.poetry]
name = "svglab"
version = "0.0.0" # managed by poetry-dynamic-versioning, do not edit
description = "A manipulation and optimization library for Scalable Vector Graphics"
authors = ["Tomáš Režňák <tomas.reznak@volny.cz>"]
license = "MIT"
readme = "README.md"
classifiers = [
"Framework :: Pydantic :: 2",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Multimedia :: Graphics :: Editors :: Vector-Based",
"Topic :: Multimedia :: Graphics",
"Topic :: Scientific/Engineering :: Image Processing",
"Topic :: Text Processing :: Markup :: XML",
"Typing :: Typed",
]
[tool.poetry.urls]
"GitHub" = "https://github.com/reznakt/svglab"
"Issues" = "https://github.com/reznakt/svglab/issues"
[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "semver"
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"
[tool.poetry.dependencies]
python = "^3.10"
beautifulsoup4 = "^4.12.3"
bidict = "^0.23.1"
html5lib = "^1.1"
lark = "^1.2.2"
lxml = "^5.3.0"
pydantic = "^2.10.4"
pydantic-extra-types = "^2.10.1"
useful-types = "^0.2.1"
typing-extensions = "^4.12.2"
[tool.poetry.group.types.dependencies]
types-beautifulsoup4 = "^4.12.0.20241020"
[tool.poetry.group.test.dependencies]
hypothesis = "^6.123.2"
pytest = "^8.3.4"
pytest-accept = "^0.1.12"
pytest-clarity = "^1.0.1"
pytest-cov = "^6.0.0"
pytest-randomly = "^3.16.0"
pytest-sugar = "^1.0.0"
[tool.poetry.group.dev.dependencies]
poethepoet = "^0.32.0"
pre-commit = "^4.0.1"
pyright = "^1.1.391"
ruff = ">=0.8.4,<0.10.0"
vermin = "^1.6.0"
ssort = "^0.14.0"
[tool.poetry.scripts]
svglab = "svglab.__main__:main"
[tool.poe.tasks]
lint = "ruff check"
lint-fix = "ruff check --fix"
start = "poetry run svglab"
test = "pytest"
typecheck = "pyright --warnings"
versioncheck = "vermin ."
_ruff-format = "ruff format --diff"
_ssort = "ssort --check"
format = ["_ruff-format", "_ssort"]
_ruff-format-fix = "ruff format"
_ssort-fix = "ssort"
format-fix = ["_ruff-format-fix", "_ssort-fix"]
[tool.pytest.ini_options]
addopts = ["--cov", "--doctest-continue-on-failure", "--doctest-modules"]
filterwarnings = [
# https://bugs.launchpad.net/beautifulsoup/+bug/2076897
"ignore:The 'strip_cdata' option of HTMLParser\\(\\) has never done anything and will eventually be removed.",
]
[tool.coverage.run]
omit = ["tests/*"]
[tool.pyright]
deprecateTypingAliases = false # covered by Ruff + shows false positives
enableReachabilityAnalysis = true
pythonPlatform = "All"
pythonVersion = "3.10"
reportInvalidTypeVarUse = true
reportMissingImports = true
reportMissingTypeArgument = true
reportMissingTypeStubs = false
reportPrivateUsage = true
reportUnknownArgumentType = false
reportUnknownMemberType = false
reportUnknownParameterType = false
reportUnknownVariableType = false
reportUnnecessaryCast = true
reportUnnecessaryComparison = true
reportUntypedFunctionDecorator = true
reportUnusedImport = false # covered by Ruff
strictDictionaryInference = true
strictListInference = true
strictSetInference = true
typeCheckingMode = "strict"
[tool.ruff]
target-version = "py310"
show-fixes = true
line-length = 75 # formatter
[tool.ruff.lint]
select = ["ALL"]
fixable = ["ALL"]
ignore = [
# conflicts
"D211", # No blank lines allowed before class docstring
"D213", # Multi-line docstring summary should start at the second line
"COM812", # Missing trailing comma in a tuple
"D203", # 1 blank line required before class docstring
"ISC001", # Use of `is` with a literal
"UP035", # Conflicts with ban on `typing`
# missing docstrings
"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
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in __init__
# exceptions
"TRY003", # Avoid specifying long messages outside the exception class
"EM101", # Exception must not use a string literal
# `TODO`s
"FIX002", # Line contains TODO
"TD002", # Missing author in TODO
"TD003", # Missing issue link on the line following this TODO
# misc
"S101", # Use of assert detected
"TC001", # Move application import into a type-checking block
"TC002", # Move third-party import into a type-checking block
"TC003", # Move standard library import into a type-checking block
"E741", # Ambiguous variable name
]
[tool.ruff.lint.extend-per-file-ignores]
"tests/**/*" = [
"PLR200", # Magic value used in comparison
"PLR0913", # Too many arguments in function definition
]
[tool.ruff.lint.pycodestyle]
max-line-length = 79 # linter
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.isort]
lines-after-imports = 2
split-on-trailing-comma = false
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"abc.ABC".msg = "Use `metaclass=abc.ABCMeta` instead"
"typing".msg = "Use `typing_extensions` instead"
[tool.ruff.format]
docstring-code-format = true
skip-magic-trailing-comma = true