@@ -28,6 +28,7 @@ (define-module (gnu packages python-build)
#:use-module (gnu packages)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system python)
+ #:use-module (guix build-system pyproject)
#:use-module (guix gexp)
#:use-module (guix download)
#:use-module (guix git-download)
@@ -622,3 +623,48 @@ (define-public python-pluggy-next
(sha256
(base32
"0n8iadlas2z1b4h0fc73b043c7iwfvx9rgvqm1azjmffmhxkf922"))))))
+
+(define-public python-hatchling
+ (package
+ (name "python-hatchling")
+ (version "1.13.0")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "hatchling" version))
+ (sha256
+ (base32
+ "1isk1kqra0sm2sj2yp39sgk62mx0bp1jnbkwdcl3a1vjrji7blpq"))))
+ (arguments
+ ;; Tests don't appear to be integrated into build.
+ ;; Also, we can't rely on python-pytest anyway, as that's in
+ ;; (gnu packages python-check)...
+ (list #:tests? #f))
+ (propagated-inputs
+ (list python-editables
+ python-pathspec
+ python-pluggy-next
+ python-tomli))
+ (native-inputs (list python-hatchling-ouroboros))
+ (build-system pyproject-build-system)
+ (home-page "https://hatch.pypa.io/")
+ (synopsis "Modern, extensible Python build backend")
+ (description "Modern, extensible Python build backend")
+ (license license:expat)))
+
+(define python-hatchling-ouroboros
+ (package/inherit python-hatchling
+ (name "python-hatchling-ouroboros")
+ (version (package-version python-hatchling))
+ (arguments
+ (list
+ #:tests? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (delete 'build)
+ (replace 'install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (copy-recursively "src/hatchling/"
+ (string-append (site-packages inputs outputs)
+ "/hatchling")))))))
+ (native-inputs '())))