Debian Codegraph @

pyproject.toml

raw ◀ ▶
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.9",
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 == 2026.4",
58 "tzlocal == 5.4.4",
59 "pystache == 0.6.8",
60
61 "apify_fingerprint_datapoints == 0.15.0", # needed for browserforge
62 "click == 8.5.0", # needed for browserforge
63 "browserforge == 1.2.4", # needed for camoufox
64 ]
65
66 [project.urls]
67 Homepage = "https://calibre-ebook.com"
68 FAQ = "https://manual.calibre-ebook.com/faq.html"
69 Documentation = "https://manual.calibre-ebook.com"
70 Repository = "https://github.com/kovidgoyal/calibre.git"
71 Issues = "https://bugs.launchpad.net/calibre"
72 Changelog = "https://github.com/kovidgoyal/calibre/blob/master/Changelog.txt"
73 Community-Forum = "https://www.mobileread.com/forums/forumdisplay.php?f=166"
74
75 [build-system]
76 requires = [
77 "installer == 0.7.0", # Needed for installing pure python packages at build time
78 "packaging == 25.0", # Needed for build which is needed for setuptools
79 "pyproject_hooks == 1.2.0", # Needed for build which is needed for setuptools
80 "wheel == 0.46.2", # Needed for build which is needed for setuptools
81 "build == 1.3.0", # Needed for build which is needed for setuptools
82 "pybind11 == 3.0.1", # Needed for pillow
83 "setuptools == 83.0.0",
84 "pkgconfig == 1.5.5", # Needed by Brotli
85 # Some packages (xxhash/py7zr/etc) erroneously declare this as a dependency even
86 # though it is needed only for sdist not building wheels
87 "setuptools_scm == 9.2.2",
88 "poetry_core == 2.2.1", # needed for building zeroconf
89 "ply == 3.11", # needed for sip
90 "sip == 6.14.0",
91 "PyQt_builder == 1.19.1",
92 ]
93 [dependency-groups]
94 dev = [
95 "ruff >= 0.15.21",
96 "types-lxml >= 2026.2.16",
97 "ty >= 0.0.59",
98 "rapydscript-ng >= 0.8.5",
99 "clang-format >= 22.1.8",
100 ]
101
102 [tool.ruff]
103 line-length = 160
104 builtins = ['_', 'I', 'P']
105 include = ['*.py', '*.pyi', '*.recipe']
106 extension = { recipe = "python" }
107 extend-exclude = [
108 "*_ui.py",
109 "bypy/*",
110 "setup/polib.py",
111 "setup/linux-installer.py",
112 "src/css_selectors/*",
113 "src/polyglot/*",
114 "src/tinycss/*",
115 ]
116 preview = true
117
118 [tool.ruff.format]
119 quote-style = 'preserve'
120
121 [tool.ruff.lint]
122 explicit-preview-rules = true
123 ignore = [
124 'E402', 'E741',
125 'UP012', 'UP030', 'C413', 'C420', 'PIE790', 'ISC003', 'FURB122', 'FURB166', 'FURB167',
126 'RUF001', 'RUF002', 'RUF003', 'RUF005', 'RUF012', 'RUF013', 'RUF015', 'RUF031', 'RUF100',
127 'PLE1205', 'PLW0602', 'PLW0603', 'PLW1510', 'PLW1641', 'PLW2901', 'PLC0415',
128 'PLR0911', 'PLR0912', 'PLR0913', 'PLR0914', 'PLR0915', 'PLR0916', 'PLR0917', 'PLR1702', 'PLR1704', 'PLR2004', 'PLR6301',
129 'RUF059', # unused unpacked variable
130 ]
131 select = [
132 'E', 'F', 'I', 'W', 'INT',
133 'Q', 'UP', 'YTT', 'TID', 'C4', 'COM818', 'PIE', 'RET501', 'ISC',
134 'PLE', 'PLW', 'PLC', 'PLR', 'ASYNC', 'FURB',
135 'RUF', # note: RUF can flag many unsolicited errors
136 # preview rules
137 'RUF051', 'RUF056', # useless dict operation
138 'RUF055', # unnecessary regex
139 'RUF039', # always use raw-string for regex
140 'RUF047', # needless else
141 'E302', 'E303', 'E304', 'E305', 'W391', # blank-line standard
142 'E111', 'E112', 'E113', 'E117', # code indentation
143 'E114', 'E115', 'E116', 'E261', 'E262', 'E265', # comment formatting
144 'E201', 'E202', 'E211', 'E251', 'E275', # various whitespace
145 ]
146 unfixable = ['PIE794', 'ISC001']
147 extend-select = ["ANN"]
148
149 [tool.ruff.lint.per-file-ignores]
150 "recipes/*" = ['UP', 'FURB188']
151 "setup/changelog.py" = ['ISC001']
152 "src/calibre/ebooks/unihandecode/*codepoints.py" = ['E501']
153 "src/calibre/ebooks/metadata/sources/*" = ['UP', 'FURB188']
154 "src/calibre/gui2/store/stores/*" = ['UP', 'FURB188']
155 "src/qt/*.py" = ['I', 'E302']
156 "src/qt/*.pyi" = ['I']
157 "!{src/calibre/ai/**/*.py,src/calibre/web/automate/**/*.py}" = ['ANN']
158 # This module wraps a browser, whose operations can all block indefinitely on
159 # the network, so every one of them takes an explicit timeout
160 "src/calibre/web/automate/camoufox.py" = ['ASYNC109']
161
162 [tool.ruff.lint.isort]
163 detect-same-package = true
164 extra-standard-library = ["aes", "elementmaker", "encodings"]
165 known-first-party = ["calibre_extensions", "calibre_plugins", "polyglot"]
166 known-third-party = ["odf", "qt", "tinycss", "css_selectors"]
167 relative-imports-order = "closest-to-furthest"
168 split-on-trailing-comma = false
169 section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
170
171 [tool.ruff.lint.flake8-comprehensions]
172 allow-dict-calls-with-keyword-arguments = true
173
174 [tool.ruff.lint.flake8-quotes]
175 avoid-escape = true
176 docstring-quotes = 'double' # PEP 257
177 inline-quotes = 'single'
178 multiline-quotes = 'single'
179
180 [tool.codespell]
181 count = false
182 summary = false
183 quiet-level = 3
184 regex = '''\b[\w\-'’]+\b'''
185 ignore-regex = '''\b[\w\-'’]*&(amp;)?[\w\-'’]*\b'''
186 builtin = [
187 'clear',
188 'rare',
189 'informal',
190 'code',
191 ]
192 exclude-file = "codespell.exclude"
193 ignore-words-list = [
194 "alo",
195 "ans",
196 "clen",
197 "eto",
198 "fo",
199 "nam",
200 "nd",
201 "som",
202 "te",
203 "atLeast",
204 "Implementor",
205 "implementor",
206 "Implementors",
207 "implementors",
208 "missings",
209 "re-use",
210 "re-used",
211 "re-using",
212 "splited",
213 "succeded",
214 # code
215 "ro",
216 "ws",
217 "deque",
218 "assertIn",
219 "atEnd",
220 "errorString",
221 "FocusIn",
222 "iff",
223 "lets",
224 "lite",
225 "UINT",
226 "uInt",
227 "uint",
228 "KeyPair",
229 "Keypair",
230 "keypair",
231 "seeked",
232 "stdio",
233 "thead",
234 ]
235 uri-ignore-words-list = '*'
236 skip = [
237 "*.svg",
238 "*.rcc",
239 "*_ui.py",
240 "./src/calibre/ebooks/rtf2xml/char_set.py",
241 "./src/calibre/ebooks/unihandecode/*",
242 "./src/calibre/ebooks/html_entities.h",
243 "./src/calibre/ebooks/html_entities.py",
244 "./src/calibre/utils/icu_test.py",
245 "./src/calibre/utils/search_query_parser_test.py",
246 "./Changelog.old.txt",
247 "./COPYRIGHT",
248 "./LICENSE",
249 "./LICENSE.rtf",
250 "./session.vim",
251 "./build/*",
252 "./docs/*",
253 "./nbproject/*",
254 "./recipes/*",
255 "./translations/*",
256 "./tags/*",
257 "./manual/generated/*",
258 "./manual/locale/*",
259 "./resources/dictionaries/*",
260 "./resources/localization/*",
261 "./resources/hyphenation/*",
262 "./resources/mathjax/*",
263 "./resources/builtin_recipes.xml",
264 "./resources/changelog.json",
265 "./resources/editor.js",
266 "./resources/editor-functions.json",
267 "./resources/mime.types",
268 "./resources/piper-voices.json",
269 "./resources/stylelint-bundle.min.js",
270 "./resources/user-manual-translation-stats.json",
271 "./resources/template-functions.json",
272 "./resources/viewer.js",
273 "./resources/viewer.html",
274 "./resources/content-server/index-generated.html",
275 "./setup/installer/*",
276 "./setup/pyqt_enums/*",
277 "./setup/lc_data.py",
278 "./setup/linux-installer.py",
279 "./src/css_selectors/*",
280 "./src/polyglot/*",
281 "./src/tinycss/*",
282 "./src/unicode_names/*",
283 ]
284
285 [tool.flynt]
286 line-length = 400 # over value to catch every case
287 transform-format = false # don't transform already existing format call
288 exclude = [
289 "bypy/",
290 "setup/polib.py",
291 "setup/linux-installer.py",
292 "src/calibre/ebooks/metadata/sources/",
293 "src/calibre/gui2/store/stores/",
294 "src/css_selectors/",
295 "src/polyglot/",
296 "src/tinycss/",
297 ]
298
299 [tool.ty.environment]
300 root = ['./src']
301 extra-paths = ['./stubs']
302 python-platform = "all"
303
304 [tool.ty.src]
305 exclude = [
306 '**/*_ui.py', '**/*_test.py', '**/test_*.py',
307 'setup/*.py', 'setup.py', 'manual/**/*.py', 'bypy/**/*.py',
308 '**/tests/**',
309 '.github/workflows/*.py',
310 'src/calibre/library/add_to_library.py',
311 'src/calibre/library/database.py',
312 'src/calibre/library/database2.py',
313 'src/calibre/library/sqlite.py',
314 'src/calibre/library/prefs.py',
315 'src/calibre/library/restore.py',
316 'src/calibre/library/custom_columns.py',
317 'src/calibre/library/schema_upgrades.py',
318 'src/calibre/gui2/pyqt6_compat.py',
319 ]