projects/guix·blob graal · refs

970 lines · 35.5 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 ((guix licenses) #:prefix license:)
44 #:use-module (guix build-system python)
45 #:use-module (guix build-system pyproject)
46 #:use-module (guix gexp)
47 #:use-module (guix deprecation)
48 #:use-module (guix download)
49 #:use-module (guix git-download)
50 #:use-module (guix packages))
51
52;;; Commentary:
53;;;
54;;; Python packages to build... Python packages. Since they are bound to be
55;;; relied on by many, their dependencies should be kept minimal, and this
56;;; module should not depend on other modules containing Python packages.
57;;;
58;;; Code:
59
60
61;;; These are dependencies used by the build systems contained herein; they
62;;; feel a bit out of place but are kept here to prevent circular module
63;;; dependencies.
64(define-public python-pathspec
65 (package
66 (name "python-pathspec")
67 (version "0.12.1")
68 (source
69 (origin
70 (method url-fetch)
71 (uri (pypi-uri "pathspec" version))
72 (sha256
73 (base32 "04jpkzic8f58z6paq7f3f7fdnlv9l89khv3sqsqk7ax10caxb0m4"))))
74 (build-system pyproject-build-system)
75 (arguments (list #:test-backend #~'unittest))
76 (native-inputs
77 (list python-flit-core
78 python-setuptools))
79 (home-page "https://github.com/cpburnz/python-pathspec")
80 (synopsis "Utility library for gitignore style pattern matching of file paths")
81 (description
82 "This package provides a utility library for gitignore style pattern
83matching of file paths.")
84 (license license:mpl2.0)))
85
86(define-public python-pluggy
87 (package
88 (name "python-pluggy")
89 (version "1.6.0")
90 (source
91 (origin
92 (method url-fetch)
93 (uri (pypi-uri "pluggy" version))
94 (sha256
95 (base32 "1wr2vnbb7gy9wlz01yvb7rn4iqzd3mwmidk11ywk7395fq5i7k3x"))))
96 (build-system pyproject-build-system)
97 (native-inputs
98 (list python-setuptools
99 python-setuptools-scm
100 python-wheel))
101 (home-page "https://pypi.org/project/pluggy/")
102 (synopsis "Plugin and hook calling mechanism for Python")
103 (description
104 "Pluggy is an extraction of the plugin manager as used by Pytest but
105stripped of Pytest specific details.")
106 (license license:expat)))
107
108(define-public python-toml
109 (package
110 (name "python-toml")
111 (version "0.10.2")
112 (source
113 (origin
114 (method url-fetch)
115 (uri (pypi-uri "toml" version))
116 (sha256
117 (base32 "13z6rff86bzdpl094x0vmfvls779931xj90dlbs9kpfm138s3gdk"))))
118 (build-system pyproject-build-system)
119 (arguments
120 `(#:tests? #f)) ;no tests suite in release
121 (native-inputs
122 (list python-setuptools))
123 (home-page "https://github.com/uiri/toml")
124 (synopsis "Library for TOML")
125 (description
126 "@code{toml} is a library for parsing and creating Tom's Obvious, Minimal
127Language (TOML) configuration files.")
128 (license license:expat)))
129
130(define-public python-tomli-w
131 (package
132 (name "python-tomli-w")
133 (version "1.2.0")
134 (source
135 (origin
136 (method url-fetch)
137 (uri (pypi-uri "tomli_w" version))
138 (sha256
139 (base32 "08ahw9db7qycd4fzh4j51cgzp1rdl7snm5scrplpphj7ban4zl9d"))))
140 (build-system pyproject-build-system)
141 (arguments (list #:tests? #f)) ;to avoid extra dependencies
142 (native-inputs (list python-flit-core))
143 (home-page "https://github.com/hukkin/tomli-w")
144 (synopsis "Minimal TOML writer")
145 (description "Tomli-W is a Python library for writing TOML. It is a
146write-only counterpart to Tomli, which is a read-only TOML parser.")
147 (license license:expat)))
148
149(define-public python-pytoml
150 (package
151 (name "python-pytoml")
152 (version "0.1.21")
153 (source
154 (origin
155 (method url-fetch)
156 (uri (pypi-uri "pytoml" version))
157 (sha256
158 (base32 "1rv1byiw82k7mj6aprcrqi2vdabs801y97xhfnrz7kxds34ggv4f"))))
159 (build-system pyproject-build-system)
160 (arguments `(#:tests? #f)) ;to avoid pytest dependency
161 (native-inputs
162 (list python-setuptools))
163 (home-page "https://github.com/avakar/pytoml")
164 (synopsis "Parser for TOML")
165 (description "This package provides a Python parser for TOML-0.4.0.")
166 (license license:expat)))
167
168(define-public python-tomli
169 (package
170 (name "python-tomli")
171 (version "2.2.1")
172 (source
173 (origin
174 (method url-fetch)
175 (uri (pypi-uri "tomli" version))
176 (sha256
177 (base32 "1zq58p2bplyf0xpi9fnyn4w6vc1fkw8whkj0yxhcwdf8g7ff2ifd"))))
178 (build-system pyproject-build-system)
179 (arguments
180 `(#:tests? #f)) ;disabled to avoid extra dependencies
181 (native-inputs (list python-flit-core-bootstrap))
182 (home-page "https://github.com/hukkin/tomli")
183 (synopsis "Small and fast TOML parser")
184 (description "Tomli is a minimal TOML parser that is fully compatible with
185@url{https://toml.io/en/v1.0.0,TOML v1.0.0}. It is about 2.4 times as fast as
186@code{python-toml}.")
187 (license license:expat)))
188
189(define-public python-trove-classifiers
190 (package
191 (name "python-trove-classifiers")
192 (version "2025.5.9.12")
193 (source
194 (origin
195 (method url-fetch)
196 (uri (pypi-uri "trove_classifiers" version))
197 (sha256
198 (base32 "1dawkrcc353rz1h4mazw25vkbhics5lpqrwc8qad6b3flykwi9vw"))))
199 (build-system pyproject-build-system)
200 (arguments
201 (list #:build-backend "setuptools.build_meta"
202 #:tests? #f)) ;keep dependencies to a minimum
203 (native-inputs (list python-setuptools python-wheel))
204 (home-page "https://github.com/pypa/trove-classifiers")
205 (synopsis "Canonical source for classifiers on PyPI")
206 (description "This package is the canonical source for classifiers use on
207PyPI (pypi.org).")
208 (license license:asl2.0)))
209
210(define-public python-typing-extensions
211 (package
212 (name "python-typing-extensions")
213 (version "4.15.0")
214 (source
215 (origin
216 (method url-fetch)
217 (uri (pypi-uri "typing_extensions" version))
218 (sha256
219 (base32 "0rhlhs28jndgp9fghdhidn6g7xiwx8vvihxbxhlgl4ncfg8lishc"))))
220 (build-system pyproject-build-system)
221 ;; Disable the test suite to keep the dependencies to a minimum. Also,
222 ;; the test suite requires Python's test module, not available in Guix.
223 (arguments (list #:tests? #f))
224 (native-inputs (list python-flit-core))
225 (home-page "https://github.com/python/typing_extensions")
226 (synopsis "Experimental type hints for Python")
227 (description
228 "The typing_extensions module contains additional @code{typing} hints not
229yet present in the of the @code{typing} standard library.
230Included are implementations of:
231@enumerate
232@item ClassVar
233@item ContextManager
234@item Counter
235@item DefaultDict
236@item Deque
237@item NewType
238@item NoReturn
239@item overload
240@item Protocol
241@item runtime
242@item Text
243@item Type
244@item TYPE_CHECKING
245@item AsyncGenerator
246@end enumerate\n")
247 (license license:psfl)))
248
249(define-deprecated/public-alias python-typing-extensions-next
250 python-typing-extensions) ;may be removed after 2025-12-01
251
252
253;;;
254;;; Python builder packages.
255;;;
256(define-public python-pbr
257 (package
258 (name "python-pbr")
259 (version "7.0.1")
260 (source
261 (origin
262 (method url-fetch)
263 (uri (pypi-uri "pbr" version))
264 (sha256
265 (base32 "0mvy1z1dyl28w0brns1vdhc98hzbn5b3fsw1xj41amdqs88wpjry"))))
266 (build-system pyproject-build-system)
267 (arguments
268 `(#:tests? #f)) ;; Most tests seem to use the Internet.
269 ;; Message from upstream:
270 ;;
271 ;; DO NOT add any other dependencies as PBR is meant to be minimalist to
272 ;; avoid problems with bootstrapping build environments.
273 ;;
274 ;; See: <https://opendev.org/openstack/pbr/src/tag/7.0.1/requirements.txt>.
275 (propagated-inputs
276 (list python-setuptools))
277 (home-page "https://docs.openstack.org/pbr/latest/")
278 (synopsis "Enhance the default behavior of Python’s setuptools")
279 (description
280 "Python Build Reasonableness (PBR) is a library that injects some useful
281and sensible default behaviors into your setuptools run. It will set
282versions, process requirements files and generate AUTHORS and ChangeLog file
283from git information.")
284 (license license:asl2.0)))
285
286;; It may be removed after 2025-12-22.
287(define-deprecated/public-alias python-pbr-next python-pbr)
288
289(define-public python-pip
290 (package
291 (name "python-pip")
292 (version "25.1.1")
293 (source
294 (origin
295 (method url-fetch)
296 (uri (pypi-uri "pip" version))
297 (sha256
298 (base32
299 "0xwhrng91a48zb5qmb6vagbjr6kzvbc8b08nq9a5139h3m0mvr1x"))
300 (snippet
301 #~(begin
302 (delete-file "src/pip/_vendor/certifi/cacert.pem")
303 (delete-file "src/pip/_vendor/certifi/core.py")
304 (with-output-to-file "src/pip/_vendor/certifi/core.py"
305 (lambda _
306 (display "\"\"\"
307certifi.py
308~~~~~~~~~~
309This file is a Guix-specific version of core.py.
310
311This module returns the installation location of SSL_CERT_FILE or
312/etc/ssl/certs/ca-certificates.crt, or its contents.
313\"\"\"
314import os
315
316_CA_CERTS = None
317
318try:
319 _CA_CERTS = os.environ [\"SSL_CERT_FILE\"]
320except:
321 _CA_CERTS = os.path.join(\"/etc\", \"ssl\", \"certs\", \"ca-certificates.crt\")
322
323def where() -> str:
324 return _CA_CERTS
325
326def contents() -> str:
327 with open(where(), \"r\", encoding=\"ascii\") as data:
328 return data.read()")))))))
329 (build-system pyproject-build-system)
330 (arguments
331 '(#:tests? #f)) ; there are no tests in the pypi archive.
332 (native-inputs
333 (list python-setuptools))
334 (home-page "https://pip.pypa.io/")
335 (synopsis "Package manager for Python software")
336 (description
337 "Pip is a package manager for Python software, that finds packages on the
338Python Package Index (PyPI).")
339 (license license:expat)))
340
341(define-public python-setuptools
342 (package
343 (name "python-setuptools")
344 (version "80.9.0")
345 (source
346 (origin
347 (method url-fetch)
348 (uri (pypi-uri "setuptools" version))
349 (sha256
350 (base32 "175iixi2h2jz8y2bpwziak360hvv43jfhipwzbdniryd5r04fszk"))
351 (modules '((guix build utils)))
352 (snippet
353 ;; TODO: setuptools now bundles the following libraries:
354 ;; packaging, pyparsing, six and appdirs. How to unbundle?
355 ;; Remove included binaries which are used to build self-extracting
356 ;; installers for Windows.
357 '(for-each delete-file (find-files "setuptools"
358 "^(cli|gui).*\\.exe$")))))
359 (build-system pyproject-build-system)
360 ;; FIXME: Tests require pytest, which itself relies on setuptools.
361 ;; One could bootstrap with an internal untested setuptools.
362 (arguments (list #:tests? #f))
363 (home-page "https://pypi.org/project/setuptools/")
364 (synopsis "Library designed to facilitate packaging Python projects")
365 (description "Setuptools is a fully-featured, stable library designed to
366facilitate packaging Python projects, where packaging includes:
367@itemize
368@item Python package and module definitions
369@item distribution package metadata
370@item test hooks
371@item project installation
372@item platform-specific details.
373@end itemize")
374 (license (list license:psfl ;setuptools itself
375 license:expat ;six, appdirs, pyparsing
376 license:asl2.0 ;packaging is dual ASL2/BSD-2
377 license:bsd-2))))
378
379(define-public python-setuptools-67
380 (package
381 (inherit python-setuptools)
382 (version "67.6.1")
383 (source
384 (origin
385 (method url-fetch)
386 (uri (pypi-uri "setuptools" version))
387 (sha256
388 (base32 "16myxkpa89r045il88zcygdy1zbi2mvvpz5b4a70p9jhklmfjz95"))
389 (modules '((guix build utils)))
390 (snippet
391 '(for-each delete-file (find-files "setuptools" "^(cli|gui).*\\.exe$")))))
392 (native-inputs
393 (list python-wheel-0.40))))
394
395(define-deprecated/public-alias python-setuptools-next
396 python-setuptools) ;may be removed after 2025-12-01
397
398(define-public python-wheel
399 (package
400 (name "python-wheel")
401 (version "0.46.1")
402 (source
403 (origin
404 (method url-fetch)
405 (uri (pypi-uri "wheel" version))
406 (sha256
407 (base32 "0f3abrpkf3spv0lk5mhv8m2ch0j074a3rivn7hfxzxx0bpxpwizx"))))
408 (build-system pyproject-build-system)
409 (arguments
410 ;; FIXME: The test suite runs "python setup.py bdist_wheel", which in turn
411 ;; fails to find the newly-built bdist_wheel library, even though it is
412 ;; available on PYTHONPATH. What search path is consulted by setup.py?
413 '(#:tests? #f))
414 (native-inputs
415 (list python-flit-core))
416 (home-page "https://github.com/pypa/wheel")
417 (synopsis "Format for built Python packages")
418 (description
419 "A wheel is a ZIP-format archive with a specially formatted filename and
420the @code{.whl} extension. It is designed to contain all the files for a PEP
421376 compatible install in a way that is very close to the on-disk format. Many
422packages will be properly installed with only the @code{Unpack} step and the
423unpacked archive preserves enough information to @code{Spread} (copy data and
424scripts to their final locations) at any later time. Wheel files can be
425installed with a newer @code{pip} or with wheel's own command line utility.")
426 (license license:expat)))
427
428(define-public python-wheel-0.40
429 (package
430 (inherit python-wheel)
431 (version "0.40.0")
432 (source
433 (origin
434 (method url-fetch)
435 (uri (pypi-uri "wheel" version))
436 (sha256
437 (base32 "0ww8fgkvwv35ypj4cnngczdwp6agr4qifvk2inb32azfzbrrc4fd"))))))
438
439;;; TODO: Deprecate with https://github.com/pypa/pyproject-hooks.
440;;;
441;;; From PyPI web page: The core of this package has been renamed to
442;;; pyproject-hooks (https://pyproject-hooks.readthedocs.io). Please use that
443;;; package or build (https://pypa-build.readthedocs.io/en/stable/) in place
444;;; of pep517.
445(define-public python-pep517-bootstrap
446 (hidden-package
447 (package
448 (name "python-pep517-bootstrap")
449 (version "0.13.1")
450 (source
451 (origin
452 (method url-fetch)
453 (uri (pypi-uri "pep517" version))
454 (sha256
455 (base32 "05xk0x7b5n7zmcqrznm4lnbakgdjpin19mp5zyzb92wksgzs4bqv"))))
456 (build-system pyproject-build-system)
457 (arguments
458 `(#:tests? #f)) ;to avoid circular dependencies
459 (native-inputs (list python-flit-core))
460 (home-page "https://github.com/pypa/pep517")
461 (synopsis "Wrappers to build Python packages using PEP 517 hooks")
462 (description
463 "Wrappers to build Python packages using PEP 517 hooks.")
464 (license license:expat))))
465
466(define-public python-pyparsing
467 (package
468 (name "python-pyparsing")
469 (version "3.2.3")
470 (source
471 (origin
472 (method url-fetch)
473 (uri (pypi-uri "pyparsing" version))
474 (sha256
475 (base32 "1giqgjknzbbh34qf8ij5rsrqlxfysjx39xi85vvl5ddkp0d3zhdr"))))
476 (build-system pyproject-build-system)
477 (outputs '("out" "doc"))
478 (arguments
479 `(#:tests? #f ;no test target
480 #:phases
481 (modify-phases %standard-phases
482 (add-after 'install 'install-doc
483 (lambda* (#:key outputs #:allow-other-keys)
484 (let* ((doc (string-append (assoc-ref outputs "doc")
485 "/share/doc/" ,name "-" ,version))
486 (html-doc (string-append doc "/html"))
487 (examples (string-append doc "/examples")))
488 (mkdir-p html-doc)
489 (mkdir-p examples)
490 (for-each
491 (lambda (dir tgt)
492 (map (lambda (file)
493 (install-file file tgt))
494 (find-files dir ".*")))
495 (list "docs" "htmldoc" "examples")
496 (list doc html-doc examples))))))))
497 (native-inputs (list python-flit-core))
498 (home-page "https://github.com/pyparsing/pyparsing")
499 (synopsis "Python parsing class library")
500 (description
501 "The pyparsing module is an alternative approach to creating and
502executing simple grammars, vs. the traditional lex/yacc approach, or the use
503of regular expressions. The pyparsing module provides a library of classes
504that client code uses to construct the grammar directly in Python code.")
505 (license license:expat)))
506
507(define-public python-packaging-bootstrap
508 (package
509 (name "python-packaging-bootstrap")
510 (version "25.0")
511 (source
512 (origin
513 (method url-fetch)
514 (uri (pypi-uri "packaging" version))
515 (sha256
516 (base32 "0kzwn2ar4ndm90qrvgyjcbkqz3klrg0ziwm1yrhbyxynk0n8fhyl"))))
517 (build-system pyproject-build-system)
518 (arguments `(#:tests? #f)) ;disabled to avoid extra dependencies
519 (native-inputs
520 (list python-flit-core))
521 (home-page "https://github.com/pypa/packaging")
522 (synopsis "Core utilities for Python packages")
523 (description "Packaging is a Python module for dealing with Python packages.
524It offers an interface for working with package versions, names, and dependency
525information.")
526 ;; From 'LICENSE': This software is made available under the terms of
527 ;; *either* of the licenses found in LICENSE.APACHE or LICENSE.BSD.
528 ;; Contributions to this software is made under the terms of *both* these
529 ;; licenses.
530 (license (list license:asl2.0 license:bsd-2))))
531
532;;; The name 'python-pypa-build' is chosen rather than 'python-build' to avoid
533;;; a name clash with python-build from (guix build-system python).
534(define-public python-pypa-build
535 (package
536 (name "python-pypa-build")
537 ;; Newer version needs more inputs, consider to move to python-xyz.
538 (version "0.9.0")
539 (source
540 (origin
541 (method url-fetch)
542 (uri (pypi-uri "build" version))
543 (sha256
544 (base32 "0g5w28ban6k9qywqwdqiqms3crg75rsvfphl4f4qkg8wi57741qs"))))
545 (build-system pyproject-build-system)
546 (arguments `(#:tests? #f)) ;disabled to avoid extra dependencies
547 (native-inputs
548 (list python-setuptools))
549 (propagated-inputs
550 (list python-packaging-bootstrap
551 python-pep517-bootstrap
552 python-toml))
553 (home-page "https://pypa-build.readthedocs.io/en/latest/")
554 (synopsis "Simple Python PEP 517 package builder")
555 (description "The @command{build} command invokes the PEP 517 hooks to
556build a distribution package. It is a simple build tool and does not perform
557any dependency management. It aims to keep dependencies to a minimum, in
558order to make bootstrapping easier.")
559 (license license:expat)))
560
561;; There are quite a few amount of Python installers in the wild we need the
562;; one from PyPa team.
563(define-public python-pypa-installer
564 (package
565 (name "python-pypa-installer")
566 (version "0.7.0")
567 (source
568 (origin
569 (method url-fetch)
570 (uri (pypi-uri "installer" version))
571 (sha256
572 (base32 "0cdnqh3a3amw8k4s1pzfjh0hpvzw4pczgl702s1b16r82qqkwvd2"))))
573 (build-system pyproject-build-system)
574 (arguments
575 (list
576 #:tests? #f)) ; Depends on pytest, which we cannot import into this module.
577 (native-inputs
578 (list python-flit-core))
579 (home-page "https://installer.readthedocs.io/")
580 (synopsis "low-level library for installing from a Python wheel distribution")
581 (description
582 "This package provides a library for installing Python wheels.")
583 (license license:expat)))
584
585(define-public python-poetry-core
586 (package
587 (name "python-poetry-core")
588 (version "2.1.3")
589 (source
590 (origin
591 (method url-fetch)
592 (uri (pypi-uri "poetry_core" version))
593 (sha256
594 (base32 "194nwaig8zkbj2ig4zwf1k7cl4vqlmvs8mmdkb425mky8was08h5"))))
595 (build-system pyproject-build-system)
596 (arguments
597 `(#:tests? #f)) ;disabled to avoid extra dependencies
598 (home-page "https://github.com/python-poetry/poetry-core")
599 (synopsis "Poetry PEP 517 build back-end")
600 (description
601 "The @code{poetry-core} module provides a PEP 517 build back-end
602implementation developed for Poetry. This project is intended to be
603a light weight, fully compliant, self-contained package allowing PEP 517
604compatible build front-ends to build Poetry managed projects.")
605 (license license:expat)))
606
607(define-deprecated/public-alias python-poetry-core-next
608 python-poetry-core) ;may be removed after 2025-12-01
609
610;;; This package exists to bootstrap python-tomli.
611(define-public python-flit-core-bootstrap
612 (package
613 (name "python-flit-core-bootstrap")
614 (version "3.12.0")
615 (source
616 (origin
617 (method url-fetch)
618 (uri (pypi-uri "flit" version))
619 (sha256
620 (base32 "0h1pxi2hgr95321bgl45l86693zl14l3shj0idsyg4k9v56z700w"))))
621 (build-system pyproject-build-system)
622 (arguments
623 (list
624 ;; flit-core has a test suite, but it requires Pytest. Disable it so
625 ;; as to not pull pytest as an input.
626 #:tests? #f
627 #:phases
628 #~(modify-phases %standard-phases
629 (add-after 'unpack 'fix-license
630 ;; flit_core bundles the 'tomli' TOML parser, to avoid a
631 ;; bootstrapping problem. See
632 ;; <https://github.com/pypa/packaging-problems/issues/342>.
633 (lambda _
634 (delete-file-recursively "flit_core/flit_core/vendor")
635 (substitute* "flit_core/pyproject.toml"
636 (("license-files.*") "license-files = [\"LICENSE*\"]\n"))))
637 (replace 'build
638 ;; flit-core requires itself to build. Luckily, a
639 ;; bootstrapping script exists, which does so using just
640 ;; the checkout sources and Python.
641 (lambda _
642 (chdir "flit_core")
643 (invoke "python" "build_dists.py")))
644 (delete 'sanity-check))))
645 (propagated-inputs
646 (list python-toml))
647 (home-page "https://github.com/pypa/flit")
648 (synopsis "Core package of the Flit Python build system")
649 (description "This package provides @code{flit-core}, a PEP 517 build
650backend for packages using Flit. The only public interface is the API
651specified by PEP 517, @code{flit_core.buildapi}.")
652 (license license:bsd-3)))
653
654(define-public python-flit-core
655 (package/inherit python-flit-core-bootstrap
656 (name "python-flit-core")
657 (propagated-inputs
658 (modify-inputs (package-propagated-inputs python-flit-core-bootstrap)
659 (delete "python-toml")
660 (prepend python-tomli)))))
661
662(define-deprecated/public-alias python-flit-core-next
663 python-flit-core) ;may be removed after 2025-12-01
664
665(define-public python-flit-scm
666 (package
667 (name "python-flit-scm")
668 (version "1.7.0")
669 (source
670 (origin
671 (method url-fetch)
672 (uri (pypi-uri "flit_scm" version))
673 (sha256
674 (base32 "1ckbkykfr7f7wzjzgh0gm7h6v3pqzx2l28rw6dsvl6zk4kxxc6wn"))))
675 (build-system pyproject-build-system)
676 (arguments
677 (list
678 #:tests? #f ;no tests in PyPI archive or Git checkout
679 #:phases
680 #~(modify-phases %standard-phases
681 (add-after 'unpack 'fix-backend
682 ;; flit_scm imports flit_core's buildapi and tries to make it
683 ;; available as "flit_scm:buildapi", see comment in
684 ;; <flit_scm/__init__.py>; but it fails during build phase with
685 ;; error: ModuleNotFoundError: No module named
686 ;; 'flit_scm:buildapi'.
687 ;;
688 ;; Use flit_core.buildapi directly to build flit_scm.
689 (lambda _
690 (substitute* "pyproject.toml"
691 (("flit_scm:buildapi") "flit_core.buildapi")))))))
692 (propagated-inputs
693 (list python-flit-core
694 python-setuptools-scm
695 python-tomli))
696 (home-page "https://gitlab.com/WillDaSilva/flit_scm")
697 (synopsis "PEP 518 build backend combining flit_core and setuptools_scm")
698 (description "This package provides a PEP 518 build backend that uses
699@code{setuptools_scm} to generate a version file from your version control
700system, then @code{flit_core} to build the package.")
701 (license license:expat)))
702
703(define-public python-setuptools-scm
704 (package
705 (name "python-setuptools-scm")
706 (version "8.3.1")
707 (source
708 (origin
709 (method url-fetch)
710 (uri (pypi-uri "setuptools_scm" version))
711 (sha256
712 (base32 "0qra4jysbdwlrwsb5iz8kai1xxbsz6adzbrbscvx1b2xny95wm9x"))))
713 (build-system pyproject-build-system)
714 (arguments
715 (list
716 #:tests? #f ;avoid extra dependencies such as pytest
717 ;; pyproject-build-system will error handle forms such as
718 ;; "module:object", so we set it.
719 #:build-backend "setuptools.build_meta"))
720 (propagated-inputs
721 (list python-packaging-bootstrap
722 python-setuptools))
723 (home-page "https://github.com/pypa/setuptools_scm/")
724 (synopsis "Manage Python package versions in SCM metadata")
725 (description
726 "Setuptools_scm handles managing your Python package versions in
727@dfn{software configuration management} (SCM) metadata instead of declaring
728them as the version argument or in a SCM managed file.")
729 (license license:expat)))
730
731(define-deprecated/public-alias python-setuptools-scm-next
732 python-setuptools-scm) ;may be removed after 2025-12-01
733
734(define-public python-editables
735 (package
736 (name "python-editables")
737 (version "0.5")
738 (source (origin
739 (method git-fetch)
740 (uri (git-reference
741 (url "https://github.com/pfmoore/editables")
742 (commit version)))
743 (file-name (git-file-name name version))
744 (sha256
745 (base32
746 "1bp959fz987jvrnkilhyr41fw4g00g9jfyiwmfvy96hv1yl68w8b"))))
747 (build-system pyproject-build-system)
748 (arguments (list #:tests? #f)) ;avoid extra dependencies such as pytest
749 (native-inputs
750 (list python-flit-core))
751 (home-page "https://github.com/pfmoore/editables")
752 (synopsis "Editable installations")
753 (description "This library supports the building of wheels which, when
754installed, will expose packages in a local directory on @code{sys.path} in
755``editable mode''. In other words, changes to the package source will be
756reflected in the package visible to Python, without needing a reinstall.")
757 (license license:expat)))
758
759;; This package may be removed when we have Python 3.11 on board.
760(define-public python-exceptiongroup
761 (package
762 (name "python-exceptiongroup")
763 (version "1.3.0")
764 (source
765 (origin
766 (method git-fetch)
767 (uri (git-reference
768 (url "https://github.com/agronholm/exceptiongroup")
769 (commit version)))
770 (file-name (git-file-name name version))
771 (sha256
772 (base32 "1kygngc6j7hm68w8q327jvym2z4gpyh93g2af6g419qaqqv7axkg"))))
773 (build-system pyproject-build-system)
774 (arguments
775 (list
776 #:tests? #f ;to keep dependencies to a minimum
777 #:build-backend "setuptools.build_meta"
778 #:phases
779 #~(modify-phases %standard-phases
780 (add-before 'build 'set-version
781 (lambda _
782 (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version))))))
783 (native-inputs
784 (list python-flit-scm))
785 (propagated-inputs
786 (list python-typing-extensions))
787 (home-page "https://github.com/agronholm/exceptiongroup")
788 (synopsis "PEP 654 backport from Python 3.11")
789 (description "This is a backport of the @code{BaseExceptionGroup} and
790@code{ExceptionGroup} classes from Python 3.11.")
791 (license license:expat)))
792
793(define-public python-hatchling
794 (package
795 (name "python-hatchling")
796 (version "1.27.0")
797 (source
798 (origin
799 (method url-fetch)
800 (uri (pypi-uri "hatchling" version))
801 (sha256
802 (base32 "1mhzjhg7ky8npcrnbwwq30w8s73mm73m5z0j260v7aqrk1njj74p"))))
803 (build-system pyproject-build-system)
804 (arguments
805 (list #:tests? #f)) ;to keep dependencies to a minimum
806 (propagated-inputs
807 (list python-packaging-bootstrap
808 python-pathspec
809 python-pluggy
810 python-tomli
811 python-trove-classifiers))
812 (home-page "https://hatch.pypa.io/latest/")
813 (synopsis "Modern, extensible Python build backend")
814 (description "Hatch is a modern, extensible Python project manager. It
815has features such as:
816@itemize
817@item Standardized build system with reproducible builds by default
818@item Robust environment management with support for custom scripts
819@item Easy publishing to PyPI or other indexes
820@item Version management
821@item Configurable project generation with sane defaults
822@item Responsive CLI, ~2-3x faster than equivalent tools.
823@end itemize")
824 (license license:expat)))
825
826(define-public python-hatchling-for-hatch
827 ;; For [email protected], remove when no longer required.
828 (hidden-package
829 (package
830 (inherit python-hatchling)
831 (version "1.21.1")
832 (source
833 (origin
834 (method url-fetch)
835 (uri (pypi-uri "hatchling" version))
836 (sha256
837 (base32 "1g40g68vzfakddd9f0psp9jkfqy3v3la4zs5g127ski2792l195v"))))
838 (propagated-inputs
839 (list python-editables
840 python-packaging-bootstrap
841 python-pathspec
842 python-pluggy
843 python-trove-classifiers)))))
844
845(define-public python-hatch-docstring-description
846 (package
847 (name "python-hatch-docstring-description")
848 (version "1.1.1")
849 (source
850 (origin
851 (method url-fetch)
852 (uri (pypi-uri "hatch_docstring_description" version))
853 (sha256
854 (base32 "1qwa8m4yswn0bkc5xzq30xsaca578axl5ig2r6mkcdxsfg196pdi"))))
855 (build-system pyproject-build-system)
856 (arguments (list #:tests? #f)) ;avoid extra test dependencies
857 (native-inputs
858 (list python-hatch-vcs
859 python-hatchling))
860 (propagated-inputs
861 (list python-hatchling))
862 (home-page "https://github.com/flying-sheep/hatch-docstring-description")
863 (synopsis "Derive PyPI package description from Python package docstring ")
864 (description
865 "This package provides a Hatchling plugin to read the description from the
866package docstring.")
867 (license license:gpl3+)))
868
869(define-public python-hatch-fancy-pypi-readme
870 (package
871 (name "python-hatch-fancy-pypi-readme")
872 (version "25.1.0")
873 (source
874 (origin
875 (method url-fetch)
876 (uri (pypi-uri "hatch_fancy_pypi_readme" version))
877 (sha256
878 (base32 "0i803kq80qx0k1lj3z69zw40ynqxml4p1qsc851izmchzwyysn4w"))))
879 (build-system pyproject-build-system)
880 (arguments (list #:tests? #f)) ;avoid extra test dependencies
881 (propagated-inputs (list python-hatchling python-tomli))
882 (home-page "https://github.com/hynek/hatch-fancy-pypi-readme")
883 (synopsis "Fancy PyPI READMEs with Hatch")
884 (description "This hatch plugin allows defining a project description in
885terms of concatenated fragments that are based on static strings, files and
886parts of files defined using cut-off points or regular expressions.")
887 (license license:expat)))
888
889(define-public python-hatch-requirements-txt
890 (package
891 (name "python-hatch-requirements-txt")
892 (version "0.4.1")
893 (source
894 (origin
895 (method url-fetch)
896 (uri (pypi-uri "hatch_requirements_txt" version))
897 (sha256
898 (base32 "083xakilrmy0ymh34s9wm8x8s7s8vn7ij33xz9avn1gxb1bnws1c"))))
899 (build-system pyproject-build-system)
900 (arguments (list #:tests? #f)) ;avoid extra test dependencies
901 (propagated-inputs (list python-hatchling python-packaging-bootstrap))
902 (home-page "https://github.com/repo-helper/hatch-requirements-txt")
903 (synopsis "Hatchling plugin to read requirements.txt")
904 (description
905 "This package implements a functionality to read project dependencies
906from requirements.txt.")
907 (license license:expat)))
908
909(define-public python-hatch-vcs
910 (package
911 (name "python-hatch-vcs")
912 (version "0.5.0")
913 (source
914 (origin
915 (method url-fetch)
916 (uri (pypi-uri "hatch_vcs" version))
917 (sha256
918 (base32 "1yczh2aqrf9p3gs1dayswz5pp9z2yhmlld0c14ah4d20d49gm583"))))
919 (arguments (list #:tests? #f)) ;avoid extra test dependencies
920 (build-system pyproject-build-system)
921 (propagated-inputs (list python-hatchling python-setuptools-scm))
922 (home-page "https://github.com/ofek/hatch-vcs")
923 (synopsis "Hatch plugin for versioning with your preferred VCS")
924 (description "This package is a plugin for Hatch that uses your preferred
925version control system (like Git) to determine project versions.")
926 (license license:expat)))
927
928(define-public python-installer
929 (package
930 (name "python-installer")
931 (version "0.7.0")
932 (source
933 (origin
934 (method url-fetch)
935 (uri (pypi-uri "installer" version))
936 (sha256
937 (base32 "0cdnqh3a3amw8k4s1pzfjh0hpvzw4pczgl702s1b16r82qqkwvd2"))))
938 (build-system pyproject-build-system)
939 (arguments (list #:tests? #f)) ;avoid extra test dependencies
940 (native-inputs
941 (list python-flit-core))
942 (home-page "https://installer.rtfd.io/")
943 (synopsis "Installer library for Python wheels")
944 (description
945 "This package provides a low-level library for installing a Python
946package from a wheel distribution. It provides basic functionality and
947abstractions for handling wheels and installing packages from wheels.")
948 (license license:expat)))
949
950(define-public python-pdm-backend
951 (package
952 (name "python-pdm-backend")
953 (version "2.4.5")
954 (source
955 (origin
956 (method url-fetch)
957 (uri (pypi-uri "pdm_backend" version))
958 (sha256
959 (base32 "0nzyfa4jb0cpfhh0jfqsk4xz8rbyfyxqrh2ps3axm2ih8321kh2n"))))
960 (build-system pyproject-build-system)
961 (arguments
962 (list
963 #:tests? #f)) ; Depends on pytest, which we cannot import into this module.
964 (home-page "https://pdm-backend.fming.dev/")
965 (synopsis "PEP 517 build backend for PDM")
966 (description
967 "PDM-Backend is a build backend that supports the latest packaging
968standards, which includes PEP 517, PEP 621 and PEP 660.")
969 (license license:expat)))
970