projects/guix·blob dexed · refs

992 lines · 36.1 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-public python-setuptools-79
396 (package
397 (inherit python-setuptools)
398 (name "python-setuptools")
399 (version "79.0.1")
400 (source
401 (origin
402 (inherit (package-source python-setuptools))
403 (method url-fetch)
404 (uri (pypi-uri "setuptools" version))
405 (sha256
406 (base32 "127svm8cdpvmq37gcrbvdr9fhrhs0nscnzh63gypjc1wyfwfg30j"))))))
407
408(define-deprecated/public-alias python-setuptools-next
409 python-setuptools) ;may be removed after 2025-12-01
410
411(define-public python-wheel
412 (package
413 (name "python-wheel")
414 (version "0.46.1")
415 (source
416 (origin
417 (method url-fetch)
418 (uri (pypi-uri "wheel" version))
419 (sha256
420 (base32 "0f3abrpkf3spv0lk5mhv8m2ch0j074a3rivn7hfxzxx0bpxpwizx"))))
421 (build-system pyproject-build-system)
422 (arguments
423 ;; FIXME: The test suite runs "python setup.py bdist_wheel", which in turn
424 ;; fails to find the newly-built bdist_wheel library, even though it is
425 ;; available on PYTHONPATH. What search path is consulted by setup.py?
426 '(#:tests? #f))
427 (native-inputs
428 (list python-flit-core))
429 (home-page "https://github.com/pypa/wheel")
430 (synopsis "Format for built Python packages")
431 (description
432 "A wheel is a ZIP-format archive with a specially formatted filename and
433the @code{.whl} extension. It is designed to contain all the files for a PEP
434376 compatible install in a way that is very close to the on-disk format. Many
435packages will be properly installed with only the @code{Unpack} step and the
436unpacked archive preserves enough information to @code{Spread} (copy data and
437scripts to their final locations) at any later time. Wheel files can be
438installed with a newer @code{pip} or with wheel's own command line utility.")
439 (license license:expat)))
440
441(define-public python-wheel-0.40
442 (package
443 (inherit python-wheel)
444 (version "0.40.0")
445 (source
446 (origin
447 (method url-fetch)
448 (uri (pypi-uri "wheel" version))
449 (sha256
450 (base32 "0ww8fgkvwv35ypj4cnngczdwp6agr4qifvk2inb32azfzbrrc4fd"))))))
451
452;;; TODO: Deprecate with https://github.com/pypa/pyproject-hooks.
453;;;
454;;; From PyPI web page: The core of this package has been renamed to
455;;; pyproject-hooks (https://pyproject-hooks.readthedocs.io). Please use that
456;;; package or build (https://pypa-build.readthedocs.io/en/stable/) in place
457;;; of pep517.
458(define-public python-pep517-bootstrap
459 (hidden-package
460 (package
461 (name "python-pep517-bootstrap")
462 (version "0.13.1")
463 (source
464 (origin
465 (method url-fetch)
466 (uri (pypi-uri "pep517" version))
467 (sha256
468 (base32 "05xk0x7b5n7zmcqrznm4lnbakgdjpin19mp5zyzb92wksgzs4bqv"))))
469 (build-system pyproject-build-system)
470 (arguments
471 `(#:tests? #f)) ;to avoid circular dependencies
472 (native-inputs (list python-flit-core))
473 (home-page "https://github.com/pypa/pep517")
474 (synopsis "Wrappers to build Python packages using PEP 517 hooks")
475 (description
476 "Wrappers to build Python packages using PEP 517 hooks.")
477 (license license:expat))))
478
479(define-public python-pyparsing
480 (package
481 (name "python-pyparsing")
482 (version "3.2.3")
483 (source
484 (origin
485 (method url-fetch)
486 (uri (pypi-uri "pyparsing" version))
487 (sha256
488 (base32 "1giqgjknzbbh34qf8ij5rsrqlxfysjx39xi85vvl5ddkp0d3zhdr"))))
489 (build-system pyproject-build-system)
490 (outputs '("out" "doc"))
491 (arguments
492 `(#:tests? #f ;no test target
493 #:phases
494 (modify-phases %standard-phases
495 (add-after 'install 'install-doc
496 (lambda* (#:key outputs #:allow-other-keys)
497 (let* ((doc (string-append (assoc-ref outputs "doc")
498 "/share/doc/" ,name "-" ,version))
499 (html-doc (string-append doc "/html"))
500 (examples (string-append doc "/examples")))
501 (mkdir-p html-doc)
502 (mkdir-p examples)
503 (for-each
504 (lambda (dir tgt)
505 (map (lambda (file)
506 (install-file file tgt))
507 (find-files dir ".*")))
508 (list "docs" "htmldoc" "examples")
509 (list doc html-doc examples))))))))
510 (native-inputs (list python-flit-core))
511 (home-page "https://github.com/pyparsing/pyparsing")
512 (synopsis "Python parsing class library")
513 (description
514 "The pyparsing module is an alternative approach to creating and
515executing simple grammars, vs. the traditional lex/yacc approach, or the use
516of regular expressions. The pyparsing module provides a library of classes
517that client code uses to construct the grammar directly in Python code.")
518 (license license:expat)))
519
520(define-public python-packaging-bootstrap
521 (package
522 (name "python-packaging-bootstrap")
523 (version "25.0")
524 (source
525 (origin
526 (method url-fetch)
527 (uri (pypi-uri "packaging" version))
528 (sha256
529 (base32 "0kzwn2ar4ndm90qrvgyjcbkqz3klrg0ziwm1yrhbyxynk0n8fhyl"))))
530 (build-system pyproject-build-system)
531 (arguments `(#:tests? #f)) ;disabled to avoid extra dependencies
532 (native-inputs
533 (list python-flit-core))
534 (home-page "https://github.com/pypa/packaging")
535 (synopsis "Core utilities for Python packages")
536 (description "Packaging is a Python module for dealing with Python packages.
537It offers an interface for working with package versions, names, and dependency
538information.")
539 ;; From 'LICENSE': This software is made available under the terms of
540 ;; *either* of the licenses found in LICENSE.APACHE or LICENSE.BSD.
541 ;; Contributions to this software is made under the terms of *both* these
542 ;; licenses.
543 (license (list license:asl2.0 license:bsd-2))))
544
545;;; The name 'python-pypa-build' is chosen rather than 'python-build' to avoid
546;;; a name clash with python-build from (guix build-system python).
547(define-public python-pypa-build
548 (package
549 (name "python-pypa-build")
550 ;; Newer version needs more inputs, consider to move to python-xyz.
551 (version "0.9.0")
552 (source
553 (origin
554 (method url-fetch)
555 (uri (pypi-uri "build" version))
556 (sha256
557 (base32 "0g5w28ban6k9qywqwdqiqms3crg75rsvfphl4f4qkg8wi57741qs"))))
558 (build-system pyproject-build-system)
559 (arguments `(#:tests? #f)) ;disabled to avoid extra dependencies
560 (native-inputs
561 (list python-setuptools))
562 (propagated-inputs
563 (list python-packaging-bootstrap
564 python-pep517-bootstrap
565 python-toml))
566 (home-page "https://pypa-build.readthedocs.io/en/latest/")
567 (synopsis "Simple Python PEP 517 package builder")
568 (description "The @command{build} command invokes the PEP 517 hooks to
569build a distribution package. It is a simple build tool and does not perform
570any dependency management. It aims to keep dependencies to a minimum, in
571order to make bootstrapping easier.")
572 (license license:expat)))
573
574;; There are quite a few amount of Python installers in the wild we need the
575;; one from PyPa team.
576(define-public python-pypa-installer
577 (package
578 (name "python-pypa-installer")
579 (version "0.7.0")
580 (source
581 (origin
582 (method url-fetch)
583 (uri (pypi-uri "installer" version))
584 (sha256
585 (base32 "0cdnqh3a3amw8k4s1pzfjh0hpvzw4pczgl702s1b16r82qqkwvd2"))))
586 (build-system pyproject-build-system)
587 (arguments
588 (list
589 #:tests? #f)) ; Depends on pytest, which we cannot import into this module.
590 (native-inputs
591 (list python-flit-core))
592 (home-page "https://installer.readthedocs.io/")
593 (synopsis "low-level library for installing from a Python wheel distribution")
594 (description
595 "This package provides a library for installing Python wheels.")
596 (license license:expat)))
597
598(define-public python-poetry-core
599 (package
600 (name "python-poetry-core")
601 (version "2.1.3")
602 (source
603 (origin
604 (method url-fetch)
605 (uri (pypi-uri "poetry_core" version))
606 (sha256
607 (base32 "194nwaig8zkbj2ig4zwf1k7cl4vqlmvs8mmdkb425mky8was08h5"))))
608 (build-system pyproject-build-system)
609 (arguments
610 `(#:tests? #f)) ;disabled to avoid extra dependencies
611 (home-page "https://github.com/python-poetry/poetry-core")
612 (synopsis "Poetry PEP 517 build back-end")
613 (description
614 "The @code{poetry-core} module provides a PEP 517 build back-end
615implementation developed for Poetry. This project is intended to be
616a light weight, fully compliant, self-contained package allowing PEP 517
617compatible build front-ends to build Poetry managed projects.")
618 (license license:expat)))
619
620(define-deprecated/public-alias python-poetry-core-next
621 python-poetry-core) ;may be removed after 2025-12-01
622
623;;; This package exists to bootstrap python-tomli.
624(define-public python-flit-core-bootstrap
625 (package
626 (name "python-flit-core-bootstrap")
627 (version "3.12.0")
628 (source
629 (origin
630 (method url-fetch)
631 (uri (pypi-uri "flit" version))
632 (sha256
633 (base32 "0h1pxi2hgr95321bgl45l86693zl14l3shj0idsyg4k9v56z700w"))))
634 (build-system pyproject-build-system)
635 (arguments
636 (list
637 ;; flit-core has a test suite, but it requires Pytest. Disable it so
638 ;; as to not pull pytest as an input.
639 #:tests? #f
640 #:phases
641 #~(modify-phases %standard-phases
642 (add-after 'unpack 'fix-license
643 ;; flit_core bundles the 'tomli' TOML parser, to avoid a
644 ;; bootstrapping problem. See
645 ;; <https://github.com/pypa/packaging-problems/issues/342>.
646 (lambda _
647 (delete-file-recursively "flit_core/flit_core/vendor")
648 (substitute* "flit_core/pyproject.toml"
649 (("license-files.*") "license-files = [\"LICENSE*\"]\n"))))
650 (replace 'build
651 ;; flit-core requires itself to build. Luckily, a
652 ;; bootstrapping script exists, which does so using just
653 ;; the checkout sources and Python.
654 (lambda _
655 (chdir "flit_core")
656 (invoke "python" "build_dists.py")))
657 (delete 'sanity-check))))
658 (propagated-inputs
659 (list python-toml))
660 (home-page "https://github.com/pypa/flit")
661 (synopsis "Core package of the Flit Python build system")
662 (description "This package provides @code{flit-core}, a PEP 517 build
663backend for packages using Flit. The only public interface is the API
664specified by PEP 517, @code{flit_core.buildapi}.")
665 (license license:bsd-3)))
666
667(define-public python-flit-core
668 (package/inherit python-flit-core-bootstrap
669 (name "python-flit-core")
670 (propagated-inputs
671 (modify-inputs (package-propagated-inputs python-flit-core-bootstrap)
672 (delete "python-toml")
673 (prepend python-tomli)))))
674
675(define-deprecated/public-alias python-flit-core-next
676 python-flit-core) ;may be removed after 2025-12-01
677
678(define-public python-flit-scm
679 (package
680 (name "python-flit-scm")
681 (version "1.7.0")
682 (source
683 (origin
684 (method url-fetch)
685 (uri (pypi-uri "flit_scm" version))
686 (sha256
687 (base32 "1ckbkykfr7f7wzjzgh0gm7h6v3pqzx2l28rw6dsvl6zk4kxxc6wn"))))
688 (build-system pyproject-build-system)
689 (arguments
690 (list
691 #:tests? #f ;no tests in PyPI archive or Git checkout
692 #:phases
693 #~(modify-phases %standard-phases
694 (add-after 'unpack 'fix-backend
695 ;; flit_scm imports flit_core's buildapi and tries to make it
696 ;; available as "flit_scm:buildapi", see comment in
697 ;; <flit_scm/__init__.py>; but it fails during build phase with
698 ;; error: ModuleNotFoundError: No module named
699 ;; 'flit_scm:buildapi'.
700 ;;
701 ;; Use flit_core.buildapi directly to build flit_scm.
702 (lambda _
703 (substitute* "pyproject.toml"
704 (("flit_scm:buildapi") "flit_core.buildapi")))))))
705 (propagated-inputs
706 (list python-flit-core
707 python-setuptools-scm
708 python-tomli))
709 (home-page "https://gitlab.com/WillDaSilva/flit_scm")
710 (synopsis "PEP 518 build backend combining flit_core and setuptools_scm")
711 (description "This package provides a PEP 518 build backend that uses
712@code{setuptools_scm} to generate a version file from your version control
713system, then @code{flit_core} to build the package.")
714 (license license:expat)))
715
716(define-public python-setuptools-scm
717 (package
718 (name "python-setuptools-scm")
719 (version "8.3.1")
720 (source
721 (origin
722 (method url-fetch)
723 (uri (pypi-uri "setuptools_scm" version))
724 (sha256
725 (base32 "0qra4jysbdwlrwsb5iz8kai1xxbsz6adzbrbscvx1b2xny95wm9x"))))
726 (build-system pyproject-build-system)
727 (arguments
728 (list
729 #:tests? #f ;avoid extra dependencies such as pytest
730 ;; pyproject-build-system will error handle forms such as
731 ;; "module:object", so we set it.
732 #:build-backend "setuptools.build_meta"))
733 (propagated-inputs
734 (list python-packaging-bootstrap
735 python-setuptools))
736 (home-page "https://github.com/pypa/setuptools_scm/")
737 (synopsis "Manage Python package versions in SCM metadata")
738 (description
739 "Setuptools_scm handles managing your Python package versions in
740@dfn{software configuration management} (SCM) metadata instead of declaring
741them as the version argument or in a SCM managed file.")
742 (license license:expat)))
743
744(define-public python-setuptools-scm-next
745 (package
746 (inherit python-setuptools-scm)
747 (name "python-setuptools-scm")
748 (version "9.2.2")
749 (source
750 (origin
751 (method url-fetch)
752 (uri (pypi-uri "setuptools_scm" version))
753 (sha256
754 (base32 "0mzgyyg1cgigkmlfm0iy44f2092zn8xc093ygn4a11jncss4lrqw"))))))
755
756(define-public python-editables
757 (package
758 (name "python-editables")
759 (version "0.5")
760 (source (origin
761 (method git-fetch)
762 (uri (git-reference
763 (url "https://github.com/pfmoore/editables")
764 (commit version)))
765 (file-name (git-file-name name version))
766 (sha256
767 (base32
768 "1bp959fz987jvrnkilhyr41fw4g00g9jfyiwmfvy96hv1yl68w8b"))))
769 (build-system pyproject-build-system)
770 (arguments (list #:tests? #f)) ;avoid extra dependencies such as pytest
771 (native-inputs
772 (list python-flit-core))
773 (home-page "https://github.com/pfmoore/editables")
774 (synopsis "Editable installations")
775 (description "This library supports the building of wheels which, when
776installed, will expose packages in a local directory on @code{sys.path} in
777``editable mode''. In other words, changes to the package source will be
778reflected in the package visible to Python, without needing a reinstall.")
779 (license license:expat)))
780
781;; This package may be removed when we have Python 3.11 on board.
782(define-public python-exceptiongroup
783 (package
784 (name "python-exceptiongroup")
785 (version "1.3.0")
786 (source
787 (origin
788 (method git-fetch)
789 (uri (git-reference
790 (url "https://github.com/agronholm/exceptiongroup")
791 (commit version)))
792 (file-name (git-file-name name version))
793 (sha256
794 (base32 "1kygngc6j7hm68w8q327jvym2z4gpyh93g2af6g419qaqqv7axkg"))))
795 (build-system pyproject-build-system)
796 (arguments
797 (list
798 #:tests? #f ;to keep dependencies to a minimum
799 #:build-backend "setuptools.build_meta"
800 #:phases
801 #~(modify-phases %standard-phases
802 (add-before 'build 'set-version
803 (lambda _
804 (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version))))))
805 (native-inputs
806 (list python-flit-scm))
807 (propagated-inputs
808 (list python-typing-extensions))
809 (home-page "https://github.com/agronholm/exceptiongroup")
810 (synopsis "PEP 654 backport from Python 3.11")
811 (description "This is a backport of the @code{BaseExceptionGroup} and
812@code{ExceptionGroup} classes from Python 3.11.")
813 (license license:expat)))
814
815(define-public python-hatchling
816 (package
817 (name "python-hatchling")
818 (version "1.27.0")
819 (source
820 (origin
821 (method url-fetch)
822 (uri (pypi-uri "hatchling" version))
823 (sha256
824 (base32 "1mhzjhg7ky8npcrnbwwq30w8s73mm73m5z0j260v7aqrk1njj74p"))))
825 (build-system pyproject-build-system)
826 (arguments
827 (list #:tests? #f)) ;to keep dependencies to a minimum
828 (propagated-inputs
829 (list python-packaging-bootstrap
830 python-pathspec
831 python-pluggy
832 python-tomli
833 python-trove-classifiers))
834 (home-page "https://hatch.pypa.io/latest/")
835 (synopsis "Modern, extensible Python build backend")
836 (description "Hatch is a modern, extensible Python project manager. It
837has features such as:
838@itemize
839@item Standardized build system with reproducible builds by default
840@item Robust environment management with support for custom scripts
841@item Easy publishing to PyPI or other indexes
842@item Version management
843@item Configurable project generation with sane defaults
844@item Responsive CLI, ~2-3x faster than equivalent tools.
845@end itemize")
846 (license license:expat)))
847
848(define-public python-hatchling-for-hatch
849 ;; For [email protected], remove when no longer required.
850 (hidden-package
851 (package
852 (inherit python-hatchling)
853 (version "1.21.1")
854 (source
855 (origin
856 (method url-fetch)
857 (uri (pypi-uri "hatchling" version))
858 (sha256
859 (base32 "1g40g68vzfakddd9f0psp9jkfqy3v3la4zs5g127ski2792l195v"))))
860 (propagated-inputs
861 (list python-editables
862 python-packaging-bootstrap
863 python-pathspec
864 python-pluggy
865 python-trove-classifiers)))))
866
867(define-public python-hatch-docstring-description
868 (package
869 (name "python-hatch-docstring-description")
870 (version "1.1.1")
871 (source
872 (origin
873 (method url-fetch)
874 (uri (pypi-uri "hatch_docstring_description" version))
875 (sha256
876 (base32 "1qwa8m4yswn0bkc5xzq30xsaca578axl5ig2r6mkcdxsfg196pdi"))))
877 (build-system pyproject-build-system)
878 (arguments (list #:tests? #f)) ;avoid extra test dependencies
879 (native-inputs
880 (list python-hatch-vcs
881 python-hatchling))
882 (propagated-inputs
883 (list python-hatchling))
884 (home-page "https://github.com/flying-sheep/hatch-docstring-description")
885 (synopsis "Derive PyPI package description from Python package docstring ")
886 (description
887 "This package provides a Hatchling plugin to read the description from the
888package docstring.")
889 (license license:gpl3+)))
890
891(define-public python-hatch-fancy-pypi-readme
892 (package
893 (name "python-hatch-fancy-pypi-readme")
894 (version "25.1.0")
895 (source
896 (origin
897 (method url-fetch)
898 (uri (pypi-uri "hatch_fancy_pypi_readme" version))
899 (sha256
900 (base32 "0i803kq80qx0k1lj3z69zw40ynqxml4p1qsc851izmchzwyysn4w"))))
901 (build-system pyproject-build-system)
902 (arguments (list #:tests? #f)) ;avoid extra test dependencies
903 (propagated-inputs (list python-hatchling python-tomli))
904 (home-page "https://github.com/hynek/hatch-fancy-pypi-readme")
905 (synopsis "Fancy PyPI READMEs with Hatch")
906 (description "This hatch plugin allows defining a project description in
907terms of concatenated fragments that are based on static strings, files and
908parts of files defined using cut-off points or regular expressions.")
909 (license license:expat)))
910
911(define-public python-hatch-requirements-txt
912 (package
913 (name "python-hatch-requirements-txt")
914 (version "0.4.1")
915 (source
916 (origin
917 (method url-fetch)
918 (uri (pypi-uri "hatch_requirements_txt" version))
919 (sha256
920 (base32 "083xakilrmy0ymh34s9wm8x8s7s8vn7ij33xz9avn1gxb1bnws1c"))))
921 (build-system pyproject-build-system)
922 (arguments (list #:tests? #f)) ;avoid extra test dependencies
923 (propagated-inputs (list python-hatchling python-packaging-bootstrap))
924 (home-page "https://github.com/repo-helper/hatch-requirements-txt")
925 (synopsis "Hatchling plugin to read requirements.txt")
926 (description
927 "This package implements a functionality to read project dependencies
928from requirements.txt.")
929 (license license:expat)))
930
931(define-public python-hatch-vcs
932 (package
933 (name "python-hatch-vcs")
934 (version "0.5.0")
935 (source
936 (origin
937 (method url-fetch)
938 (uri (pypi-uri "hatch_vcs" version))
939 (sha256
940 (base32 "1yczh2aqrf9p3gs1dayswz5pp9z2yhmlld0c14ah4d20d49gm583"))))
941 (arguments (list #:tests? #f)) ;avoid extra test dependencies
942 (build-system pyproject-build-system)
943 (propagated-inputs (list python-hatchling python-setuptools-scm))
944 (home-page "https://github.com/ofek/hatch-vcs")
945 (synopsis "Hatch plugin for versioning with your preferred VCS")
946 (description "This package is a plugin for Hatch that uses your preferred
947version control system (like Git) to determine project versions.")
948 (license license:expat)))
949
950(define-public python-installer
951 (package
952 (name "python-installer")
953 (version "0.7.0")
954 (source
955 (origin
956 (method url-fetch)
957 (uri (pypi-uri "installer" version))
958 (sha256
959 (base32 "0cdnqh3a3amw8k4s1pzfjh0hpvzw4pczgl702s1b16r82qqkwvd2"))))
960 (build-system pyproject-build-system)
961 (arguments (list #:tests? #f)) ;avoid extra test dependencies
962 (native-inputs
963 (list python-flit-core))
964 (home-page "https://installer.rtfd.io/")
965 (synopsis "Installer library for Python wheels")
966 (description
967 "This package provides a low-level library for installing a Python
968package from a wheel distribution. It provides basic functionality and
969abstractions for handling wheels and installing packages from wheels.")
970 (license license:expat)))
971
972(define-public python-pdm-backend
973 (package
974 (name "python-pdm-backend")
975 (version "2.4.5")
976 (source
977 (origin
978 (method url-fetch)
979 (uri (pypi-uri "pdm_backend" version))
980 (sha256
981 (base32 "0nzyfa4jb0cpfhh0jfqsk4xz8rbyfyxqrh2ps3axm2ih8321kh2n"))))
982 (build-system pyproject-build-system)
983 (arguments
984 (list
985 #:tests? #f)) ; Depends on pytest, which we cannot import into this module.
986 (home-page "https://pdm-backend.fming.dev/")
987 (synopsis "PEP 517 build backend for PDM")
988 (description
989 "PDM-Backend is a build backend that supports the latest packaging
990standards, which includes PEP 517, PEP 621 and PEP 660.")
991 (license license:expat)))
992