Debian Codegraph @

pyproject.toml

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