projects/guix·blob libreoffice · refs

1793 lines · 66.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Cyril Roelandt <[email protected]>
3;;; Copyright © 2015, 2024, 2025 Ricardo Wurmus <[email protected]>
4;;; Copyright © 2015, 2020, 2023, 2024 Efraim Flashner <[email protected]>
5;;; Copyright © 2016 Hartmut Goebel <[email protected]>
6;;; Copyright © 2016 Leo Famulari <[email protected]>
7;;; Copyright © 2017 Danny Milosavljevic <[email protected]>
8;;; Copyright © 2017 Muriithi Frederick Muriuki <[email protected]>
9;;; Copyright © 2017, 2020, 2021 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2020, 2023 Marius Bakke <[email protected]>
11;;; Copyright © 2020 Tanguy Le Carrour <[email protected]>
12;;; Copyright © 2021 Clément Lassieur <[email protected]>
13;;; Copyright © 2018, 2021-2023, 2025 Maxim Cournoyer <[email protected]>
14;;; Copyright © 2019 Vagrant Cascadian <[email protected]>
15;;; Copyright © 2020, 2021, 2022, 2023 Ricardo Wurmus <[email protected]>
16;;; Copyright © 2022 Garek Dyszel <[email protected]>
17;;; Copyright © 2022 Greg Hogan <[email protected]>
18;;; Copyright © 2024 Christopher Baines <[email protected]>
19;;; Copyright © 2024 David Elsing <[email protected]>
20;;; Copyright © 2024 Zheng Junjie <[email protected]>
21;;; Copyright © 2024 Antero Mejr <[email protected]>
22;;; Copyright © 2024, 2025 Sharlatan Hellseher <[email protected]>
23;;; Copyright © 2025 Nicolas Graves <[email protected]>
24;;; Copyright © 2025 Nguyễn Gia Phong <[email protected]>
25;;;
26;;; This file is part of GNU Guix.
27;;;
28;;; GNU Guix is free software; you can redistribute it and/or modify it
29;;; under the terms of the GNU General Public License as published by
30;;; the Free Software Foundation; either version 3 of the License, or (at
31;;; your option) any later version.
32;;;
33;;; GNU Guix is distributed in the hope that it will be useful, but
34;;; WITHOUT ANY WARRANTY; without even the implied warranty of
35;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36;;; GNU General Public License for more details.
37;;;
38;;; You should have received a copy of the GNU General Public License
39;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40
41(define-module (gnu packages python-build)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages bash)
44 #:use-module ((guix licenses) #:prefix license:)
45 #:use-module (guix build-system gnu)
46 #:use-module (guix build-system pyproject)
47 #:use-module (guix gexp)
48 #:use-module (guix deprecation)
49 #:use-module (guix download)
50 #:use-module (guix git-download)
51 #:use-module (guix packages))
52
53;;; Commentary:
54;;;
55;;; Python packages to build... Python packages. Since they are bound to be
56;;; relied on by many, their dependencies should be kept minimal, and this
57;;; module should not depend on other modules containing Python packages.
58;;;
59;;; Code:
60
61
62;;; These are dependencies used by the build systems contained herein; they
63;;; feel a bit out of place but are kept here to prevent circular module
64;;; dependencies.
65(define-public python-autocommand
66 (package
67 (name "python-autocommand")
68 (version "2.2.2")
69 (source
70 (origin
71 (method url-fetch)
72 (uri (pypi-uri "autocommand" version))
73 (sha256
74 (base32 "0d2zjms5xm236k46la5pnl7i7hs3a12jlp12cw8lk5jm7i1fk3c7"))))
75 (build-system pyproject-build-system)
76 (native-inputs
77 (list python-pytest-bootstrap
78 python-setuptools-bootstrap))
79 (home-page "https://github.com/Lucretiel/autocommand")
80 (synopsis "Python library to build a command-line from a function")
81 (description "@code{autocommand} is library to automatically generate and
82run simple @code{argparse} parsers from function signatures.")
83 (license license:lgpl3+)))
84
85(define-public python-backports-tarfile
86 (package
87 (name "python-backports-tarfile")
88 (version "1.2.0")
89 (source
90 (origin
91 (method url-fetch)
92 (uri (pypi-uri "backports_tarfile" version))
93 (sha256
94 (base32 "14d9xibla5aahjqf9y0nmpk5vs4qds5rfy628j0invkld3104pnp"))))
95 (build-system pyproject-build-system)
96 (arguments
97 (list #:tests? #f)) ;XXX: Cycles with python-jaraco-context
98 (native-inputs
99 (list python-setuptools-bootstrap
100 python-setuptools-scm-bootstrap))
101 (home-page "https://github.com/jaraco/backports.tarfile")
102 (synopsis "Backport of CPython tarfile module")
103 (description "This package provides a backport of CPython tarfile module.")
104 (license license:expat)))
105
106(define-public python-colorama
107 (package
108 (name "python-colorama")
109 (version "0.4.6")
110 (source
111 (origin
112 (method url-fetch)
113 (uri (pypi-uri "colorama" version))
114 (sha256
115 (base32 "0i3fpq0w5mbfdpy3z9p5raw4fg17jxr6jwh5l8qhavpdnxf5ys88"))))
116 (build-system pyproject-build-system)
117 (native-inputs
118 (list python-hatchling
119 python-pytest-bootstrap))
120 (home-page "https://pypi.org/project/colorama/")
121 (synopsis "Colored terminal text rendering for Python")
122 (description
123 "Colorama is a Python library for rendering colored terminal text.")
124 (license license:bsd-3)))
125
126(define-public python-distlib
127 (package
128 (name "python-distlib")
129 (version "0.3.7")
130 (source
131 (origin
132 (method url-fetch)
133 (uri (pypi-uri "distlib" version))
134 (sha256
135 (base32
136 "1a27f5p93j9i1l3324qgahs3g8ai91fmx783jpyyla506i5ybbwx"))))
137 (build-system pyproject-build-system)
138 (arguments
139 (list
140 #:phases
141 #~(modify-phases %standard-phases
142 (add-before 'build 'no-/bin/sh
143 (lambda* (#:key inputs #:allow-other-keys)
144 (let ((/bin/sh (search-input-file inputs "bin/sh")))
145 (substitute* '("distlib/scripts.py" "tests/test_scripts.py")
146 (("/bin/sh") /bin/sh)))))
147 (add-before 'check 'prepare-test-environment
148 (lambda _
149 (setenv "HOME" "/tmp")
150 ;; NOTE: Any value works, the variable just has to be present.
151 (setenv "SKIP_ONLINE" "1"))))))
152 (native-inputs
153 (list python-pytest-bootstrap
154 python-setuptools-bootstrap))
155 (inputs
156 (list bash-minimal))
157 (home-page "https://github.com/pypa/distlib")
158 (synopsis "Distribution utilities")
159 (description "Distlib is a library which implements low-level functions that
160relate to packaging and distribution of Python software. It is intended to be
161used as the basis for third-party packaging tools.")
162 (license license:psfl)))
163
164(define-public python-more-itertools
165 (package
166 (name "python-more-itertools")
167 (version "10.6.0")
168 (source
169 (origin
170 (method url-fetch)
171 (uri (pypi-uri "more-itertools" version))
172 (sha256
173 (base32
174 "0fzfnfga0jdx217kff57lx3pam76162i0dd0nsgwqccw038zmmrc"))
175 (snippet
176 ;; distutils.errors.DistutilsOptionError: No configuration found for
177 ;; dynamic 'description'. Some dynamic fields need to be specified via
178 ;; `tool.setuptools.dynamic`others must be specified via the equivalent
179 ;; attribute in `setup.py`.
180 '(delete-file "setup.py"))))
181 (build-system pyproject-build-system)
182 (arguments
183 (list
184 #:phases
185 #~(modify-phases %standard-phases
186 (replace 'check
187 (lambda* (#:key tests? #:allow-other-keys)
188 (when tests?
189 (invoke "python" "-m" "unittest")))))))
190 (native-inputs
191 (list python-flit-core))
192 (home-page "https://github.com/erikrose/more-itertools")
193 (synopsis "More routines for operating on iterables, beyond itertools")
194 (description "Python's built-in @code{itertools} module implements a
195number of iterator building blocks inspired by constructs from APL, Haskell,
196and SML. @code{more-itertools} includes additional building blocks for
197working with iterables.")
198 (license license:expat)))
199
200(define-public python-path
201 (package
202 (name "python-path")
203 (version "17.1.0")
204 (source
205 (origin
206 (method url-fetch)
207 (uri (pypi-uri "path" version))
208 (sha256
209 (base32 "1scqbwgcbisx8mb28hw789a7np953851wg6z0bbzdm519znha7nl"))))
210 (build-system pyproject-build-system)
211 (arguments
212 (list
213 #:tests? (not (%current-target-system))
214 #:test-flags
215 #~(list "-k"
216 (string-append
217 ;; Do not test the myproject.toml build as it tries
218 ;; to pull dependencies from the Internet.
219 "not project "
220 ;; This tests assumes a root user exists.
221 "and not test_get_owner"))))
222 (native-inputs
223 (list python-more-itertools
224 python-packaging-bootstrap
225 python-pygments-bootstrap
226 python-pytest-bootstrap
227 python-setuptools-bootstrap
228 python-setuptools-scm-bootstrap))
229 (home-page "https://github.com/jaraco/path")
230 (synopsis "Object-oriented file system path manipulation library")
231 (description "@code{path} (formerly @code{path.py}) implements path
232objects as first-class entities, allowing common operations on files to be
233invoked on those path objects directly.")
234 (license license:expat)))
235
236(define-public python-pathspec
237 (package
238 (name "python-pathspec")
239 (version "1.0.4")
240 (source
241 (origin
242 (method git-fetch)
243 (uri (git-reference
244 (url "https://github.com/cpburnz/python-pathspec")
245 (commit (string-append "v" version))))
246 (file-name (git-file-name name version))
247 (sha256
248 (base32 "1xjli6hl8588ki48s4mgx2nn5whnmikxngpfgjbfw4af92j4x5cr"))))
249 (build-system pyproject-build-system)
250 (arguments (list #:test-backend #~'unittest))
251 (native-inputs
252 (list python-flit-core
253 python-packaging-bootstrap))
254 (home-page "https://github.com/cpburnz/python-pathspec")
255 (synopsis "Utility library for gitignore style pattern matching of file paths")
256 (description
257 "This package provides a utility library for gitignore style pattern
258matching of file paths.")
259 (license license:mpl2.0)))
260
261(define-public python-platformdirs-bootstrap
262 ;; Try to update simultaneously with the standard version in
263 ;; (gnu packages python-build).
264 (package
265 (name "python-platformdirs-bootstrap")
266 (version "4.3.6")
267 (source
268 (origin
269 (method url-fetch)
270 (uri (pypi-uri "platformdirs" version))
271 (sha256
272 (base32 "01xrwajkmxv3jp6n14y8jndkrhb48p9kxknkmwch8nw8pjnb4zrm"))))
273 (build-system pyproject-build-system)
274 (arguments (list #:tests? #f)) ; avoid introducing more dependencies.
275 (native-inputs
276 (list python-hatchling
277 python-hatch-vcs
278 python-pytest-bootstrap))
279 (home-page "https://github.com/platformdirs/platformdirs")
280 (synopsis "Determine the appropriate platform-specific directories")
281 (description "When writing applications, finding the right location to
282store user data and configuration varies per platform. Even for
283single-platform apps, there may by plenty of nuances in figuring out the right
284location. This small Python module determines the appropriate
285platform-specific directories, e.g. the ``user data dir''.")
286 (license license:expat)))
287
288(define-public python-pluggy
289 (package
290 (name "python-pluggy")
291 (version "1.6.0")
292 (source
293 (origin
294 (method git-fetch)
295 (uri (git-reference
296 (url "https://github.com/pytest-dev/pluggy")
297 (commit version)))
298 (file-name (git-file-name name version))
299 (sha256
300 (base32 "01q2cmzdfi8sgyl1indbpl75142csizz9s8cryk2a0cjkcy26i56"))))
301 (build-system pyproject-build-system)
302 (arguments
303 (list #:tests? #f)) ;to break cycle with pytest
304 (native-inputs
305 (list python-setuptools-bootstrap
306 python-setuptools-scm))
307 (home-page "https://pluggy.readthedocs.io/en/latest/")
308 (synopsis "Plugin and hook calling mechanism for Python")
309 (description
310 "Pluggy is an extraction of the plugin manager as used by Pytest but
311stripped of Pytest specific details.")
312 (license license:expat)))
313
314(define-public python-testpath
315 (package
316 (name "python-testpath")
317 (version "0.6.0")
318 (source
319 (origin
320 (method git-fetch)
321 (uri (git-reference
322 (url "https://github.com/jupyter/testpath")
323 (commit version)))
324 (file-name (git-file-name name version))
325 (sha256
326 (base32
327 "0pib1xsvjwwyyhv0sqzxvgg814k83dmv1ppwfkkq9llkhr8k7s9y"))))
328 (build-system pyproject-build-system)
329 (native-inputs
330 (list python-flit-core
331 python-pytest-bootstrap))
332 (home-page "https://github.com/jupyter/testpath")
333 (synopsis "Test utilities for code working with files and commands")
334 (description
335 "Testpath is a collection of utilities for Python code working with files
336and commands. It contains functions to check things on the file system, and
337tools for mocking system commands and recording calls to those.")
338 (license license:expat)))
339
340(define-public python-toml
341 (package
342 (name "python-toml")
343 (version "0.10.2")
344 (source
345 (origin
346 (method url-fetch)
347 (uri (pypi-uri "toml" version))
348 (sha256
349 (base32 "13z6rff86bzdpl094x0vmfvls779931xj90dlbs9kpfm138s3gdk"))))
350 (build-system pyproject-build-system)
351 (arguments
352 `(#:tests? #f)) ;no tests suite in release
353 (native-inputs
354 (list python-setuptools-bootstrap))
355 (home-page "https://github.com/uiri/toml")
356 (synopsis "Library for TOML")
357 (description
358 "@code{toml} is a library for parsing and creating Tom's Obvious, Minimal
359Language (TOML) configuration files.")
360 (license license:expat)))
361
362(define-public python-tomli-w
363 (package
364 (name "python-tomli-w")
365 (version "1.2.0")
366 (source
367 (origin
368 (method url-fetch)
369 (uri (pypi-uri "tomli_w" version))
370 (sha256
371 (base32 "08ahw9db7qycd4fzh4j51cgzp1rdl7snm5scrplpphj7ban4zl9d"))))
372 (build-system pyproject-build-system)
373 (arguments (list #:tests? #f)) ;to avoid extra dependencies
374 (native-inputs (list python-flit-core))
375 (home-page "https://github.com/hukkin/tomli-w")
376 (synopsis "Minimal TOML writer")
377 (description "Tomli-W is a Python library for writing TOML. It is a
378write-only counterpart to Tomli, which is a read-only TOML parser.")
379 (license license:expat)))
380
381(define-public python-pygments
382 (package
383 (name "python-pygments")
384 (version "2.19.2")
385 (source
386 (origin
387 (method url-fetch)
388 (uri (pypi-uri "pygments" version))
389 (sha256
390 (base32
391 "11xqsnnh0iip4vh2lfbh5xa46dy47d9vqw39ad98jzzcgi3v4v33"))))
392 (build-system pyproject-build-system)
393 (arguments
394 (list
395 ;; tests: 4570 passed, 16 skipped, 597 deselected
396 #:test-flags
397 ;; Ignore tests requiring "wcag_contrast_ratio"
398 #~(list "--ignore=tests/contrast/test_contrasts.py"
399 ;; Tests fail with not matched diff.
400 "--ignore=tests/examplefiles/awk/test.awk"
401 "--ignore=tests/examplefiles/bash/example.sh"
402 "--ignore=tests/examplefiles/make/Makefile"
403 "--ignore=tests/examplefiles/phix/example.exw"
404 "--ignore=tests/examplefiles/sed/all_sorts_of_syntax.sed"
405 "--ignore=tests/examplefiles/sed/count_words.sed"
406 "--ignore=tests/examplefiles/sed/increment_number.sed"
407 "--ignore=tests/examplefiles/sed/reverse.sed"
408 "--ignore=tests/examplefiles/slurm/example.sl"
409 ;; Assertion error to find example file by following symlink:
410 ;; assert p.is_file(), f"Example file {p} not found"
411 "--deselect=tests/test_basic_api.py::test_lexer_classes")))
412 (native-inputs
413 (list python-hatchling python-pytest-bootstrap))
414 (home-page "https://pygments.org/")
415 (synopsis "Syntax highlighting")
416 (description
417 "Pygments is a syntax highlighting package written in Python.")
418 (license license:bsd-2)))
419
420(define-public python-pygments-bootstrap
421 (package/inherit python-pygments
422 (name "python-pygments-bootstrap")
423 (native-inputs
424 (list python-hatchling))
425 (arguments `(#:tests? #f))))
426
427(define-public python-pytest-bootstrap
428 (package
429 (name "python-pytest-bootstrap")
430 (version "9.0.2")
431 (source
432 (origin
433 (method url-fetch)
434 (uri (pypi-uri "pytest" version))
435 (sha256
436 (base32 "04fz1vbhb2l6k8lmrk8wqhkxhprlnkq21z6rs48rdn1bm58nc63m"))))
437 (build-system pyproject-build-system)
438 (arguments (list #:tests? #f))
439 (native-inputs
440 (list python-setuptools-bootstrap
441 python-setuptools-scm-bootstrap))
442 (propagated-inputs
443 (list python-iniconfig
444 python-packaging-bootstrap
445 python-pluggy
446 python-pygments-bootstrap)) ;it is in installation dependencies
447 (home-page "https://docs.pytest.org/en/latest/")
448 (synopsis "Python testing library")
449 (description
450 "Pytest is a testing tool that provides auto-discovery of test modules
451and functions, detailed info on failing assert statements, modular fixtures,
452and many external plugins.")
453 (license license:expat)))
454
455(define-public python-pytoml
456 (package
457 (name "python-pytoml")
458 (version "0.1.21")
459 (source
460 (origin
461 (method url-fetch)
462 (uri (pypi-uri "pytoml" version))
463 (sha256
464 (base32 "1rv1byiw82k7mj6aprcrqi2vdabs801y97xhfnrz7kxds34ggv4f"))))
465 (build-system pyproject-build-system)
466 (arguments `(#:tests? #f)) ;to avoid pytest dependency
467 (native-inputs
468 (list python-setuptools))
469 (home-page "https://github.com/avakar/pytoml")
470 (synopsis "Parser for TOML")
471 (description "This package provides a Python parser for TOML-0.4.0.")
472 (license license:expat)))
473
474(define-public python-tomli
475 (package
476 (name "python-tomli")
477 (version "2.2.1")
478 (source
479 (origin
480 (method url-fetch)
481 (uri (pypi-uri "tomli" version))
482 (sha256
483 (base32 "1zq58p2bplyf0xpi9fnyn4w6vc1fkw8whkj0yxhcwdf8g7ff2ifd"))))
484 (build-system pyproject-build-system)
485 (arguments
486 `(#:tests? #f)) ;disabled to avoid extra dependencies
487 (native-inputs (list python-flit-core-bootstrap))
488 (home-page "https://github.com/hukkin/tomli")
489 (synopsis "Small and fast TOML parser")
490 (description "Tomli is a minimal TOML parser that is fully compatible with
491@url{https://toml.io/en/v1.0.0,TOML v1.0.0}. It is about 2.4 times as fast as
492@code{python-toml}.")
493 (license license:expat)))
494
495(define-public python-trove-classifiers
496 (package
497 (name "python-trove-classifiers")
498 (version "2025.5.9.12")
499 (source
500 (origin
501 (method url-fetch)
502 (uri (pypi-uri "trove_classifiers" version))
503 (sha256
504 (base32 "1dawkrcc353rz1h4mazw25vkbhics5lpqrwc8qad6b3flykwi9vw"))))
505 (build-system pyproject-build-system)
506 (arguments
507 (list #:build-backend "setuptools.build_meta"
508 #:tests? #f)) ;keep dependencies to a minimum
509 (native-inputs (list python-setuptools-bootstrap))
510 (home-page "https://github.com/pypa/trove-classifiers")
511 (synopsis "Canonical source for classifiers on PyPI")
512 (description "This package is the canonical source for classifiers use on
513PyPI (pypi.org).")
514 (license license:asl2.0)))
515
516(define-public python-typeguard
517 (package
518 (name "python-typeguard")
519 (version "4.4.4")
520 (source
521 (origin
522 (method url-fetch)
523 (uri (pypi-uri "typeguard" version))
524 (sha256
525 (base32 "0x2zkskia5lb1838ys0bhpp9v6y80jkhchzdz874spbhzggx4zrs"))))
526 (build-system pyproject-build-system)
527 (arguments
528 (list
529 #:test-flags #~(list "--ignore-glob=tests/mypy/*.py")))
530 (native-inputs
531 (list python-pytest-bootstrap
532 python-setuptools-bootstrap
533 python-setuptools-scm-bootstrap))
534 (propagated-inputs
535 (list python-typing-extensions))
536 (home-page "https://github.com/agronholm/typeguard")
537 (synopsis "Run-time type checker for Python")
538 (description
539 "@code{typeguard} provides run-time type checking for functions defined
540with PEP 484 argument (and return) type annotations.")
541 (license license:expat)))
542
543(define-public python-typing-extensions
544 (package
545 (name "python-typing-extensions")
546 (version "4.15.0")
547 (source
548 (origin
549 (method url-fetch)
550 (uri (pypi-uri "typing_extensions" version))
551 (sha256
552 (base32 "0rhlhs28jndgp9fghdhidn6g7xiwx8vvihxbxhlgl4ncfg8lishc"))))
553 (build-system pyproject-build-system)
554 ;; Disable the test suite to keep the dependencies to a minimum. Also,
555 ;; the test suite requires Python's test module, not available in Guix.
556 (arguments (list #:tests? #f))
557 (native-inputs (list python-flit-core))
558 (home-page "https://github.com/python/typing_extensions")
559 (synopsis "Experimental type hints for Python")
560 (description
561 "The typing_extensions module contains additional @code{typing} hints not
562yet present in the of the @code{typing} standard library.
563Included are implementations of:
564@enumerate
565@item ClassVar
566@item ContextManager
567@item Counter
568@item DefaultDict
569@item Deque
570@item NewType
571@item NoReturn
572@item overload
573@item Protocol
574@item runtime
575@item Text
576@item Type
577@item TYPE_CHECKING
578@item AsyncGenerator
579@end enumerate\n")
580 (license license:psfl)))
581
582
583;;;
584;;; Python builder packages.
585;;;
586(define-public python-pbr
587 (package
588 (name "python-pbr")
589 (version "7.0.1")
590 (source
591 (origin
592 (method url-fetch)
593 (uri (pypi-uri "pbr" version))
594 (sha256
595 (base32 "0mvy1z1dyl28w0brns1vdhc98hzbn5b3fsw1xj41amdqs88wpjry"))))
596 (build-system pyproject-build-system)
597 (arguments
598 `(#:tests? #f)) ;; Most tests seem to use the Internet.
599 ;; Message from upstream:
600 ;;
601 ;; DO NOT add any other dependencies as PBR is meant to be minimalist to
602 ;; avoid problems with bootstrapping build environments.
603 ;;
604 ;; See: <https://opendev.org/openstack/pbr/src/tag/7.0.1/requirements.txt>.
605 (propagated-inputs
606 (list python-setuptools))
607 (home-page "https://docs.openstack.org/pbr/latest/")
608 (synopsis "Enhance the default behavior of Python’s setuptools")
609 (description
610 "Python Build Reasonableness (PBR) is a library that injects some useful
611and sensible default behaviors into your setuptools run. It will set
612versions, process requirements files and generate AUTHORS and ChangeLog file
613from git information.")
614 (license license:asl2.0)))
615
616(define-public python-pip
617 (package
618 (name "python-pip")
619 (version "25.1.1")
620 (source
621 (origin
622 (method url-fetch)
623 (uri (pypi-uri "pip" version))
624 (sha256
625 (base32
626 "0xwhrng91a48zb5qmb6vagbjr6kzvbc8b08nq9a5139h3m0mvr1x"))
627 (snippet
628 #~(begin
629 (delete-file "src/pip/_vendor/certifi/cacert.pem")
630 (delete-file "src/pip/_vendor/certifi/core.py")
631 (with-output-to-file "src/pip/_vendor/certifi/core.py"
632 (lambda _
633 (display "\"\"\"
634certifi.py
635~~~~~~~~~~
636This file is a Guix-specific version of core.py.
637
638This module returns the installation location of SSL_CERT_FILE or
639/etc/ssl/certs/ca-certificates.crt, or its contents.
640\"\"\"
641import os
642
643_CA_CERTS = None
644
645try:
646 _CA_CERTS = os.environ [\"SSL_CERT_FILE\"]
647except:
648 _CA_CERTS = os.path.join(\"/etc\", \"ssl\", \"certs\", \"ca-certificates.crt\")
649
650def where() -> str:
651 return _CA_CERTS
652
653def contents() -> str:
654 with open(where(), \"r\", encoding=\"ascii\") as data:
655 return data.read()")))))))
656 (build-system pyproject-build-system)
657 (arguments
658 '(#:tests? #f)) ; there are no tests in the pypi archive.
659 (native-inputs
660 (list python-setuptools-bootstrap))
661 (home-page "https://pip.pypa.io/")
662 (synopsis "Package manager for Python software")
663 (description
664 "Pip is a package manager for Python software, that finds packages on the
665Python Package Index (PyPI).")
666 (license license:expat)))
667
668(define-public python-setuptools
669 (package
670 (name "python-setuptools")
671 ;; When updating python-setuptools, also check in the bundled sources
672 ;; the versions of some native-inputs if some new tests fail.
673 (version "80.9.0")
674 (source
675 (origin
676 (method url-fetch)
677 (uri (pypi-uri "setuptools" version))
678 (sha256
679 (base32 "175iixi2h2jz8y2bpwziak360hvv43jfhipwzbdniryd5r04fszk"))
680 (modules '((guix build utils)))
681 (snippet
682 #~(begin
683 ;; Remove included binaries which are used to build self-extracting
684 ;; installers for Windows.
685 (for-each delete-file (find-files "setuptools"
686 "^(cli|gui).*\\.exe$"))))))
687 (build-system pyproject-build-system)
688 (arguments
689 (list
690 #:test-flags
691 #~(list
692 ;; Avoid additional dependencies
693 "--ignore=setuptools/tests/config/test_apply_pyprojecttoml.py"
694 "--ignore=setuptools/tests/config/test_pyprojecttoml.py"
695 "--ignore=setuptools/tests/test_namespaces.py" ;nss-certs-for-test
696 "--ignore=tools"
697 ;; These tests try to access the network.
698 "-m" "not uses_network"
699 "-k" (string-join
700 (list "not test_dist_fetch_build_egg" ; network
701 ;; Those scripts are unbundled in the snippet above.
702 "test_wheel_includes_cli_scripts"
703 ;; Despite PRE_BUILT_SETUPTOOLS_WHEEL below,
704 ;; this test uses our unbundled setuptools and fails
705 ;; to find jaraco.functools.
706 "test_no_missing_dependencies"
707 ;; XXX: We have pytest in the path, probably
708 ;; because of the setenv "PYTHONPATH" below.
709 "test_ignore_errors"
710 ;; XXX: Unclear why this one fails.
711 "test_basic")
712 " and not "))
713 #:phases
714 #~(modify-phases %standard-phases
715 ;; Build a first wheel bundled for tests.
716 (add-before 'build 'build-bundled-wheel-for-tests
717 (assoc-ref %standard-phases 'build))
718 (add-after 'build-bundled-wheel-for-tests 'cleanup
719 (lambda _
720 (let ((wheel (string-append "setuptools-" #$version
721 "-py3-none-any.whl")))
722 (for-each
723 (lambda (file)
724 (rename-file file wheel))
725 (find-files "dist" "\\.whl$")))
726 (for-each delete-file-recursively
727 '("build" "dist" "setuptools/_vendor")))) ; unbundle
728 (add-before 'check 'configure-tests
729 (lambda* (#:key outputs #:allow-other-keys)
730 (setenv "HOME" (getcwd))
731 ;; FIXME python-pytest still relies a bit on PYTHONPATH.
732 (setenv "PYTHONPATH" (getenv "GUIX_PYTHONPATH"))
733 ;; Inject our pre-built bundled wheel for tests.
734 (setenv "PRE_BUILT_SETUPTOOLS_WHEEL"
735 (string-append (getcwd) "/setuptools-"
736 #$version "-py3-none-any.whl"))))
737 ;; Platformdirs is a bit tedious to properly bootstrap and
738 ;; propagate, and is used in a single place that will be dropped
739 ;; soon, we might as well drop it now.
740 (add-before 'compile-bytecode 'drop-platformdirs-requirement
741 (lambda* (#:key inputs outputs #:allow-other-keys)
742 (with-directory-excursion (site-packages inputs outputs)
743 (substitute* "pkg_resources/__init__.py"
744 (("^from platformdirs import.*")
745 "")
746 (("_user_cache_dir\\(appname='Python-Eggs'\\)")
747 "f\"{os.environ.get('XDG_CACHE_HOME')}/Python-Eggs\""))
748 (substitute* (string-append "setuptools-" #$version
749 ".dist-info/METADATA")
750 (("Requires-Dist: platformdirs.*") "")))))
751 (add-after 'check 'cleanup-installed-tests
752 (lambda* (#:key inputs outputs #:allow-other-keys)
753 (let ((site (site-packages inputs outputs)))
754 (with-directory-excursion site
755 (for-each
756 delete-file-recursively
757 (find-files "."
758 (lambda (file stat)
759 (and (string= (basename file) "tests")
760 (eq? 'directory
761 (stat:type stat))))
762 #:directories? #t)))
763 (substitute* (find-files site "RECORD")
764 ((".*/tests/.*") ""))))))))
765 (propagated-inputs
766 ;; See either bundled inputs or METADATA extra == "core"
767 (list python-jaraco-functools
768 python-jaraco-text
769 python-more-itertools
770 python-packaging
771 python-wheel))
772 (native-inputs
773 (list python-autocommand
774 python-backports-tarfile
775 python-filelock-bootstrap
776 python-inflect
777 python-jaraco-collections
778 python-jaraco-context
779 python-jaraco-envs-bootstrap
780 python-jaraco-functools
781 python-jaraco-path
782 python-jaraco-test
783 python-jaraco-text
784 python-more-itertools
785 python-packaging
786 python-path
787 python-platformdirs-bootstrap
788 python-pip
789 python-pypa-build
790 python-pytest-bootstrap
791 python-tomli
792 python-typing-extensions
793 python-typeguard
794 python-wheel))
795 (home-page "https://pypi.org/project/setuptools/")
796 (synopsis "Library designed to facilitate packaging Python projects")
797 (description "Setuptools is a fully-featured, stable library designed to
798facilitate packaging Python projects, where packaging includes:
799@itemize
800@item Python package and module definitions
801@item distribution package metadata
802@item test hooks
803@item project installation
804@item platform-specific details.
805@end itemize")
806 (license (list license:psfl ;setuptools itself
807 license:expat ;six, appdirs, pyparsing
808 license:asl2.0 ;packaging is dual ASL2/BSD-2
809 license:bsd-2))))
810
811(define-public python-setuptools-bootstrap
812 (package/inherit python-setuptools
813 (name "python-setuptools-bootstrap")
814 ;; version and source are purposefully not inherited, to allow
815 ;; updating python-setuptools in the python-team scope, whereas
816 ;; python-setuptools-bootstrap is in the core-packages-team scope.
817 (version "80.9.0")
818 (source
819 (origin
820 (method url-fetch)
821 (uri (pypi-uri "setuptools" version))
822 (sha256
823 (base32 "175iixi2h2jz8y2bpwziak360hvv43jfhipwzbdniryd5r04fszk"))
824 (modules '((guix build utils)))
825 (snippet
826 ;; TODO: setuptools now bundles the following libraries:
827 ;; packaging, pyparsing, six and appdirs. How to unbundle?
828 ;; Remove included binaries which are used to build self-extracting
829 ;; installers for Windows.
830 '(for-each delete-file (find-files "setuptools"
831 "^(cli|gui).*\\.exe$")))))
832 (build-system gnu-build-system)
833 (arguments
834 (list
835 #:tests? #f ;disabled to avoid extra dependencies
836 ;; Custom build steps to prevent using pyproject-build-system which
837 ;; allows to edit the latter without a world rebuild (for the meson
838 ;; package in particular).
839 #:phases
840 #~(modify-phases %standard-phases
841 (delete 'bootstrap)
842 (delete 'configure)
843 (replace 'build
844 (lambda _
845 (invoke "python" "./setup.py" "build")))
846 (replace 'install
847 (lambda _
848 (invoke "python" "./setup.py" "install"
849 (string-append "--prefix=" #$output) "--no-compile")
850 (invoke "python" "-m" "compileall"
851 "--invalidation-mode=unchecked-hash" #$output)))
852 ;; XXX: Despite using the same setup.py, it seems that the
853 ;; bootstrap version is not able to install the distutils hack.
854 (add-after 'install 'fix-installation
855 (lambda* (#:key outputs #:allow-other-keys)
856 (with-directory-excursion
857 (car (find-files #$output "site-packages"
858 #:directories? #t))
859 (call-with-output-file "distutils-precedence.pth"
860 (lambda (port)
861 (display
862 (string-join
863 '("import os"
864 "var = 'SETUPTOOLS_USE_DISTUTILS'"
865 "enabled = os.environ.get(var, 'local') == 'local'"
866 "enabled and __import__('_distutils_hack').add_shim();")
867 "; ")
868 port)))))))))
869 (native-inputs (list))
870 ;; Avoid introducing an additional module-dependency.
871 (inputs (list (module-ref (resolve-interface '(gnu packages python))
872 'python-wrapper)))
873 (propagated-inputs (list))))
874
875(define-public python-wheel
876 (package
877 (name "python-wheel")
878 (version "0.46.1")
879 (source
880 (origin
881 (method url-fetch)
882 (uri (pypi-uri "wheel" version))
883 (sha256
884 (base32 "0f3abrpkf3spv0lk5mhv8m2ch0j074a3rivn7hfxzxx0bpxpwizx"))))
885 (build-system pyproject-build-system)
886 (arguments
887 ;; FIXME: The test suite runs "python setup.py bdist_wheel", which in turn
888 ;; fails to find the newly-built bdist_wheel library, even though it is
889 ;; available on PYTHONPATH. What search path is consulted by setup.py?
890 '(#:tests? #f))
891 (native-inputs
892 (list python-flit-core))
893 (home-page "https://github.com/pypa/wheel")
894 (synopsis "Format for built Python packages")
895 (description
896 "A wheel is a ZIP-format archive with a specially formatted filename and
897the @code{.whl} extension. It is designed to contain all the files for a PEP
898376 compatible install in a way that is very close to the on-disk format. Many
899packages will be properly installed with only the @code{Unpack} step and the
900unpacked archive preserves enough information to @code{Spread} (copy data and
901scripts to their final locations) at any later time. Wheel files can be
902installed with a newer @code{pip} or with wheel's own command line utility.")
903 (license license:expat)))
904
905(define-public python-wheel-0.40
906 (package
907 (inherit python-wheel)
908 (version "0.40.0")
909 (source
910 (origin
911 (method url-fetch)
912 (uri (pypi-uri "wheel" version))
913 (sha256
914 (base32 "0ww8fgkvwv35ypj4cnngczdwp6agr4qifvk2inb32azfzbrrc4fd"))))))
915
916(define-public python-pyparsing
917 (package
918 (name "python-pyparsing")
919 (version "3.2.3")
920 (source
921 (origin
922 (method url-fetch)
923 (uri (pypi-uri "pyparsing" version))
924 (sha256
925 (base32 "1giqgjknzbbh34qf8ij5rsrqlxfysjx39xi85vvl5ddkp0d3zhdr"))))
926 (build-system pyproject-build-system)
927 (outputs '("out" "doc"))
928 (arguments
929 `(#:tests? #f ;no test target
930 #:phases
931 (modify-phases %standard-phases
932 (add-after 'install 'install-doc
933 (lambda* (#:key outputs #:allow-other-keys)
934 (let* ((doc (string-append (assoc-ref outputs "doc")
935 "/share/doc/" ,name "-" ,version))
936 (html-doc (string-append doc "/html"))
937 (examples (string-append doc "/examples")))
938 (mkdir-p html-doc)
939 (mkdir-p examples)
940 (for-each
941 (lambda (dir tgt)
942 (map (lambda (file)
943 (install-file file tgt))
944 (find-files dir ".*")))
945 (list "docs" "htmldoc" "examples")
946 (list doc html-doc examples))))))))
947 (native-inputs (list python-flit-core))
948 (home-page "https://github.com/pyparsing/pyparsing")
949 (synopsis "Python parsing class library")
950 (description
951 "The pyparsing module is an alternative approach to creating and
952executing simple grammars, vs. the traditional lex/yacc approach, or the use
953of regular expressions. The pyparsing module provides a library of classes
954that client code uses to construct the grammar directly in Python code.")
955 (license license:expat)))
956
957(define-public python-packaging
958 (package
959 (name "python-packaging")
960 (version "25.0")
961 (source
962 (origin
963 (method url-fetch)
964 (uri (pypi-uri "packaging" version))
965 (sha256
966 (base32 "0kzwn2ar4ndm90qrvgyjcbkqz3klrg0ziwm1yrhbyxynk0n8fhyl"))))
967 (build-system pyproject-build-system)
968 (native-inputs
969 (list python-flit-core
970 python-pretend
971 python-pytest-bootstrap))
972 (propagated-inputs (list python-pyparsing python-six))
973 (home-page "https://github.com/pypa/packaging")
974 (synopsis "Core utilities for Python packages")
975 (description "Packaging is a Python module for dealing with Python packages.
976 It offers an interface for working with package versions, names, and dependency
977 information.")
978 ;; From 'LICENSE': This software is made available under the terms of
979 ;; *either* of the licenses found in LICENSE.APACHE or LICENSE.BSD.
980 ;; Contributions to this software is made under the terms of *both* these
981 ;; licenses.
982 (license (list license:asl2.0 license:bsd-2))))
983
984(define-public python-packaging-bootstrap
985 (package/inherit python-packaging
986 (name "python-packaging-bootstrap")
987 (arguments
988 ;; XXX: disabled to avoid extra dependencies
989 (list
990 #:tests? #f))
991 (native-inputs (list python-flit-core))
992 (propagated-inputs '())))
993
994(define-public python-pretend
995 (package
996 (name "python-pretend")
997 (version "1.0.9")
998 (source
999 (origin
1000 (method git-fetch) ;no tests in PyPI archive
1001 (uri (git-reference
1002 (url "https://github.com/alex/pretend")
1003 (commit (string-append "v" version))))
1004 (file-name (git-file-name name version))
1005 (sha256
1006 (base32 "156l685r9mg7i4xyrk9ql3sxk088irxlg8x7md5i0d05hdw1z8rs"))))
1007 (build-system pyproject-build-system)
1008 (native-inputs
1009 (list python-packaging-bootstrap
1010 python-pytest-bootstrap
1011 python-setuptools-bootstrap))
1012 (home-page "https://github.com/alex/pretend")
1013 (synopsis "Library for stubbing in Python")
1014 (description
1015 "Pretend is a library to make stubbing with Python easier. Stubbing is a
1016technique for writing tests. You may hear the term mixed up with mocks,fakes,
1017or doubles. Basically, a stub is an object that returns pre-canned responses,
1018rather than doing any computation.")
1019 (license license:bsd-3)))
1020
1021(define-public python-pyproject-hooks
1022 (package
1023 (name "python-pyproject-hooks")
1024 (version "1.2.0")
1025 (source
1026 (origin
1027 (method url-fetch)
1028 (uri (pypi-uri "pyproject_hooks" version))
1029 (sha256
1030 (base32 "1y511nblr0lslz1d5s46844f5raryjnp3n1dci499bhgqkarp18y"))))
1031 (build-system pyproject-build-system)
1032 (native-inputs
1033 (list python-flit-core
1034 python-pytest-bootstrap
1035 python-testpath))
1036 (home-page "https://github.com/pypa/pyproject-hooks")
1037 (synopsis "Low-level library for calling @file{pyproject.toml} backends")
1038 (description
1039 "@code{pyproject-hooks} is a low-level library for calling build backends
1040in @file{pyproject.toml}-based projects. It provides basic functionality to
1041write tooling that generates distribution files from Python projects.")
1042 (license license:expat)))
1043
1044;;; The name 'python-pypa-build' is chosen rather than 'python-build' to avoid
1045;;; a name clash with python-build from (guix build-system python).
1046(define-public python-pypa-build
1047 (package
1048 (name "python-pypa-build")
1049 ;; Newer version needs more inputs, consider to move to python-xyz.
1050 (version "1.3.0")
1051 (source
1052 (origin
1053 (method url-fetch)
1054 (uri (pypi-uri "build" version))
1055 (sha256
1056 (base32 "15xk0w71x8v1c8by049rdwh74mhkl3rj3v9sym8fkgbhl87dv3k9"))))
1057 (build-system pyproject-build-system)
1058 (arguments `(#:tests? #f)) ;disabled to avoid extra dependencies
1059 (native-inputs
1060 (list python-flit-core))
1061 (propagated-inputs
1062 (list python-colorama
1063 python-packaging
1064 python-pyproject-hooks
1065 python-tomli))
1066 (home-page "https://pypa-build.readthedocs.io/en/latest/")
1067 (synopsis "Simple Python PEP 517 package builder")
1068 (description "The @command{build} command invokes the PEP 517 hooks to
1069build a distribution package. It is a simple build tool and does not perform
1070any dependency management. It aims to keep dependencies to a minimum, in
1071order to make bootstrapping easier.")
1072 (license license:expat)))
1073
1074(define-public python-poetry-core
1075 (package
1076 (name "python-poetry-core")
1077 (version "2.3.2")
1078 (source
1079 (origin
1080 (method git-fetch)
1081 (uri (git-reference
1082 (url "https://github.com/python-poetry/poetry-core")
1083 (commit version)))
1084 (file-name (git-file-name name version))
1085 (sha256
1086 (base32 "07n64i2wal2d6ca74vkl7x8wsks6bi0njii8pv8rmfragc48kzj6"))))
1087 (build-system pyproject-build-system)
1088 (arguments
1089 (list #:tests? #f)) ;disabled to avoid extra dependencies
1090 (home-page "https://github.com/python-poetry/poetry-core")
1091 (synopsis "Poetry PEP 517 build back-end")
1092 (description
1093 "The @code{poetry-core} module provides a PEP 517 build back-end
1094implementation developed for Poetry. This project is intended to be
1095a light weight, fully compliant, self-contained package allowing PEP 517
1096compatible build front-ends to build Poetry managed projects.")
1097 (license license:expat)))
1098
1099(define-public python-filelock-bootstrap
1100 ;; Try to update simultaneously with the standard version in
1101 ;; (gnu packages python-build).
1102 (package
1103 (name "python-filelock-bootstrap")
1104 (version "3.16.1")
1105 (source
1106 (origin
1107 (method url-fetch)
1108 (uri (pypi-uri "filelock" version))
1109 (sha256
1110 (base32
1111 "0d8ljvmsfgriiqf5dqii91gfcpj7cpjrh8fnsvifaiyvspygnjf2"))))
1112 (build-system pyproject-build-system)
1113 (arguments (list #:tests? #f)) ; avoid extra dependencies.
1114 (native-inputs
1115 (list python-hatch-vcs-bootstrap
1116 python-hatchling
1117 python-setuptools-scm-bootstrap))
1118 (home-page "https://github.com/tox-dev/py-filelock")
1119 (synopsis "Platform independent file lock")
1120 (description "@code{filelock} contains a single module implementing
1121a platform independent file lock in Python, which provides a simple way of
1122inter-process communication.")
1123 (license license:unlicense)))
1124
1125;;; This package exists to bootstrap python-tomli.
1126(define-public python-flit-core-bootstrap
1127 (package
1128 (name "python-flit-core-bootstrap")
1129 (version "3.12.0")
1130 (source
1131 (origin
1132 (method url-fetch)
1133 (uri (pypi-uri "flit" version))
1134 (sha256
1135 (base32 "0h1pxi2hgr95321bgl45l86693zl14l3shj0idsyg4k9v56z700w"))))
1136 (build-system pyproject-build-system)
1137 (arguments
1138 (list
1139 ;; flit-core has a test suite, but it requires Pytest. Disable it so
1140 ;; as to not pull pytest as an input.
1141 #:tests? #f
1142 #:phases
1143 #~(modify-phases %standard-phases
1144 (add-after 'unpack 'fix-license
1145 ;; flit_core bundles the 'tomli' TOML parser, to avoid a
1146 ;; bootstrapping problem. See
1147 ;; <https://github.com/pypa/packaging-problems/issues/342>.
1148 (lambda _
1149 (delete-file-recursively "flit_core/flit_core/vendor")
1150 (substitute* "flit_core/pyproject.toml"
1151 (("license-files.*") "license-files = [\"LICENSE*\"]\n"))))
1152 (replace 'build
1153 ;; flit-core requires itself to build. Luckily, a
1154 ;; bootstrapping script exists, which does so using just
1155 ;; the checkout sources and Python.
1156 (lambda _
1157 (chdir "flit_core")
1158 (invoke "python" "build_dists.py")))
1159 (delete 'sanity-check))))
1160 (propagated-inputs
1161 (list python-toml))
1162 (home-page "https://github.com/pypa/flit")
1163 (synopsis "Core package of the Flit Python build system")
1164 (description "This package provides @code{flit-core}, a PEP 517 build
1165backend for packages using Flit. The only public interface is the API
1166specified by PEP 517, @code{flit_core.buildapi}.")
1167 (license license:bsd-3)))
1168
1169(define-public python-flit-core
1170 (package/inherit python-flit-core-bootstrap
1171 (name "python-flit-core")
1172 (propagated-inputs
1173 (modify-inputs propagated-inputs
1174 (delete "python-toml")
1175 (prepend python-tomli)))))
1176
1177(define-public python-setuptools-scm
1178 (package
1179 (name "python-setuptools-scm")
1180 (version "8.3.1")
1181 (source
1182 (origin
1183 (method url-fetch)
1184 (uri (pypi-uri "setuptools_scm" version))
1185 (sha256
1186 (base32 "0qra4jysbdwlrwsb5iz8kai1xxbsz6adzbrbscvx1b2xny95wm9x"))))
1187 (build-system pyproject-build-system)
1188 (arguments
1189 (list
1190 #:tests? #f ;avoid extra dependencies such as pytest
1191 ;; pyproject-build-system will error handle forms such as
1192 ;; "module:object", so we set it.
1193 #:build-backend "setuptools.build_meta"))
1194 (propagated-inputs
1195 (list python-packaging-bootstrap
1196 python-setuptools-bootstrap))
1197 (home-page "https://github.com/pypa/setuptools_scm/")
1198 (synopsis "Manage Python package versions in SCM metadata")
1199 (description
1200 "Setuptools_scm handles managing your Python package versions in
1201@dfn{software configuration management} (SCM) metadata instead of declaring
1202them as the version argument or in a SCM managed file.")
1203 (license license:expat)))
1204
1205(define-public python-setuptools-scm-bootstrap
1206 (package/inherit python-setuptools-scm
1207 (name "python-setuptools-scm-bootstrap")
1208 (build-system pyproject-build-system)
1209 (arguments
1210 (list
1211 #:tests? #f ;avoid extra dependencies such as pytest
1212 ;; pyproject-build-system will error handle forms such as
1213 ;; "module:object", so we set it.
1214 #:build-backend "setuptools.build_meta"))
1215 (native-inputs
1216 (list python-packaging-bootstrap))
1217 (propagated-inputs
1218 (list python-setuptools-bootstrap))))
1219
1220(define-public python-setuptools-scm-next
1221 (package
1222 (inherit python-setuptools-scm)
1223 (name "python-setuptools-scm")
1224 (version "9.2.2")
1225 (source
1226 (origin
1227 (method url-fetch)
1228 (uri (pypi-uri "setuptools_scm" version))
1229 (sha256
1230 (base32 "0mzgyyg1cgigkmlfm0iy44f2092zn8xc093ygn4a11jncss4lrqw"))))))
1231
1232(define-public python-six
1233 (package
1234 (name "python-six")
1235 (version "1.17.0")
1236 (source
1237 (origin
1238 (method url-fetch)
1239 (uri (pypi-uri "six" version))
1240 (sha256
1241 (base32 "109ajcsfhrz33lbwbb337w34crc3lb9rjnxrcpnbczlf8rfk6w7z"))))
1242 (build-system pyproject-build-system)
1243 (native-inputs
1244 (list python-pytest-bootstrap
1245 python-setuptools-bootstrap))
1246 (home-page "https://pypi.org/project/six/")
1247 (synopsis "Python 2 and 3 compatibility utilities")
1248 (description
1249 "Six is a Python 2 and 3 compatibility library. It provides utility
1250functions for smoothing over the differences between the Python versions with
1251the goal of writing Python code that is compatible on both Python versions.
1252Six supports every Python version since 2.5. It is contained in only one
1253Python file, so it can be easily copied into your project.")
1254 (license license:x11)))
1255
1256;; XXX: Deprecated on <2026-01-23>.
1257(define-deprecated/public-alias python-six-bootstrap python-six)
1258
1259(define-public python-editables
1260 (package
1261 (name "python-editables")
1262 (version "0.5")
1263 (source (origin
1264 (method git-fetch)
1265 (uri (git-reference
1266 (url "https://github.com/pfmoore/editables")
1267 (commit version)))
1268 (file-name (git-file-name name version))
1269 (sha256
1270 (base32
1271 "1bp959fz987jvrnkilhyr41fw4g00g9jfyiwmfvy96hv1yl68w8b"))))
1272 (build-system pyproject-build-system)
1273 (arguments (list #:tests? #f)) ;avoid extra dependencies such as pytest
1274 (native-inputs
1275 (list python-flit-core))
1276 (home-page "https://github.com/pfmoore/editables")
1277 (synopsis "Editable installations")
1278 (description "This library supports the building of wheels which, when
1279installed, will expose packages in a local directory on @code{sys.path} in
1280``editable mode''. In other words, changes to the package source will be
1281reflected in the package visible to Python, without needing a reinstall.")
1282 (license license:expat)))
1283
1284(define-public python-hatchling
1285 (package
1286 (name "python-hatchling")
1287 (version "1.27.0")
1288 (source
1289 (origin
1290 (method url-fetch)
1291 (uri (pypi-uri "hatchling" version))
1292 (sha256
1293 (base32 "1mhzjhg7ky8npcrnbwwq30w8s73mm73m5z0j260v7aqrk1njj74p"))))
1294 (build-system pyproject-build-system)
1295 (arguments
1296 (list #:tests? #f)) ;to keep dependencies to a minimum
1297 (propagated-inputs
1298 (list python-packaging-bootstrap
1299 python-pathspec
1300 python-pluggy
1301 python-tomli
1302 python-trove-classifiers))
1303 (home-page "https://hatch.pypa.io/latest/")
1304 (synopsis "Modern, extensible Python build backend")
1305 (description "Hatch is a modern, extensible Python project manager. It
1306has features such as:
1307@itemize
1308@item Standardized build system with reproducible builds by default
1309@item Robust environment management with support for custom scripts
1310@item Easy publishing to PyPI or other indexes
1311@item Version management
1312@item Configurable project generation with sane defaults
1313@item Responsive CLI, ~2-3x faster than equivalent tools.
1314@end itemize")
1315 (license license:expat)))
1316
1317(define-public python-hatchling-bootstrap
1318 (package/inherit python-hatchling
1319 (name "python-hatchling-bootstrap")
1320 (propagated-inputs
1321 (modify-inputs propagated-inputs
1322 (replace "python-packaging" python-packaging-bootstrap)))))
1323
1324(define-public python-hatch-docstring-description
1325 (package
1326 (name "python-hatch-docstring-description")
1327 (version "1.1.1")
1328 (source
1329 (origin
1330 (method url-fetch)
1331 (uri (pypi-uri "hatch_docstring_description" version))
1332 (sha256
1333 (base32 "1qwa8m4yswn0bkc5xzq30xsaca578axl5ig2r6mkcdxsfg196pdi"))))
1334 (build-system pyproject-build-system)
1335 (arguments (list #:tests? #f)) ;avoid extra test dependencies
1336 (native-inputs
1337 (list python-hatch-vcs
1338 python-hatchling))
1339 (propagated-inputs
1340 (list python-hatchling))
1341 (home-page "https://github.com/flying-sheep/hatch-docstring-description")
1342 (synopsis "Derive PyPI package description from Python package docstring ")
1343 (description
1344 "This package provides a Hatchling plugin to read the description from the
1345package docstring.")
1346 (license license:gpl3+)))
1347
1348(define-public python-hatch-fancy-pypi-readme
1349 (package
1350 (name "python-hatch-fancy-pypi-readme")
1351 (version "25.1.0")
1352 (source
1353 (origin
1354 (method url-fetch)
1355 (uri (pypi-uri "hatch_fancy_pypi_readme" version))
1356 (sha256
1357 (base32 "0i803kq80qx0k1lj3z69zw40ynqxml4p1qsc851izmchzwyysn4w"))))
1358 (build-system pyproject-build-system)
1359 (arguments (list #:tests? #f)) ;avoid extra test dependencies
1360 (propagated-inputs (list python-hatchling python-tomli))
1361 (home-page "https://github.com/hynek/hatch-fancy-pypi-readme")
1362 (synopsis "Fancy PyPI READMEs with Hatch")
1363 (description "This hatch plugin allows defining a project description in
1364terms of concatenated fragments that are based on static strings, files and
1365parts of files defined using cut-off points or regular expressions.")
1366 (license license:expat)))
1367
1368(define-public python-hatch-requirements-txt
1369 (package
1370 (name "python-hatch-requirements-txt")
1371 (version "0.4.1")
1372 (source
1373 (origin
1374 (method url-fetch)
1375 (uri (pypi-uri "hatch_requirements_txt" version))
1376 (sha256
1377 (base32 "083xakilrmy0ymh34s9wm8x8s7s8vn7ij33xz9avn1gxb1bnws1c"))))
1378 (build-system pyproject-build-system)
1379 (arguments (list #:tests? #f)) ;avoid extra test dependencies
1380 (propagated-inputs (list python-hatchling python-packaging-bootstrap))
1381 (home-page "https://github.com/repo-helper/hatch-requirements-txt")
1382 (synopsis "Hatchling plugin to read requirements.txt")
1383 (description
1384 "This package implements a functionality to read project dependencies
1385from requirements.txt.")
1386 (license license:expat)))
1387
1388(define-public python-hatch-vcs
1389 (package
1390 (name "python-hatch-vcs")
1391 (version "0.5.0")
1392 (source
1393 (origin
1394 (method url-fetch)
1395 (uri (pypi-uri "hatch_vcs" version))
1396 (sha256
1397 (base32 "1yczh2aqrf9p3gs1dayswz5pp9z2yhmlld0c14ah4d20d49gm583"))))
1398 (arguments (list #:tests? #f)) ;avoid extra test dependencies
1399 (build-system pyproject-build-system)
1400 (propagated-inputs (list python-hatchling python-setuptools-scm))
1401 (home-page "https://github.com/ofek/hatch-vcs")
1402 (synopsis "Hatch plugin for versioning with your preferred VCS")
1403 (description "This package is a plugin for Hatch that uses your preferred
1404version control system (like Git) to determine project versions.")
1405 (license license:expat)))
1406
1407(define-public python-hatch-vcs-bootstrap
1408 (package/inherit python-hatch-vcs
1409 (name "python-hatch-vcs-bootstrap")
1410 (native-inputs
1411 (list python-packaging-bootstrap))
1412 (propagated-inputs
1413 (list python-hatchling-bootstrap
1414 python-setuptools-scm-bootstrap))))
1415
1416(define-public python-inflect
1417 (package
1418 (name "python-inflect")
1419 (version "7.5.0")
1420 (source (origin
1421 (method url-fetch)
1422 (uri (pypi-uri "inflect" version))
1423 (sha256
1424 (base32
1425 "07spmlkmskwhxc0j5j4ms3w0f6pyv3h8iqwcbahdabklqc0riwgs"))))
1426 (build-system pyproject-build-system)
1427 (native-inputs
1428 (list python-pygments
1429 python-pytest-bootstrap
1430 python-setuptools-bootstrap
1431 python-setuptools-scm-bootstrap))
1432 (propagated-inputs
1433 (list python-more-itertools
1434 python-typeguard
1435 python-typing-extensions))
1436 (home-page "https://github.com/jaraco/inflect")
1437 (synopsis "Correctly generate plurals, singular nouns, ordinals, indefinite articles")
1438 (description
1439 "This Python module lets you correctly generate plurals, singular nouns,
1440ordinals, indefinite articles; it also can convert numbers to words.")
1441 (license license:expat)))
1442
1443(define-public python-iniconfig
1444 (package
1445 (name "python-iniconfig")
1446 (version "2.1.0")
1447 (source
1448 (origin
1449 (method url-fetch)
1450 (uri (pypi-uri "iniconfig" version))
1451 (sha256
1452 (base32 "1iz1fg3n6pv4q8jzv1q0izl5001diwqggizrg3p3ywrn1gix5frs"))))
1453 (build-system pyproject-build-system)
1454 (arguments (list #:tests? #f)) ;no tests in PyPI, tests introduce cycle with pytest
1455 (native-inputs
1456 (list python-hatch-vcs-bootstrap
1457 python-hatchling-bootstrap))
1458 (home-page "https://github.com/RonnyPfannschmidt/iniconfig")
1459 (synopsis "Simple INI-file parser")
1460 (description "The @code{iniconfig} package provides a small and simple
1461 INI-file parser module having a unique set of features ; @code{iniconfig}
1462 @itemize
1463 @item maintains the order of sections and entries ;
1464 @item supports multi-line values with or without line-continuations ;
1465 @item supports \"#\" comments everywhere ;
1466 @item raises errors with proper line-numbers ;
1467 @item raises an error when two sections have the same name.
1468 @end itemize")
1469 (license license:expat)))
1470
1471(define-public python-installer
1472 (package
1473 (name "python-installer")
1474 (version "0.7.0")
1475 (source
1476 (origin
1477 (method url-fetch)
1478 (uri (pypi-uri "installer" version))
1479 (sha256
1480 (base32 "0cdnqh3a3amw8k4s1pzfjh0hpvzw4pczgl702s1b16r82qqkwvd2"))))
1481 (build-system pyproject-build-system)
1482 (arguments (list #:tests? #f)) ;avoid extra test dependencies
1483 (native-inputs
1484 (list python-flit-core))
1485 (home-page "https://installer.rtfd.io/")
1486 (synopsis "Installer library for Python wheels")
1487 (description
1488 "This package provides a low-level library for installing a Python
1489package from a wheel distribution. It provides basic functionality and
1490abstractions for handling wheels and installing packages from wheels.")
1491 (license license:expat)))
1492
1493;; Both packages have been merged into a single one.
1494(define-deprecated-package python-pypa-installer
1495 python-installer)
1496
1497(define-public python-jaraco-classes
1498 (package
1499 (name "python-jaraco-classes")
1500 (version "3.4.0")
1501 (source
1502 (origin
1503 (method url-fetch)
1504 (uri (pypi-uri "jaraco.classes" version))
1505 (sha256
1506 (base32 "1k9s7wxhsy15730qab8bry7kpgl4yk3wch45ikfw0f823nsj9827"))))
1507 (build-system pyproject-build-system)
1508 (arguments
1509 (list ; Do not test the myproject.toml build as it pulls dependencies.
1510 #:test-flags '(list "-k" "not project")))
1511 (native-inputs
1512 (list python-pytest-bootstrap
1513 python-setuptools-bootstrap))
1514 (propagated-inputs
1515 (list python-more-itertools))
1516 (home-page "https://github.com/jaraco/jaraco.classes")
1517 (synopsis "Utility functions for Python class constructs")
1518 (description "This Python library contains utility functions for Python
1519class constructs.")
1520 (license license:expat)))
1521
1522(define-public python-jaraco-collections
1523 (package
1524 (name "python-jaraco-collections")
1525 (version "5.2.1")
1526 (source
1527 (origin
1528 (method url-fetch)
1529 (uri (pypi-uri "jaraco_collections" version))
1530 (sha256
1531 (base32 "1v8qza70spm4d822bm7wq3j2cyd33nqg2i87n99spw6np9q1kf6s"))))
1532 (build-system pyproject-build-system)
1533 ;; Do not test pyproject.toml with python-pytest-checkdocs as it tries to
1534 ;; download dependencies.
1535 (arguments
1536 '(#:test-flags '("-k" "not project")))
1537 (native-inputs
1538 (list python-pytest-bootstrap
1539 python-setuptools-bootstrap
1540 python-setuptools-scm-bootstrap))
1541 (propagated-inputs
1542 (list python-jaraco-text))
1543 (home-page "https://github.com/jaraco/jaraco.collections")
1544 (synopsis "Provides various collection objects")
1545 (description
1546 "This package provides models and classes to supplement the
1547standard library @code{collections} module. Examples include
1548@itemize
1549@item
1550RangeMap: A mapping that accepts a range of values for keys.
1551@item
1552Projection: A subset over an existing mapping.
1553@item
1554KeyTransformingDict: Generalized mapping with keys transformed by a function.
1555@item
1556FoldedCaseKeyedDict: A dict whose string keys are case-insensitive.
1557@item
1558BijectiveMap: A map where keys map to values and values back to their keys.
1559@item
1560ItemsAsAttributes: A mapping mix-in exposing items as attributes.
1561@item
1562IdentityOverrideMap: A map whose keys map by default to themselves unless overridden.
1563@item
1564FrozenDict: A hashable, immutable map.
1565@item
1566Enumeration: An object whose keys are enumerated.
1567@item
1568Everything: A container that contains all things.
1569@item
1570Least, Greatest: Objects that are always less than or greater than any other.
1571@item
1572pop_all: Return all items from the mutable sequence and remove them from that sequence.
1573@item
1574DictStack: A stack of dicts, great for sharing scopes.
1575@item
1576WeightedLookup: A specialized RangeMap for selecting an item by weights.
1577@end itemize")
1578 (license license:expat)))
1579
1580(define-public python-jaraco-context
1581 (package
1582 (name "python-jaraco-context")
1583 (version "6.0.1")
1584 (source
1585 (origin
1586 (method url-fetch)
1587 (uri (pypi-uri "jaraco_context" version))
1588 (sha256
1589 (base32 "1cyija3n4481r1ykxdx342m07lrfyg4ygbn0in9i82yganjlxblv"))))
1590 (build-system pyproject-build-system)
1591 (arguments
1592 (list #:tests? #f)) ;no tests in PyPI archive and Git checkout
1593 (native-inputs
1594 (list python-setuptools-bootstrap
1595 python-setuptools-scm-bootstrap))
1596 (propagated-inputs
1597 (list python-backports-tarfile))
1598 (home-page "https://github.com/jaraco/jaraco.context")
1599 (synopsis "Context managers Python library")
1600 (description
1601 "This Python library provides context managers-related procedures.")
1602 (license license:expat)))
1603
1604(define-public python-jaraco-envs-bootstrap
1605 (package
1606 (name "python-jaraco-envs-bootstrap")
1607 (version "2.6.0")
1608 (source
1609 (origin
1610 (method url-fetch)
1611 (uri (pypi-uri "jaraco.envs" version))
1612 (sha256
1613 (base32 "1xb00gfhhhvh44wqq5yqb5bxi79nd97vzvh1xrbb43b40v29b4c0"))))
1614 (build-system pyproject-build-system)
1615 (arguments
1616 (list ; avoid extra dependencies.
1617 #:tests? #f
1618 #:phases
1619 #~(modify-phases %standard-phases
1620 (delete 'sanity-check))))
1621 (propagated-inputs
1622 (list python-path
1623 python-virtualenv-bootstrap))
1624 (native-inputs
1625 (list python-setuptools-bootstrap
1626 python-setuptools-scm-bootstrap))
1627 (home-page "https://github.com/jaraco/jaraco.envs")
1628 (synopsis "Classes for orchestrating Python (virtual) environments")
1629 (description
1630 "This package provides classes for orchestrating Python (virtual)
1631environments.")
1632 (license license:expat)))
1633
1634(define-public python-jaraco-functools
1635 (package
1636 (name "python-jaraco-functools")
1637 (version "4.2.1")
1638 (source
1639 (origin
1640 (method url-fetch)
1641 (uri (pypi-uri "jaraco_functools" version))
1642 (sha256
1643 (base32 "0lvk12qbl5zd1ikr6xzflj1jcs3vwgmwgy2k63x5dkmbrjzllqxy"))))
1644 (build-system pyproject-build-system)
1645 (arguments
1646 (list #:tests? (not (%current-target-system))
1647 ;; Do not test the myproject.toml build as it pulls dependencies.
1648 ;; Do not run a test that tries to emulate a broken proprietary
1649 ;; CI set-up, fails to do so correctly, and then throws an error.
1650 #:test-flags
1651 '(list "-k" "not project and not test_function_throttled")))
1652 (native-inputs
1653 (list python-jaraco-classes
1654 python-pytest-bootstrap
1655 python-setuptools-bootstrap
1656 python-setuptools-scm-bootstrap))
1657 (propagated-inputs (list python-more-itertools))
1658 (home-page "https://github.com/jaraco/jaraco.functools")
1659 (synopsis "Python library extending Python's @code{functools}")
1660 (description "This library extends the standard @code{functools} Python
1661module with a few extra procedures.")
1662 (license license:expat)))
1663
1664(define-public python-jaraco-path
1665 (package
1666 (name "python-jaraco-path")
1667 (version "3.7.2")
1668 (source
1669 (origin
1670 (method git-fetch)
1671 (uri (git-reference
1672 (url "https://github.com/jaraco/jaraco.path")
1673 (commit (string-append "v" version))))
1674 (file-name (git-file-name name version))
1675 (sha256
1676 (base32 "12bj9za1yp0yn0ppya6a4kwgmh7hvmw64x7ivp4y0sbv20r0vfdq"))))
1677 (build-system pyproject-build-system)
1678 (native-inputs
1679 (list python-pytest-bootstrap
1680 python-setuptools-bootstrap
1681 python-setuptools-scm-bootstrap))
1682 (home-page "https://github.com/jaraco/jaraco.path")
1683 (synopsis "Miscellaneous path functions")
1684 (description
1685 "This package provides miscellaneous path functions for Python.")
1686 (license license:expat)))
1687
1688(define-public python-jaraco-test
1689 (package
1690 (name "python-jaraco-test")
1691 (version "5.5.1")
1692 (source
1693 (origin
1694 (method url-fetch)
1695 (uri (pypi-uri "jaraco_test" version))
1696 (sha256
1697 (base32 "0xfkly5w4i4npi4pq1g32y8q8iijkq4pfcfs8wcjhfn4amj6212c"))))
1698 (build-system pyproject-build-system)
1699 (arguments
1700 (list #:test-flags '(list "-k" "http")))
1701 (native-inputs
1702 (list python-pytest-bootstrap
1703 python-setuptools-bootstrap))
1704 (propagated-inputs
1705 (list python-jaraco-collections
1706 python-jaraco-context
1707 python-jaraco-functools))
1708 (home-page "https://github.com/jaraco/jaraco.test")
1709 (synopsis "Testing support by jaraco")
1710 (description "This package provides testing support by jaraco.")
1711 (license license:expat)))
1712
1713(define-public python-jaraco-text
1714 (package
1715 (name "python-jaraco-text")
1716 (version "4.0.0")
1717 (source
1718 (origin
1719 (method url-fetch)
1720 (uri (pypi-uri "jaraco_text" version))
1721 (sha256
1722 (base32 "1c0dy5jvhigcyryi2h8n1m87dnhyxr7w01n9shwzkdlslv7gwwav"))))
1723 (build-system pyproject-build-system)
1724 ;; Do not test pyproject.toml with python-pytest-checkdocs as it tries to
1725 ;; download dependencies.
1726 (arguments
1727 '(#:test-flags '("-k" "not project")))
1728 (native-inputs
1729 (list python-pytest-bootstrap
1730 python-setuptools-bootstrap
1731 python-setuptools-scm-bootstrap))
1732 (propagated-inputs
1733 (list python-autocommand
1734 python-inflect
1735 python-jaraco-context
1736 python-jaraco-functools
1737 python-more-itertools))
1738 (home-page "https://github.com/jaraco/jaraco.text")
1739 (synopsis "Provides various routines for text manipulation")
1740 (description
1741 "This package provides handy routines for dealing with text,
1742such as wrapping, substitution, trimming, stripping, prefix and suffix
1743removal, line continuation, indentation, comment processing, identifier
1744processing, values parsing, case insensitive comparison, and more.")
1745 (license license:expat)))
1746
1747(define-public python-pdm-backend
1748 (package
1749 (name "python-pdm-backend")
1750 (version "2.4.5")
1751 (source
1752 (origin
1753 (method url-fetch)
1754 (uri (pypi-uri "pdm_backend" version))
1755 (sha256
1756 (base32 "0nzyfa4jb0cpfhh0jfqsk4xz8rbyfyxqrh2ps3axm2ih8321kh2n"))))
1757 (build-system pyproject-build-system)
1758 (arguments
1759 (list
1760 #:tests? #f)) ; Depends on pytest, which we cannot import into this module.
1761 (home-page "https://pdm-backend.fming.dev/")
1762 (synopsis "PEP 517 build backend for PDM")
1763 (description
1764 "PDM-Backend is a build backend that supports the latest packaging
1765standards, which includes PEP 517, PEP 621 and PEP 660.")
1766 (license license:expat)))
1767
1768(define-public python-virtualenv-bootstrap
1769 (package
1770 (name "python-virtualenv-bootstrap")
1771 (version "20.29.1")
1772 (source
1773 (origin
1774 (method url-fetch)
1775 (uri (pypi-uri "virtualenv" version))
1776 (sha256
1777 (base32
1778 "0dfwnn8i1y33kgxhi4xyhsj4yr5vsin7zf9c343bcbyk700rgf5q"))))
1779 (build-system pyproject-build-system)
1780 (arguments (list #:tests? #f)) ; avoid extra dependencies.
1781 (native-inputs
1782 (list python-hatch-vcs-bootstrap
1783 python-hatchling
1784 python-setuptools-bootstrap))
1785 (propagated-inputs
1786 (list python-distlib
1787 python-filelock-bootstrap
1788 python-platformdirs-bootstrap))
1789 (home-page "https://virtualenv.pypa.io/")
1790 (synopsis "Virtual Python environment builder")
1791 (description
1792 "Virtualenv is a tool to create isolated Python environments.")
1793 (license license:expat)))