forked from lincolnloop/python-qrcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
192 lines (172 loc) · 6.28 KB
/
pyproject.toml
File metadata and controls
192 lines (172 loc) · 6.28 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
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
[build-system]
requires = ["poetry-core>=2"]
build-backend = "poetry.core.masonry.api"
[project]
name = "qrcode"
version = "9.0"
description = "QR Code image generator"
authors = [
{ name = "Lincoln Loop", email = "info@lincolnloop.com" },
]
license = { text = "BSD-3-Clause" }
dynamic = ["readme"]
keywords = ["qr", "denso-wave", "IEC18004"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Multimedia :: Graphics",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.10"
dependencies = [
"colorama; sys_platform == 'win32'",
"deprecation",
]
[project.optional-dependencies]
pil = ["pillow >=9.1.0"]
png = ["pypng"]
all = ["pypng", "pillow >=9.1.0"]
[project.urls]
homepage = "https://github.com/lincolnloop/python-qrcode"
repository = "https://github.com/lincolnloop/python-qrcode.git"
documentation = "https://github.com/lincolnloop/python-qrcode#readme"
changelog = "https://github.com/lincolnloop/python-qrcode/blob/main/CHANGES.rst"
"Bug Tracker" = "https://github.com/lincolnloop/python-qrcode/issues"
[project.scripts]
qr = "qrcode.console_scripts:main"
[dependency-groups]
dev = [
"pytest",
"pytest-cov",
"ruff",
"mypy>=1.13",
"pypng",
"pillow>=9.1.0",
"docutils>=0.21.2",
"zest-releaser[recommended]>=9.2.0",
"sphinx>=7.0",
]
[tool.poetry]
packages = [{ include = "qrcode" }]
readme = ["README.rst", "CHANGES.rst"]
# There is no support for data files yet.
# https://github.com/python-poetry/poetry/issues/9519
#
# data_files = [
# { destination = "share/man/man1", from = [ "doc/qr.1" ] },
# ]
[tool.zest-releaser]
less-zeros = "yes"
version-levels = 2
tag-format = "v{version}"
tag-message = "Version {version}"
tag-signing = "yes"
date-format = " %%-d %%B %%Y"
prereleaser.middle = [
"qrcode.release.update_manpage"
]
[tool.coverage.run]
source = ["qrcode"]
parallel = true
omit = ["qrcode/tests/*", "qrcode/release.py"]
[tool.coverage.report]
exclude_lines = [
"@abc.abstractmethod",
"@overload",
"if (typing\\.)?TYPE_CHECKING:",
"pragma: no cover",
"raise NotImplementedError"
]
skip_covered = true
show_missing = true
fail_under = 90
[tool.ruff]
target-version = "py310"
exclude = ["migrations"]
lint.select = ["ALL"]
lint.ignore = [
# Safe to ignore
"A001", # Variable is shadowing a Python builtin
"A002", # Function argument is shadowing a Python builtin
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`"
"ARG001", # Unused function argument (request, ...)
"ARG002", # Unused method argument (*args, **kwargs)
"ARG005", # Unused lambda argument
"D", # Missing or badly formatted docstrings
"E501", # Line too long (>88)
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first "ERA001", # Found commented-out code
"ERA001", # Found commented-out code
"FBT", # Flake Boolean Trap (don't use arg=True in functions)
"N999", # Invalid module name
"PLR091", # Too many statements/branches/arguments
"PLR2004", # Magic value used in comparison, consider replacing <int> with a constant variable
"RUF012", # Mutable class attributes https://github.com/astral-sh/ruff/issues/5243
"SIM105", # Use contextlib.suppress(ImportError) instead of try-except-pass
"SLF001", # private-member-access
"TRY003", # Avoid specifying long messages outside the exception class
# Should be fixed later
"C901", # Too complex
"N802", # Function name should be lowercase
"N803", # Argument name should be lowercase
"N806", # Variable should be lowercase
"PERF401", # Use `list.extend` to create a transformed list
"S101", # Use of 'assert' detected
# Required for `ruff format` to work correctly
"COM812", # Checks for the absence of trailing commas
"ISC001", # Checks for implicitly concatenated strings on a single line
# Cosmetic / stylistic — not critical for correctness
"E402", # Module level import not at top of file (docstring after __future__)
"T20", # print() calls (needed in CLI for stderr output)
"RUF001", # String contains ambiguous unicode characters
"RUF002", # Docstring contains ambiguous unicode characters
# Pre-existing — not introduced by P1 tasks
"TC003", # Type-checking block imports (safe with from __future__ annotations)
"B007", # Unused loop variable (pre-existing in util.py)
]
[tool.ruff.lint.extend-per-file-ignores]
"qrcode/tests/*.py" = [
"ANN", # Type annotations not required in tests
"F401", # Unused import
"I001", # Import sorting (cosmetic — tests import what they need)
"PLC0415", # Import not at top of a file
"PT011", # pytest.raises is too broad
"PT018", # Assertion should be broken down (unsafe auto-fix)
"PT028", # Test param with default arg (pre-existing pattern)
"RUF003", # Ambiguous unicode in comments (pre-existing)
"RUF061", # Context-manager form of pytest.raises (pre-existing)
"S101", # Use of 'assert' detected
"S603", # `subprocess` call: check for execution of untrusted input
]
"qrcode/release.py" = ["ANN"] # Release tooling — not part of public API
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = false
check_untyped_defs = true
disallow_untyped_decorators = false
no_implicit_optional = true
strict_optional = true
ignore_missing_imports = true # External packages without type stubs (colorama, deprecation)
# Per-file overrides: relax strict rules for files with legitimate patterns
[[tool.mypy.overrides]]
module = "qrcode.compat.png"
# Conditional import pattern: PngWriter = None then try/except redefines it
warn_no_return = false
disable_error_code = ["no-redef"]
[[tool.mypy.overrides]]
module = "qrcode.release"
# Release tooling — not part of public API, gradual typing
disallow_untyped_defs = false