@@ -30771,3 +30771,67 @@ (define-public python-version
"This package provides a simple utility for checking the python version.")
;; MIT License
(license license:expat))))
+
+(define-public python-hatchling
+ (package
+ (name "python-hatchling")
+ (version "1.8.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/pypa/hatch")
+ (commit (string-append "hatchling-v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1q25kqw71g8mjwfjz9ph0iigdqa26zzxgmqm0v0bp0z1j8rcl237"))))
+ ;; python-pypa-build needed for bootstrapping.
+ ;; Otherwise we get a circular reference:
+ ;; python-hatchling trying to build itself, without
+ ;; first having hatchling installed.
+ (inputs (list python
+ python-pypa-build
+ python-editables
+ python-importlib-metadata
+ python-version
+ python-packaging-next
+ python-pathspec
+ python-pluggy-1.0 ; TODO: Not detected by pytest?
+ python-tomli
+ python-platformdirs))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ ;; Copied directly from the build process for
+ ;; python-jsonschema-next.
+ (replace 'build
+ (lambda _
+ (chdir "backend")
+ ;; ZIP does not support timestamps before 1980.
+ (setenv "SOURCE_DATE_EPOCH" "315532800")
+ (invoke "python"
+ "-m"
+ "build"
+ "--wheel"
+ "--no-isolation"
+ ".")))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((whl (car (find-files "dist" "\\.whl$"))))
+ (invoke "pip"
+ "--no-cache-dir"
+ "--no-input"
+ "install"
+ "--no-deps"
+ "--prefix"
+ (assoc-ref %outputs "out")
+ whl))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "pytest" "-vv")))))))
+ (home-page "https://ofek.dev/projects/hatch/")
+ (synopsis "Modern, extensible Python project management")
+ (description "Modern, extensible Python project management")
+ ;; MIT License
+ (license license:expat)))