Debian Codegraph @

pyproject.toml

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 [project]
2 name = "calibre"
3 description = "The one stop solution to all your e-book needs"
4 readme = "README.md"
5 requires-python = ">=3.14"
6 license = "GPL-3.0-only"
7 dynamic = ["version"]
8 dependencies = [
9 "six == 1.17.0",
10 "unrardll == 0.1.7",
11 "lxml == 6.1.1",
12 "pychm == 0.8.6",
13 "html5-parser == 0.4.12",
14 "css-parser == 1.1.1",
15 "python-dateutil == 2.9.0",
16 "jeepney == 0.9.0",
17 "dnspython == 2.8.0",
18 "mechanize == 0.4.10",
19 "feedparser-sgmllib == 2.0.1",
20 "feedparser == 6.0.14",
21 "Markdown == 3.10.0",
22 "html2text == 2025.4.15",
23 "soupsieve == 2.8.4",
24 "typing-extensions == 4.15.0", # needed by beautifulsoup4
25 "beautifulsoup4 == 4.14.3",
26 "regex == 2025.11.3",
27 "chardet == 5.2.0",
28 "msgpack == 1.2.1",
29 "Pygments == 2.20.0",
30 "pycryptodome == 3.23.0",
31 "apsw == 3.53.2.0",
32 "webencodings == 0.5.1",
33 "html5lib == 1.1",
34 "pillow == 12.3.0",
35 "netifaces == 0.11.0",
36 "psutil == 7.1.3",
37 "ifaddr == 0.2.0",
38 "texttable == 1.7.0",
39 "multivolumefile == 0.2.3",
40 "Brotli == 1.2.0",
41 "pyppmd == 1.3.1",
42 "pybcj == 1.0.7",
43 "inflate64 == 1.0.4",
44 "py7zr == 1.1.3",
45 "jaconv == 0.4.1",
46 "wrapt == 2.0.1",
47 "Deprecated == 1.3.1",
48 "pykakasi == 2.3.0",
49 "zeroconf == 0.149.16",
50 "fonttools == 4.61.0",
51 "lxml_html_clean == 0.4.5",
52 "PyQt6_sip == 13.10.2",
53 "PyQt6 == 6.10.0",
54 "PyQt6_WebEngine == 6.10.0",
55 "MacFSEvents == 0.8.4; sys_platform == 'darwin'",
56 "xxhash == 3.6.0",
57 "tzdata == 2025.2",
58 "tzlocal == 5.3.1",
59 "pystache == 0.6.8",
60 ]
61
62 [project.urls]
63 Homepage = "https://calibre-ebook.com"
64 FAQ = "https://manual.calibre-ebook.com/faq.html"
65 Documentation = "https://manual.calibre-ebook.com"
66 Repository = "https://github.com/kovidgoyal/calibre.git"
67 Issues = "https://bugs.launchpad.net/calibre"
68 Changelog = "https://github.com/kovidgoyal/calibre/blob/master/Changelog.txt"
69 Community-Forum = "https://www.mobileread.com/forums/forumdisplay.php?f=166"
70
71 [build-system]
72 requires = [
73 "installer == 0.7.0", # Needed for installing pure python packages at build time
74 "packaging == 25.0", # Needed for build which is needed for setuptools
75 "pyproject_hooks == 1.2.0", # Needed for build which is needed for setuptools
76 "wheel == 0.46.2", # Needed for build which is needed for setuptools
77 "build == 1.3.0", # Needed for build which is needed for setuptools
78 "pybind11 == 3.0.1", # Needed for pillow
79 "setuptools == 83.0.0",
80 "pkgconfig == 1.5.5", # Needed by Brotli
81 # Some packages (xxhash/py7zr/etc) erroneously declare this as a dependency even
82 # though it is needed only for sdist not building wheels
83 "setuptools_scm == 9.2.2",
84 "poetry_core == 2.2.1", # needed for building zeroconf
85 "ply == 3.11", # needed for sip
86 "sip == 6.14.0",
87 "PyQt_builder == 1.19.1",
88 ]
89 [dependency-groups]
90 dev = [
91 "ruff >= 0.15.21",
92 "types-lxml >= 2026.2.16",
93 "ty >= 0.0.59",
94 "rapydscript-ng >= 0.8.5",
95 "clang-format >= 22.1.8",
96 ]
97
98 [tool.ruff]
99 line-length = 160
100 builtins = ['_', 'I', 'P']
101 include = ['*.py', '*.pyi', '*.recipe']
102 extension = { recipe = "python" }
103 extend-exclude = [
104 "*_ui.py",
105 "bypy/*",
106 "setup/polib.py",
107 "setup/linux-installer.py",
108 "src/css_selectors/*",
109 "src/polyglot/*",
110 "src/tinycss/*",
111 ]
112 preview = true
113
114 [tool.ruff.format]
115 quote-style = 'preserve'
116
117 [tool.ruff.lint]
118 explicit-preview-rules = true
119 ignore = [
120 'E402', 'E741',
121 'UP012', 'UP030', 'C413', 'C420', 'PIE790', 'ISC003', 'FURB122', 'FURB166', 'FURB167',
122 'RUF001', 'RUF002', 'RUF003', 'RUF005', 'RUF012', 'RUF013', 'RUF015', 'RUF031', 'RUF100',
123 'PLE1205', 'PLW0602', 'PLW0603', 'PLW1510', 'PLW1641', 'PLW2901', 'PLC0415',
124 'PLR0911', 'PLR0912', 'PLR0913', 'PLR0914', 'PLR0915', 'PLR0916', 'PLR0917', 'PLR1702', 'PLR1704', 'PLR2004', 'PLR6301',
125 'RUF059', # unused unpacked variable
126 ]
127 select = [
128 'E', 'F', 'I', 'W', 'INT',
129 'Q', 'UP', 'YTT', 'TID', 'C4', 'COM818', 'PIE', 'RET501', 'ISC',
130 'PLE', 'PLW', 'PLC', 'PLR', 'ASYNC', 'FURB',
131 'RUF', # note: RUF can flag many unsolicited errors
132 # preview rules
133 'RUF051', 'RUF056', # useless dict operation
134 'RUF055', # unnecessary regex
135 'RUF039', # always use raw-string for regex
136 'RUF047', # needless else
137 'E302', 'E303', 'E304', 'E305', 'W391', # blank-line standard
138 'E111', 'E112', 'E113', 'E117', # code indentation
139 'E114', 'E115', 'E116', 'E261', 'E262', 'E265', # comment formatting
140 'E201', 'E202', 'E211', 'E251', 'E275', # various whitespace
141 ]
142 unfixable = ['PIE794', 'ISC001']
143 extend-select = ["ANN"]
144
145 [tool.ruff.lint.per-file-ignores]
146 "recipes/*" = ['UP', 'FURB188']
147 "setup/changelog.py" = ['ISC001']
148 "src/calibre/ebooks/unihandecode/*codepoints.py" = ['E501']
149 "src/calibre/ebooks/metadata/sources/*" = ['UP', 'FURB188']
150 "src/calibre/gui2/store/stores/*" = ['UP', 'FURB188']
151 "src/qt/*.py" = ['I', 'E302']
152 "src/qt/*.pyi" = ['I']
153 "!{src/calibre/ai/**/*.py}" = ['ANN']
154
155 [tool.ruff.lint.isort]
156 detect-same-package = true
157 extra-standard-library = ["aes", "elementmaker", "encodings"]
158 known-first-party = ["calibre_extensions", "calibre_plugins", "polyglot"]
159 known-third-party = ["odf", "qt", "tinycss", "css_selectors"]
160 relative-imports-order = "closest-to-furthest"
161 split-on-trailing-comma = false
162 section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
163
164 [tool.ruff.lint.flake8-comprehensions]
165 allow-dict-calls-with-keyword-arguments = true
166
167 [tool.ruff.lint.flake8-quotes]
168 avoid-escape = true
169 docstring-quotes = 'double' # PEP 257
170 inline-quotes = 'single'
171 multiline-quotes = 'single'
172
173 [tool.codespell]
174 count = false
175 summary = false
176 quiet-level = 3
177 regex = '''\b[\w\-'’]+\b'''
178 ignore-regex = '''\b[\w\-'’]*&(amp;)?[\w\-'’]*\b'''
179 builtin = [
180 'clear',
181 'rare',
182 'informal',
183 'code',
184 ]
185 exclude-file = "codespell.exclude"
186 ignore-words-list = [
187 "alo",
188 "ans",
189 "clen",
190 "eto",
191 "fo",
192 "nam",
193 "nd",
194 "som",
195 "te",
196 "atLeast",
197 "Implementor",
198 "implementor",
199 "Implementors",
200 "implementors",
201 "missings",
202 "re-use",
203 "re-used",
204 "re-using",
205 "splited",
206 "succeded",
207 # code
208 "ro",
209 "ws",
210 "deque",
211 "assertIn",
212 "atEnd",
213 "errorString",
214 "FocusIn",
215 "iff",
216 "lets",
217 "lite",
218 "UINT",
219 "uInt",
220 "uint",
221 "KeyPair",
222 "Keypair",
223 "keypair",
224 "seeked",
225 "stdio",
226 "thead",
227 ]
228 uri-ignore-words-list = '*'
229 skip = [
230 "*.svg",
231 "*.rcc",
232 "*_ui.py",
233 "./src/calibre/ebooks/rtf2xml/char_set.py",
234 "./src/calibre/ebooks/unihandecode/*",
235 "./src/calibre/ebooks/html_entities.h",
236 "./src/calibre/ebooks/html_entities.py",
237 "./src/calibre/utils/icu_test.py",
238 "./src/calibre/utils/search_query_parser_test.py",
239 "./Changelog.old.txt",
240 "./COPYRIGHT",
241 "./LICENSE",
242 "./LICENSE.rtf",
243 "./session.vim",
244 "./build/*",
245 "./docs/*",
246 "./nbproject/*",
247 "./recipes/*",
248 "./translations/*",
249 "./tags/*",
250 "./manual/generated/*",
251 "./manual/locale/*",
252 "./resources/dictionaries/*",
253 "./resources/localization/*",
254 "./resources/hyphenation/*",
255 "./resources/mathjax/*",
256 "./resources/builtin_recipes.xml",
257 "./resources/changelog.json",
258 "./resources/editor.js",
259 "./resources/editor-functions.json",
260 "./resources/mime.types",
261 "./resources/piper-voices.json",
262 "./resources/stylelint-bundle.min.js",
263 "./resources/user-manual-translation-stats.json",
264 "./resources/template-functions.json",
265 "./resources/viewer.js",
266 "./resources/viewer.html",
267 "./resources/content-server/index-generated.html",
268 "./setup/installer/*",
269 "./setup/pyqt_enums/*",
270 "./setup/lc_data.py",
271 "./setup/linux-installer.py",
272 "./src/css_selectors/*",
273 "./src/polyglot/*",
274 "./src/tinycss/*",
275 "./src/unicode_names/*",
276 ]
277
278 [tool.flynt]
279 line-length = 400 # over value to catch every case
280 transform-format = false # don't transform already existing format call
281 exclude = [
282 "bypy/",
283 "setup/polib.py",
284 "setup/linux-installer.py",
285 "src/calibre/ebooks/metadata/sources/",
286 "src/calibre/gui2/store/stores/",
287 "src/css_selectors/",
288 "src/polyglot/",
289 "src/tinycss/",
290 ]
291
292 [tool.ty.environment]
293 root = ['./src']
294 extra-paths = ['./stubs']
295 python-platform = "all"
296
297 [tool.ty.src]
298 exclude = [
299 '**/*_ui.py', '**/*_test.py', '**/test_*.py',
300 'setup/*.py', 'setup.py', 'manual/**/*.py', 'bypy/**/*.py',
301 '**/tests/**',
302 '.github/workflows/*.py',
303 'src/calibre/library/add_to_library.py',
304 'src/calibre/library/database.py',
305 'src/calibre/library/database2.py',
306 'src/calibre/library/sqlite.py',
307 'src/calibre/library/prefs.py',
308 'src/calibre/library/restore.py',
309 'src/calibre/library/custom_columns.py',
310 'src/calibre/library/schema_upgrades.py',
311 'src/calibre/gui2/pyqt6_compat.py',
312 ]