projects/guix·blob wip-node-riscv64 · refs

884 lines · 33.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015, 2024, 2025 Ricardo Wurmus <[email protected]>
3;;; Copyright © 2015, 2020, 2023, 2024 Efraim Flashner <[email protected]>
4;;; Copyright © 2016 Leo Famulari <[email protected]>
5;;; Copyright © 2020, 2023 Marius Bakke <[email protected]>
6;;; Copyright © 2020 Tanguy Le Carrour <[email protected]>
7;;; Copyright © 2018, 2021, 2022, 2023 Maxim Cournoyer <[email protected]>
8;;; Copyright © 2019 Vagrant Cascadian <[email protected]>
9;;; Copyright © 2021 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2020, 2021, 2022, 2023 Ricardo Wurmus <[email protected]>
11;;; Copyright © 2022 Garek Dyszel <[email protected]>
12;;; Copyright © 2022 Greg Hogan <[email protected]>
13;;; Copyright © 2024 David Elsing <[email protected]>
14;;; Copyright © 2024 Zheng Junjie <[email protected]>
15;;; Copyright © 2024 Antero Mejr <[email protected]>
16;;;
17;;; This file is part of GNU Guix.
18;;;
19;;; GNU Guix is free software; you can redistribute it and/or modify it
20;;; under the terms of the GNU General Public License as published by
21;;; the Free Software Foundation; either version 3 of the License, or (at
22;;; your option) any later version.
23;;;
24;;; GNU Guix is distributed in the hope that it will be useful, but
25;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27;;; GNU General Public License for more details.
28;;;
29;;; You should have received a copy of the GNU General Public License
30;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32(define-module (gnu packages python-build)
33 #:use-module (gnu packages)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix build-system python)
36 #:use-module (guix build-system pyproject)
37 #:use-module (guix gexp)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix packages))
41
42;;; Commentary:
43;;;
44;;; Python packages to build... Python packages. Since they are bound to be
45;;; relied on by many, their dependencies should be kept minimal, and this
46;;; module should not depend on other modules containing Python packages.
47;;;
48;;; Code:
49
50
51;;; These are dependencies used by the build systems contained herein; they
52;;; feel a bit out of place but are kept here to prevent circular module
53;;; dependencies.
54(define-public python-pathspec
55 (package
56 (name "python-pathspec")
57 (version "0.11.1")
58 (source
59 (origin
60 (method url-fetch)
61 (uri (pypi-uri "pathspec" version))
62 (sha256
63 (base32
64 "11qnlcanr1mqcpqpq1hmnwrs26csbsa2bafc7biq09x91y0dx617"))))
65 (build-system python-build-system)
66 (home-page "https://github.com/cpburnz/python-pathspec")
67 (synopsis "Utility library for gitignore style pattern matching of file paths")
68 (description
69 "This package provides a utility library for gitignore style pattern
70matching of file paths.")
71 (license license:mpl2.0)))
72
73(define-public python-pluggy
74 (package
75 (name "python-pluggy")
76 (version "1.5.0")
77 (source
78 (origin
79 (method url-fetch)
80 (uri (pypi-uri "pluggy" version))
81 (sha256
82 (base32 "1w8c3mpliqm9biqw75ci8cfj1x5pb6g5zwblqp27ijgxjj7aizrc"))))
83 (build-system python-build-system)
84 (native-inputs
85 (list python-setuptools
86 python-setuptools-scm
87 python-wheel))
88 (home-page "https://pypi.org/project/pluggy/")
89 (synopsis "Plugin and hook calling mechanism for Python")
90 (description
91 "Pluggy is an extraction of the plugin manager as used by Pytest but
92stripped of Pytest specific details.")
93 (license license:expat)))
94
95(define-public python-toml
96 (package
97 (name "python-toml")
98 (version "0.10.2")
99 (source
100 (origin
101 (method url-fetch)
102 (uri (pypi-uri "toml" version))
103 (sha256
104 (base32 "13z6rff86bzdpl094x0vmfvls779931xj90dlbs9kpfm138s3gdk"))))
105 (build-system python-build-system)
106 (arguments
107 `(#:tests? #f)) ;no tests suite in release
108 (home-page "https://github.com/uiri/toml")
109 (synopsis "Library for TOML")
110 (description
111 "@code{toml} is a library for parsing and creating Tom's Obvious, Minimal
112Language (TOML) configuration files.")
113 (license license:expat)))
114
115(define-public python-tomli-w
116 (package
117 (name "python-tomli-w")
118 (version "1.0.0")
119 (source
120 (origin
121 (method url-fetch)
122 (uri (pypi-uri "tomli_w" version))
123 (sha256
124 (base32 "1fg13bfq5qy1ym4x77815nhxh1xpfs0drhn9r9464cz00m1l6qzl"))))
125 (build-system pyproject-build-system)
126 (arguments (list #:tests? #f)) ;to avoid extra dependencies
127 (native-inputs (list python-pypa-build python-flit-core))
128 (home-page "https://github.com/hukkin/tomli-w")
129 (synopsis "Minimal TOML writer")
130 (description "Tomli-W is a Python library for writing TOML. It is a
131write-only counterpart to Tomli, which is a read-only TOML parser.")
132 (license license:expat)))
133
134(define-public python-pytoml
135 (package
136 (name "python-pytoml")
137 (version "0.1.21")
138 (source
139 (origin
140 (method url-fetch)
141 (uri (pypi-uri "pytoml" version))
142 (sha256
143 (base32
144 "1rv1byiw82k7mj6aprcrqi2vdabs801y97xhfnrz7kxds34ggv4f"))))
145 (build-system python-build-system)
146 (home-page "https://github.com/avakar/pytoml")
147 (synopsis "Parser for TOML")
148 (description "This package provides a Python parser for TOML-0.4.0.")
149 (license license:expat)))
150
151(define-public python-six-bootstrap
152 (package
153 (name "python-six-bootstrap")
154 (version "1.16.0")
155 (source
156 (origin
157 (method url-fetch)
158 (uri (pypi-uri "six" version))
159 (sha256
160 (base32
161 "09n9qih9rpj95q3r4a40li7hk6swma11syvgwdc68qm1fxsc6q8y"))))
162 (build-system python-build-system)
163 (arguments `(#:tests? #f)) ;to avoid pytest dependency
164 (home-page "https://pypi.org/project/six/")
165 (synopsis "Python 2 and 3 compatibility utilities")
166 (description
167 "Six is a Python 2 and 3 compatibility library. It provides utility
168functions for smoothing over the differences between the Python versions with
169the goal of writing Python code that is compatible on both Python versions.
170Six supports every Python version since 2.5. It is contained in only one
171Python file, so it can be easily copied into your project.")
172 (license license:x11)))
173
174(define-public python-tomli
175 (package
176 (name "python-tomli")
177 (version "2.1.0")
178 (source
179 (origin
180 (method url-fetch)
181 (uri (pypi-uri "tomli" version))
182 (sha256
183 (base32 "1f4a9nvy8g82bl0k1wdxz9y1j843ai4l4glp0iyy357c5ap6qr1z"))))
184 (build-system pyproject-build-system)
185 (arguments
186 `(#:tests? #f)) ;disabled to avoid extra dependencies
187 (native-inputs (list python-flit-core-bootstrap python-six-bootstrap))
188 (home-page "https://github.com/hukkin/tomli")
189 (synopsis "Small and fast TOML parser")
190 (description "Tomli is a minimal TOML parser that is fully compatible with
191@url{https://toml.io/en/v1.0.0,TOML v1.0.0}. It is about 2.4 times as fast as
192@code{python-toml}.")
193 (license license:expat)))
194
195(define-public python-trove-classifiers
196 (package
197 (name "python-trove-classifiers")
198 (version "2024.10.21.16")
199 (source (origin
200 (method url-fetch)
201 (uri (pypi-uri "trove_classifiers" version))
202 (sha256
203 (base32
204 "1wzmij9b84pixms7nk2fawhvryj355rsi4rjwsfrspkxsrax1jqp"))))
205 (build-system pyproject-build-system)
206 (arguments (list #:build-backend "setuptools.build_meta"
207 #:tests? #f)) ;keep dependencies to a minimum
208 (native-inputs (list python-setuptools python-wheel))
209 (home-page "https://github.com/pypa/trove-classifiers")
210 (synopsis "Canonical source for classifiers on PyPI")
211 (description "This package is the canonical source for classifiers use on
212PyPI (pypi.org).")
213 (license license:asl2.0)))
214
215(define-public python-typing-extensions
216 (package
217 (name "python-typing-extensions")
218 (version "4.12.2")
219 (source (origin
220 (method url-fetch)
221 (uri (pypi-uri "typing_extensions" version))
222 (sha256
223 (base32
224 "1f7z47hmz48kgixzb3ffw6zml8j1iflf6ml8xr6xsng5qxasszhs"))))
225 (build-system pyproject-build-system)
226 ;; Disable the test suite to keep the dependencies to a minimum. Also,
227 ;; the test suite requires Python's test module, not available in Guix.
228 (arguments (list #:tests? #f))
229 (native-inputs (list python-flit-core))
230 (home-page "https://github.com/python/typing_extensions")
231 (synopsis "Experimental type hints for Python")
232 (description
233 "The typing_extensions module contains additional @code{typing} hints not
234yet present in the of the @code{typing} standard library.
235Included are implementations of:
236@enumerate
237@item ClassVar
238@item ContextManager
239@item Counter
240@item DefaultDict
241@item Deque
242@item NewType
243@item NoReturn
244@item overload
245@item Protocol
246@item runtime
247@item Text
248@item Type
249@item TYPE_CHECKING
250@item AsyncGenerator
251@end enumerate\n")
252 (license license:psfl)))
253
254
255;;;
256;;; Python builder packages.
257;;;
258(define-public python-pip
259 (package
260 (name "python-pip")
261 (version "23.1")
262 (source
263 (origin
264 (method url-fetch)
265 (uri (pypi-uri "pip" version))
266 (sha256
267 (base32
268 "0jnk639v9h7ghslm4jnlic6rj3v29nygflx1hgxxndg5gs4kk1a0"))
269 (snippet
270 #~(begin
271 (delete-file "src/pip/_vendor/certifi/cacert.pem")
272 (delete-file "src/pip/_vendor/certifi/core.py")
273 (with-output-to-file "src/pip/_vendor/certifi/core.py"
274 (lambda _
275 (display "\"\"\"
276certifi.py
277~~~~~~~~~~
278This file is a Guix-specific version of core.py.
279
280This module returns the installation location of SSL_CERT_FILE or
281/etc/ssl/certs/ca-certificates.crt, or its contents.
282\"\"\"
283import os
284
285_CA_CERTS = None
286
287try:
288 _CA_CERTS = os.environ [\"SSL_CERT_FILE\"]
289except:
290 _CA_CERTS = os.path.join(\"/etc\", \"ssl\", \"certs\", \"ca-certificates.crt\")
291
292def where() -> str:
293 return _CA_CERTS
294
295def contents() -> str:
296 with open(where(), \"r\", encoding=\"ascii\") as data:
297 return data.read()")))))))
298 (build-system python-build-system)
299 (arguments
300 '(#:tests? #f)) ; there are no tests in the pypi archive.
301 (home-page "https://pip.pypa.io/")
302 (synopsis "Package manager for Python software")
303 (description
304 "Pip is a package manager for Python software, that finds packages on the
305Python Package Index (PyPI).")
306 (license license:expat)))
307
308(define-public python-setuptools
309 (package
310 (name "python-setuptools")
311 (version "67.6.1")
312 (source
313 (origin
314 (method url-fetch)
315 (uri (pypi-uri "setuptools" version))
316 (sha256
317 (base32
318 "16myxkpa89r045il88zcygdy1zbi2mvvpz5b4a70p9jhklmfjz95"))
319 (modules '((guix build utils)))
320 (snippet
321 ;; TODO: setuptools now bundles the following libraries:
322 ;; packaging, pyparsing, six and appdirs. How to unbundle?
323 ;; Remove included binaries which are used to build self-extracting
324 ;; installers for Windows.
325 '(for-each delete-file (find-files "setuptools"
326 "^(cli|gui).*\\.exe$")))))
327 (build-system python-build-system)
328 ;; FIXME: Tests require pytest, which itself relies on setuptools.
329 ;; One could bootstrap with an internal untested setuptools.
330 (arguments (list #:tests? #f))
331 (home-page "https://pypi.org/project/setuptools/")
332 (synopsis "Library designed to facilitate packaging Python projects")
333 (description "Setuptools is a fully-featured, stable library designed to
334facilitate packaging Python projects, where packaging includes:
335@itemize
336@item Python package and module definitions
337@item distribution package metadata
338@item test hooks
339@item project installation
340@item platform-specific details.
341@end itemize")
342 (license (list license:psfl ;setuptools itself
343 license:expat ;six, appdirs, pyparsing
344 license:asl2.0 ;packaging is dual ASL2/BSD-2
345 license:bsd-2))))
346
347;; This is the last version with use_2to3 support.
348(define-public python-setuptools-57
349 (package
350 (inherit python-setuptools)
351 (version "57.5.0")
352 (source (origin
353 (inherit (package-source python-setuptools))
354 (uri (pypi-uri "setuptools" version))
355 (sha256
356 (base32
357 "091sp8lrin7qllrhhx7y0iiv5gdb1d3l8a1ip5knk77ma1njdlyr"))))))
358
359(define-public python-wheel
360 (package
361 (name "python-wheel")
362 (version "0.40.0")
363 (source
364 (origin
365 (method url-fetch)
366 (uri (pypi-uri "wheel" version))
367 (sha256
368 (base32
369 "0ww8fgkvwv35ypj4cnngczdwp6agr4qifvk2inb32azfzbrrc4fd"))))
370 (build-system python-build-system)
371 (arguments
372 ;; FIXME: The test suite runs "python setup.py bdist_wheel", which in turn
373 ;; fails to find the newly-built bdist_wheel library, even though it is
374 ;; available on PYTHONPATH. What search path is consulted by setup.py?
375 '(#:tests? #f))
376 (home-page "https://github.com/pypa/wheel")
377 (synopsis "Format for built Python packages")
378 (description
379 "A wheel is a ZIP-format archive with a specially formatted filename and
380the @code{.whl} extension. It is designed to contain all the files for a PEP
381376 compatible install in a way that is very close to the on-disk format. Many
382packages will be properly installed with only the @code{Unpack} step and the
383unpacked archive preserves enough information to @code{Spread} (copy data and
384scripts to their final locations) at any later time. Wheel files can be
385installed with a newer @code{pip} or with wheel's own command line utility.")
386 (license license:expat)))
387
388;;; TODO: Deprecate with https://github.com/pypa/pyproject-hooks.
389(define-public python-pep517-bootstrap
390 (hidden-package
391 (package
392 (name "python-pep517-bootstrap")
393 (version "0.9.1")
394 (source
395 (origin
396 (method url-fetch)
397 (uri (pypi-uri "pep517" version))
398 (sha256
399 (base32
400 "0zqidxah03qpnp6zkg3zd1kmd5f79hhdsfmlc0cldaniy80qddxf"))))
401 (build-system python-build-system)
402 (arguments
403 `(#:tests? #f)) ;to avoid circular dependencies
404 (propagated-inputs
405 (list python-toml python-wheel))
406 (home-page "https://github.com/pypa/pep517")
407 (synopsis "Wrappers to build Python packages using PEP 517 hooks")
408 (description
409 "Wrappers to build Python packages using PEP 517 hooks.")
410 (license license:expat))))
411
412(define-public python-pyparsing
413 (package
414 (name "python-pyparsing")
415 (version "3.0.6")
416 (source
417 (origin
418 (method url-fetch)
419 (uri (pypi-uri "pyparsing" version))
420 (sha256
421 (base32 "109b9r802wb472hgmxclljprh5cid0w3p6mk9alba7pg2c0frgfr"))))
422 (build-system python-build-system)
423 (outputs '("out" "doc"))
424 (arguments
425 `(#:tests? #f ;no test target
426 #:phases
427 (modify-phases %standard-phases
428 (add-after 'install 'install-doc
429 (lambda* (#:key outputs #:allow-other-keys)
430 (let* ((doc (string-append (assoc-ref outputs "doc")
431 "/share/doc/" ,name "-" ,version))
432 (html-doc (string-append doc "/html"))
433 (examples (string-append doc "/examples")))
434 (mkdir-p html-doc)
435 (mkdir-p examples)
436 (for-each
437 (lambda (dir tgt)
438 (map (lambda (file)
439 (install-file file tgt))
440 (find-files dir ".*")))
441 (list "docs" "htmldoc" "examples")
442 (list doc html-doc examples))))))))
443 (home-page "https://github.com/pyparsing/pyparsing")
444 (synopsis "Python parsing class library")
445 (description
446 "The pyparsing module is an alternative approach to creating and
447executing simple grammars, vs. the traditional lex/yacc approach, or the use
448of regular expressions. The pyparsing module provides a library of classes
449that client code uses to construct the grammar directly in Python code.")
450 (license license:expat)))
451
452;;; This is the last release compatible with Python 2.
453(define-public python-pyparsing-2.4.7
454 (package
455 (inherit python-pyparsing)
456 (version "2.4.7")
457 (source
458 (origin
459 (method url-fetch)
460 (uri (pypi-uri "pyparsing" version))
461 (sha256
462 (base32 "1hgc8qrbq1ymxbwfbjghv01fm3fbpjwpjwi0bcailxxzhf3yq0y2"))))))
463
464(define-public python-packaging-bootstrap
465 (package
466 (name "python-packaging-bootstrap")
467 (version "24.2")
468 (source
469 (origin
470 (method url-fetch)
471 (uri (pypi-uri "packaging" version))
472 (sha256
473 (base32
474 "0zxrq3nn0lmmqp3p2d92v0yqbs29kl87k4vkqmmk8bckbvfaca62"))))
475 (build-system pyproject-build-system)
476 (arguments `(#:tests? #f)) ;disabled to avoid extra dependencies
477 (propagated-inputs
478 (list python-pyparsing python-six-bootstrap))
479 (native-inputs
480 (list python-flit-core))
481 (home-page "https://github.com/pypa/packaging")
482 (synopsis "Core utilities for Python packages")
483 (description "Packaging is a Python module for dealing with Python packages.
484It offers an interface for working with package versions, names, and dependency
485information.")
486 ;; From 'LICENSE': This software is made available under the terms of
487 ;; *either* of the licenses found in LICENSE.APACHE or LICENSE.BSD.
488 ;; Contributions to this software is made under the terms of *both* these
489 ;; licenses.
490 (license (list license:asl2.0 license:bsd-2))))
491
492;;; The name 'python-pypa-build' is chosen rather than 'python-build' to avoid
493;;; a name clash with python-build from (guix build-system python).
494(define-public python-pypa-build
495 (package
496 (name "python-pypa-build")
497 (version "0.7.0")
498 (source (origin
499 (method url-fetch)
500 (uri (pypi-uri "build" version))
501 (sha256
502 (base32
503 "17xqija27x4my1yrnk6q2vwln60r39g2dhby9zg2l99qjgbdrahs"))))
504 (build-system python-build-system)
505 (arguments
506 `(#:tests? #f ;to tests in the PyPI release
507 #:phases (modify-phases %standard-phases
508 (add-after 'unpack 'use-toml-instead-of-tomli
509 ;; Using toml instead of tomli eases bootstrapping.
510 (lambda _
511 (substitute* "setup.cfg"
512 (("tomli>=.*")
513 "toml\n")))))))
514 (propagated-inputs
515 `(("python-packaging" ,python-packaging-bootstrap)
516 ("python-pep517", python-pep517-bootstrap)
517 ("python-toml" ,python-toml)))
518 (home-page "https://pypa-build.readthedocs.io/en/latest/")
519 (synopsis "Simple Python PEP 517 package builder")
520 (description "The @command{build} command invokes the PEP 517 hooks to
521build a distribution package. It is a simple build tool and does not perform
522any dependency management. It aims to keep dependencies to a minimum, in
523order to make bootstrapping easier.")
524 (license license:expat)))
525
526;; There are quite a few amount of Python installers in the wild we need the
527;; one from PyPa team.
528(define-public python-pypa-installer
529 (package
530 (name "python-pypa-installer")
531 (version "0.7.0")
532 (source
533 (origin
534 (method url-fetch)
535 (uri (pypi-uri "installer" version))
536 (sha256
537 (base32 "0cdnqh3a3amw8k4s1pzfjh0hpvzw4pczgl702s1b16r82qqkwvd2"))))
538 (build-system pyproject-build-system)
539 (arguments
540 (list
541 #:tests? #f)) ; Depends on pytest, which we cannot import into this module.
542 (native-inputs
543 (list python-flit-core))
544 (home-page "https://installer.readthedocs.io/")
545 (synopsis "low-level library for installing from a Python wheel distribution")
546 (description
547 "This package provides a library for installing Python wheels.")
548 (license license:expat)))
549
550(define-public python-poetry-core
551 (package
552 (name "python-poetry-core")
553 (version "1.9.1")
554 (source
555 (origin
556 (method url-fetch)
557 (uri (pypi-uri "poetry_core" version))
558 (sha256
559 (base32 "1f31gwhnfyrdymlm0ym6k6c6r0x98zcr2s4xz4blz2zm9chljbbs"))))
560 (build-system pyproject-build-system)
561 (arguments
562 `(#:tests? #f)) ;disabled to avoid extra dependencies
563 (home-page "https://github.com/python-poetry/poetry-core")
564 (synopsis "Poetry PEP 517 build back-end")
565 (description
566 "The @code{poetry-core} module provides a PEP 517 build back-end
567implementation developed for Poetry. This project is intended to be
568a light weight, fully compliant, self-contained package allowing PEP 517
569compatible build front-ends to build Poetry managed projects.")
570 (license license:expat)))
571
572;;; This package exists to bootstrap python-tomli.
573(define-public python-flit-core-bootstrap
574 (package
575 (name "python-flit-core-bootstrap")
576 (version "3.8.0")
577 (source
578 (origin
579 (method url-fetch)
580 (uri (pypi-uri "flit" version))
581 (sha256
582 (base32 "0dz9sp2zlhkmk6sm5gapbbb30f7xq3n3jn5zxx5pkp25ppsaiwnh"))))
583 (build-system python-build-system)
584 (propagated-inputs
585 (list python-toml))
586 (arguments
587 ;; flit-core has a test suite, but it requires Pytest. Disable it so
588 ;; as to not pull pytest as an input.
589 `(#:tests? #f
590 #:phases
591 (modify-phases %standard-phases
592 (replace 'build
593 ;; flit-core requires itself to build. Luckily, a
594 ;; bootstrapping script exists, which does so using just
595 ;; the checkout sources and Python.
596 (lambda _
597 (invoke "python" "flit_core/build_dists.py")))
598 (replace 'install
599 (lambda* (#:key inputs outputs #:allow-other-keys)
600 (let ((out (assoc-ref outputs "out"))
601 (whl (car (find-files "." "\\.whl$"))))
602 (invoke "pip" "--no-cache-dir" "--no-input"
603 "install" "--no-deps" "--prefix" out whl))))
604 ;; The sanity-check phase fails because flit depends on tomli at
605 ;; run-time, but this core variant avoids it to avoid a cycle.
606 (delete 'sanity-check))))
607 (home-page "https://github.com/pypa/flit")
608 (synopsis "Core package of the Flit Python build system")
609 (description "This package provides @code{flit-core}, a PEP 517 build
610backend for packages using Flit. The only public interface is the API
611specified by PEP 517, @code{flit_core.buildapi}.")
612 (license license:bsd-3)))
613
614(define-public python-flit-core
615 (package/inherit python-flit-core-bootstrap
616 (name "python-flit-core")
617 (propagated-inputs
618 (modify-inputs (package-propagated-inputs python-flit-core-bootstrap)
619 (replace "python-toml" python-tomli)))))
620
621(define-public python-flit-scm
622 (package
623 (name "python-flit-scm")
624 (version "1.7.0")
625 (source (origin
626 (method url-fetch)
627 (uri (pypi-uri "flit_scm" version))
628 (sha256
629 (base32
630 "1ckbkykfr7f7wzjzgh0gm7h6v3pqzx2l28rw6dsvl6zk4kxxc6wn"))))
631 (build-system pyproject-build-system)
632 (arguments (list #:tests? #f ;to avoid extra dependencies
633 ;; flit-scm wants to use flit-core, which it renames to
634 ;; 'buildapi', but that isn't found even when adding the
635 ;; current directory to PYTHONPATH. Use setuptools'
636 ;; builder instead.
637 #:build-backend "setuptools.build_meta"))
638 (propagated-inputs (list python-flit-core python-setuptools-scm python-tomli))
639 (native-inputs (list python-setuptools python-wheel))
640 (home-page "https://gitlab.com/WillDaSilva/flit_scm")
641 (synopsis "PEP 518 build backend combining flit_core and setuptools_scm")
642 (description "This package provides a PEP 518 build backend that uses
643@code{setuptools_scm} to generate a version file from your version control
644system, then @code{flit_core} to build the package.")
645 (license license:expat)))
646
647(define-public python-setuptools-scm
648 (package
649 (name "python-setuptools-scm")
650 (version "7.1.0")
651 (source (origin
652 (method url-fetch)
653 (uri (pypi-uri "setuptools_scm" version))
654 (sha256
655 (base32 "09wg4zg30ir1c2cvwqipaz3hwaxz503fgw5zdvaxgakilx2q6l3c"))))
656 (build-system python-build-system)
657 (arguments (list #:tests? #f)) ;avoid extra dependencies such as pytest
658 (propagated-inputs (list python-packaging-bootstrap python-tomli
659 python-typing-extensions))
660 (home-page "https://github.com/pypa/setuptools_scm/")
661 (synopsis "Manage Python package versions in SCM metadata")
662 (description
663 "Setuptools_scm handles managing your Python package versions in
664@dfn{software configuration management} (SCM) metadata instead of declaring
665them as the version argument or in a SCM managed file.")
666 (license license:expat)))
667
668(define-public python-setuptools-scm-next
669 (package
670 (inherit python-setuptools-scm)
671 (name "python-setuptools-scm")
672 (version "8.1.0")
673 (source (origin
674 (method url-fetch)
675 (uri (pypi-uri "setuptools_scm" version))
676 (sha256
677 (base32 "19y84rzqwb2rd88bjrlafrhfail2bnk6apaig8xskjviayva3pj2"))))
678 (build-system pyproject-build-system)
679 (arguments (list
680 ;; pyproject-build-system will error handle forms such as
681 ;; "module:object", so we set it.
682 #:build-backend "setuptools.build_meta"
683 #:phases
684 #~(modify-phases %standard-phases
685 (add-before 'build 'setenv
686 (lambda _
687 ;; pyproject-build-system ignore backend-path,
688 ;; and __import__ ignore GUIX_PYTHONPATH, so set
689 ;; PYTHONPATH.
690 (setenv "PYTHONPATH"
691 (string-append
692 (getcwd)
693 ":"
694 (getcwd) "/src:"
695 (getenv "GUIX_PYTHONPATH"))))))
696 #:tests? #f)) ;avoid extra dependencies such as pytest
697 (native-inputs (list python-setuptools python-wheel))))
698
699(define-public python-editables
700 (package
701 (name "python-editables")
702 (version "0.5")
703 (source (origin
704 (method git-fetch)
705 (uri (git-reference
706 (url "https://github.com/pfmoore/editables")
707 (commit version)))
708 (file-name (git-file-name name version))
709 (sha256
710 (base32
711 "1bp959fz987jvrnkilhyr41fw4g00g9jfyiwmfvy96hv1yl68w8b"))))
712 (build-system pyproject-build-system)
713 (arguments (list #:tests? #f)) ;avoid extra dependencies such as pytest
714 (native-inputs
715 (list python-flit-core))
716 (home-page "https://github.com/pfmoore/editables")
717 (synopsis "Editable installations")
718 (description "This library supports the building of wheels which, when
719installed, will expose packages in a local directory on @code{sys.path} in
720``editable mode''. In other words, changes to the package source will be
721reflected in the package visible to Python, without needing a reinstall.")
722 (license license:expat)))
723
724;; This package may be removed when we have Python 3.11 on board.
725(define-public python-exceptiongroup
726 (package
727 (name "python-exceptiongroup")
728 (version "1.1.1")
729 (source (origin
730 (method git-fetch)
731 (uri (git-reference
732 (url "https://github.com/agronholm/exceptiongroup")
733 (commit version)))
734 (file-name (git-file-name name version))
735 (sha256
736 (base32
737 "0wcvzwgjs0xmggs6dh92jxdqi988gafzh10hrzvw10kasy0xakfj"))))
738 (build-system python-build-system)
739 (arguments
740 (list
741 #:tests? #f ;TODO: Circular dependency on pytest
742 #:phases
743 #~(modify-phases %standard-phases
744 ;; XXX: PEP 517 manual build/install procedures copied from
745 ;; python-isort.
746 (replace 'build
747 (lambda _
748 (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)
749 ;; ZIP does not support timestamps before 1980.
750 (setenv "SOURCE_DATE_EPOCH" "315532800")
751 (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
752 (replace 'install
753 (lambda* (#:key outputs #:allow-other-keys)
754 (let ((whl (car (find-files "dist" "\\.whl$"))))
755 (invoke "pip" "--no-cache-dir" "--no-input"
756 "install" "--no-deps" "--prefix" #$output whl))))
757 (replace 'check
758 (lambda* (#:key tests? #:allow-other-keys)
759 (when tests?
760 (invoke "pytest" "-vv" "tests")))))))
761 (native-inputs (list python-flit-scm python-pypa-build))
762 (home-page "https://github.com/agronholm/exceptiongroup")
763 (synopsis "PEP 654 backport from Python 3.11")
764 (description "This is a backport of the @code{BaseExceptionGroup} and
765@code{ExceptionGroup} classes from Python 3.11.")
766 (license license:expat)))
767
768(define-public python-hatchling
769 (package
770 (name "python-hatchling")
771 (version "1.26.1")
772 (source (origin
773 (method url-fetch)
774 (uri (pypi-uri "hatchling" version))
775 (sha256
776 (base32
777 "1s9lq2x5g5f24j34r7q3zp39wyqwjixfkq8vb4gxzmf5ws96b5cd"))))
778 (build-system pyproject-build-system)
779 (arguments
780 (list #:tests? #f)) ;to keep dependencies to a minimum
781 (propagated-inputs (list python-editables
782 python-packaging-bootstrap
783 python-pathspec
784 python-pluggy
785 python-tomli
786 python-trove-classifiers))
787 (home-page "https://hatch.pypa.io/latest/")
788 (synopsis "Modern, extensible Python build backend")
789 (description "Hatch is a modern, extensible Python project manager. It
790has features such as:
791@itemize
792@item Standardized build system with reproducible builds by default
793@item Robust environment management with support for custom scripts
794@item Easy publishing to PyPI or other indexes
795@item Version management
796@item Configurable project generation with sane defaults
797@item Responsive CLI, ~2-3x faster than equivalent tools.
798@end itemize")
799 (license license:expat)))
800
801(define-public python-hatch-fancy-pypi-readme
802 (package
803 (name "python-hatch-fancy-pypi-readme")
804 (version "22.8.0")
805 (source (origin
806 (method url-fetch)
807 (uri (pypi-uri "hatch_fancy_pypi_readme" version))
808 (sha256
809 (base32
810 "0sn2wsfbpsbf2mqhjvw62h1cfy5mz3d7iqyqvs5c20cnl0n2i4fs"))))
811 (build-system pyproject-build-system)
812 (arguments (list #:tests? #f)) ;avoid extra test dependencies
813 (propagated-inputs (list python-hatchling python-tomli
814 python-typing-extensions))
815 (home-page "https://github.com/hynek/hatch-fancy-pypi-readme")
816 (synopsis "Fancy PyPI READMEs with Hatch")
817 (description "This hatch plugin allows defining a project description in
818terms of concatenated fragments that are based on static strings, files and
819parts of files defined using cut-off points or regular expressions.")
820 (license license:expat)))
821
822(define-public python-hatch-vcs
823 (package
824 (name "python-hatch-vcs")
825 (version "0.3.0")
826 (source (origin
827 (method url-fetch)
828 (uri (pypi-uri "hatch_vcs" version))
829 (sha256
830 (base32
831 "1viz2mdfxfqpsd5f30410q6smj90qfxihvy9idzwd0p4ziy11iff"))))
832 (arguments (list #:tests? #f)) ;avoid extra test dependencies
833 (build-system pyproject-build-system)
834 (propagated-inputs (list python-hatchling python-setuptools-scm))
835 (home-page "https://github.com/ofek/hatch-vcs")
836 (synopsis "Hatch plugin for versioning with your preferred VCS")
837 (description "This package is a plugin for Hatch that uses your preferred
838version control system (like Git) to determine project versions.")
839 (license license:expat)))
840
841(define-public python-installer
842 (package
843 (name "python-installer")
844 (version "0.7.0")
845 (source
846 (origin
847 (method url-fetch)
848 (uri (pypi-uri "installer" version))
849 (sha256
850 (base32 "0cdnqh3a3amw8k4s1pzfjh0hpvzw4pczgl702s1b16r82qqkwvd2"))))
851 (build-system pyproject-build-system)
852 (arguments (list #:tests? #f)) ;avoid extra test dependencies
853 (native-inputs
854 (list python-flit-core))
855 (home-page "https://installer.rtfd.io/")
856 (synopsis "Installer library for Python wheels")
857 (description
858 "This package provides a low-level library for installing a Python
859package from a wheel distribution. It provides basic functionality and
860abstractions for handling wheels and installing packages from wheels.")
861 (license license:expat)))
862
863(define-public python-pdm-backend
864 (package
865 (name "python-pdm-backend")
866 (version "2.4.3")
867 (source (origin
868 (method url-fetch)
869 (uri (pypi-uri "pdm_backend" version))
870 (sha256
871 (base32
872 "0a0741c1g5vxhrizyxh40mjxdmbsc4xid5vy4aji23f1g9x09nfv"))))
873 (build-system pyproject-build-system)
874 (arguments
875 (list
876 #:tests? #f)) ; Depends on pytest, which we cannot import into this module.
877 (home-page "https://pdm-backend.fming.dev/")
878 (synopsis
879 "PEP 517 build backend for PDM")
880 (description
881 "PDM-Backend is a build backend that supports the latest packaging
882standards, which includes PEP 517, PEP 621 and PEP 660.")
883 (license license:expat)))
884