projects/guix·blob python-team · refs

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