Debian Codegraph @

pyproject.toml

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