diff mbox series

[bug#67642,2/5] gnu: Add hatch.

Message ID 524bfa0f56c3f6c46a81e2957adc109baf12b410.1701788624.git.monego@posteo.net
State New
Headers show
Series Add some Python build-related packages. | expand

Commit Message

Vinicius Monego Dec. 5, 2023, 3:21 p.m. UTC
* gnu/packages/python-xyz.scm (hatch): New variable.

Change-Id: Iff0f0e8e8451277e468b7c3054540eca8d25e321
---
 gnu/packages/python-xyz.scm | 77 +++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

Comments

Simon Tournier Feb. 27, 2024, 1:14 p.m. UTC | #1
Hi,

On mar., 05 déc. 2023 at 15:21, Vinicius Monego <monego@posteo.net> wrote:

> +(define-public hatch
> +  (package
> +    (name "hatch")
> +    (version "1.7.0")

Following a question in Café Guix, I am giving a look at this.  And I
see that bug#58310 [1] has:

        +    (name "python-hatch")
        +    (version "1.10.0")

It leads to two questions:

 1. Why the just name “hatch” and not “python-hatch”?

 2. Why 1.7.0 and not 1.10.0 or higher?


1: [bug#58310] [PATCH 05/14] gnu: Add python-hatch.
Garek Dyszel via Guix-patches via <guix-patches@gnu.org>
Wed, 05 Oct 2022 13:46:04 -0400
id:878rluqi3n.fsf@disroot.org
https://issues.guix.gnu.org/58310
https://issues.guix.gnu.org/msgid/878rluqi3n.fsf@disroot.org
https://yhetil.org/guix/878rluqi3n.fsf@disroot.org


Cheers,
simon
Vinicius Monego March 12, 2024, 9:15 p.m. UTC | #2
Hi Simon,

Em 27/02/2024 10:14, Simon Tournier escreveu:
> Hi,
>
> On mar., 05 déc. 2023 at 15:21, Vinicius Monego <monego@posteo.net> wrote:
>
>> +(define-public hatch
>> +  (package
>> +    (name "hatch")
>> +    (version "1.7.0")
> Following a question in Café Guix, I am giving a look at this.  And I
> see that bug#58310 [1] has:
>
>          +    (name "python-hatch")
>          +    (version "1.10.0")
>
> It leads to two questions:
>
>   1. Why the just name “hatch” and not “python-hatch”?

I remember a convention to name applications without the python- prefix, 
it was only used for libraries. See the pre-commit, gunicorn, hypercorn 
packages for instance.

>
>   2. Why 1.7.0 and not 1.10.0 or higher?
>
>
> 1: [bug#58310] [PATCH 05/14] gnu: Add python-hatch.
> Garek Dyszel via Guix-patches via <guix-patches@gnu.org>
> Wed, 05 Oct 2022 13:46:04 -0400
> id:878rluqi3n.fsf@disroot.org
> https://issues.guix.gnu.org/58310
> https://issues.guix.gnu.org/msgid/878rluqi3n.fsf@disroot.org
> https://yhetil.org/guix/878rluqi3n.fsf@disroot.org
>
>
> Cheers,
> simon

Looking at the date (2022-10-05), that patch seems to introduce 
python-hatchling and not python-hatch. Hatchling 1.10.0 was released on 
2022-09-19. The latest version of Hatch is 1.9.4, which was released 17 
hours ago. Both packages are tagged in the same repository [1], but are 
distinct packages. Hatchling is the build backend while hatch is a 
Python project management tool.

Vinicius

[1] https://github.com/pypa/hatch/releases
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c233479e0c..28dbea691f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -30028,6 +30028,83 @@  (define-public python-userpath
     (description "This package provides a tool for modifying a user's PATH.")
     (license license:expat)))
 
+(define-public hatch
+  (package
+    (name "hatch")
+    (version "1.7.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "hatch" version))
+       (sha256
+        (base32 "0ipvj1pxdb6wb1sblh22h9gnh6byjnwcl7hfcnk88dmkslgp1z3s"))
+       (modules '((guix build utils)))
+       (snippet '(substitute* "pyproject.toml"
+                   ;; We have virtualenv 20.3.1.
+                   (("virtualenv>=20.16.2")
+                    "virtualenv>=20.3.1")))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:test-flags
+      ;; XXX: tests below fail due to zipfile reporting incorrect zip dates.
+      #~(list "-k"
+              (string-append
+               "not "
+               (string-join
+                (list "test_default"
+                      "test_explicit_path"
+                      "test_editable_default"
+                      "test_editable_default_dependencies"
+                      "test_editable_default_force_include"
+                      "test_editable_default_force_include_option"
+                      "test_editable_exact"
+                      "test_editable_exact_extra_dependencies"
+                      "test_editable_exact_force_include"
+                      "test_editable_exact_force_include_option"
+                      "test_editable_exact_force_include_build_data_precedence"
+                      "test_editable_pth")
+                " and not ")))
+           #:phases #~(modify-phases %standard-phases
+                        (add-before 'check 'pre-check
+                          (lambda _
+                            (setenv "HOME" "/tmp"))))))
+    (native-inputs (list git-minimal
+                         python-pytest
+                         python-pytest-mock
+                         python-pytest-xdist))
+    (propagated-inputs (list python-click
+                             python-hatchling
+                             python-httpx
+                             python-hyperlink
+                             python-keyring
+                             python-packaging
+                             python-pexpect
+                             python-platformdirs
+                             python-pyperclip
+                             python-rich
+                             python-shellingham
+                             python-tomli-w
+                             python-tomlkit
+                             python-userpath
+                             python-virtualenv))
+    (home-page "https://hatch.pypa.io/latest/")
+    (synopsis "Python project management")
+    (description "Hatch is a modern, extensible Python project manager.
+
+Features
+
+@itemize
+@item Standardized build system with reproducible builds by default
+@item Robust environment management with support for custom scripts
+@item Configurable Python distribution management
+@item Easy publishing to PyPI or other indexes
+@item Version management
+@item Configurable project generation with sane defaults
+@item Responsive CLI, ~2-3x faster than equivalent tools
+@end itemize")
+    (license license:expat)))
+
 (define-public python-nestedtext
   (package
     (name "python-nestedtext")