GNU bug report logs - #68147
[PATCH] gnu: Add python-snappy.

Previous Next

Package: guix-patches;

Reported by: Troy Figiel <troy <at> troyfigiel.com>

Date: Sat, 30 Dec 2023 14:41:02 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 68147 in the body.
You can then email your comments to 68147 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#68147; Package guix-patches. (Sat, 30 Dec 2023 14:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Troy Figiel <troy <at> troyfigiel.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 30 Dec 2023 14:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Troy Figiel <troy <at> troyfigiel.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add python-snappy.
Date: Sat, 30 Dec 2023 14:46:40 +0100
* gnu/packages/python-compression.scm (python-snappy): New variable.

Change-Id: I0142f49745104db8458c0becf222eb4088c9ee58
---
 gnu/packages/python-compression.scm | 31 +++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/python-compression.scm b/gnu/packages/python-compression.scm
index bc96bc05d3..364f741392 100644
--- a/gnu/packages/python-compression.scm
+++ b/gnu/packages/python-compression.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2020 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
 ;;; Copyright © 2020, 2022, 2023 Marius Bakke <marius <at> gnu.org>
 ;;; Copyright © 2021 Brendan Tildesley <mail <at> brendan.scot>
+;;; Copyright © 2023 Troy Figiel <troy <at> troyfigiel.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -416,6 +417,36 @@ (define-public python-lzstring
     (description "Lz-string is a string compressor library for Python.")
     (license license:expat)))
 
+(define-public python-snappy
+  (package
+    (name "python-snappy")
+    (version "0.6.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-snappy" version))
+       (sha256
+        (base32 "0amv12w0ybn6n1lk36x70a3l8bdjv4mn7iflb59wqsi00smhg8dn"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (when tests?
+                        (invoke "pytest" "-vv" "-k"
+                                ;; CFFI is only supported for PyPy builds.
+                                (string-append "not test_snappy_cffi_enum "
+                                               "and not test_snappy_all_cffi"))))))))
+    (inputs (list snappy))
+    (native-inputs (list python-pytest))
+    (home-page "https://github.com/andrix/python-snappy")
+    (synopsis "Python bindings for the Snappy compression library")
+    (description
+     "@code{python-snappy} provides bindings to the Snappy library
+and can be used to compress and decompress files and streams.  It can also be
+used directly from the command line.")
+    (license license:bsd-3)))
+
 (define-public bitshuffle
   (package
     (name "bitshuffle")

base-commit: f24b14767d362a84e6469682b4fe303b50f4b589
-- 
2.40.1





Information forwarded to guix-patches <at> gnu.org:
bug#68147; Package guix-patches. (Sat, 30 Dec 2023 14:52:02 GMT) Full text and rfc822 format available.

Message #8 received at 68147 <at> debbugs.gnu.org (full text, mbox):

From: Troy Figiel <troy <at> troyfigiel.com>
To: 68147 <at> debbugs.gnu.org
Subject: Naming collision
Date: Sat, 30 Dec 2023 15:51:29 +0100
[Message part 1 (text/plain, inline)]
Interestingly, both `python-snappy' and `snappy' are available on PyPI
(https://pypi.org/project/snappy/). These are two completely distinct
packages and in this issue I only package `python-snappy'.

If I understand the Python naming rules, if someone were to package
`snappy' in the future, both would be associated to the `python-snappy'
variable in Guix. What would be the best approach to handle this
potential naming collision?

Best wishes,

Troy
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#68147; Package guix-patches. (Sat, 30 Dec 2023 17:23:01 GMT) Full text and rfc822 format available.

Message #11 received at 68147 <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: Troy Figiel <troy <at> troyfigiel.com>
Cc: 68147 <at> debbugs.gnu.org
Subject: Re: Naming collision
Date: Sat, 30 Dec 2023 18:21:55 +0100
[Message part 1 (text/plain, inline)]
On 2023-12-30 15:51:29 +0100, Troy Figiel wrote:
> Interestingly, both `python-snappy' and `snappy' are available on PyPI
> (https://pypi.org/project/snappy/). These are two completely distinct
> packages and in this issue I only package `python-snappy'.
>
> If I understand the Python naming rules, if someone were to package
> `snappy' in the future, both would be associated to the `python-snappy'
> variable in Guix. What would be the best approach to handle this
> potential naming collision?

As far as I can tell, names of PyPI packages in guix are basically formed by
adding `python-' prefix to the PyPI name.  So here the correct name would be
`python-python-snappy'.  I agree that it looks... weird, however it does prevent
the collision.

It will prevent any user confusion, while adhering to a pattern that is already
elsewhere, so I think it is worth it.

Have a nice day,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#68147; Package guix-patches. (Sat, 06 Jan 2024 15:39:02 GMT) Full text and rfc822 format available.

Message #14 received at 68147 <at> debbugs.gnu.org (full text, mbox):

From: Troy Figiel <troy <at> troyfigiel.com>
To: 68147 <at> debbugs.gnu.org
Subject: Re: [bug#68147] Naming collision
Date: Sat, 06 Jan 2024 16:38:33 +0100
Hi Tomas,

I like your approach, I was thinking in the same direction. Having a
slightly more convoluted name would be preferable over having to change
the API later on.

I will submit a new patch with a comment regarding its name. Snappy
seems to be a desired namespace :)

Best wishes,

Troy

Tomas Volf <~@wolfsden.cz> writes:

> On 2023-12-30 15:51:29 +0100, Troy Figiel wrote:
>> Interestingly, both `python-snappy' and `snappy' are available on PyPI
>> (https://pypi.org/project/snappy/). These are two completely distinct
>> packages and in this issue I only package `python-snappy'.
>>
>> If I understand the Python naming rules, if someone were to package
>> `snappy' in the future, both would be associated to the `python-snappy'
>> variable in Guix. What would be the best approach to handle this
>> potential naming collision?
>
> As far as I can tell, names of PyPI packages in guix are basically formed by
> adding `python-' prefix to the PyPI name.  So here the correct name would be
> `python-python-snappy'.  I agree that it looks... weird, however it does prevent
> the collision.
>
> It will prevent any user confusion, while adhering to a pattern that is already
> elsewhere, so I think it is worth it.
>
> Have a nice day,
> Tomas Volf
>
> --
> There are only two hard things in Computer Science:
> cache invalidation, naming things and off-by-one errors.
>
<#secure method=pgpmime mode=sign>




Information forwarded to guix-patches <at> gnu.org:
bug#68147; Package guix-patches. (Sat, 06 Jan 2024 17:25:01 GMT) Full text and rfc822 format available.

Message #17 received at 68147 <at> debbugs.gnu.org (full text, mbox):

From: Troy Figiel <troy <at> troyfigiel.com>
To: 68147 <at> debbugs.gnu.org
Subject: [PATCH v2] gnu: Add python-python-snappy.
Date: Sat, 6 Jan 2024 18:21:53 +0100
* gnu/packages/python-compression.scm (python-python-snappy): New variable.
---
 gnu/packages/python-compression.scm | 34 +++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/python-compression.scm b/gnu/packages/python-compression.scm
index bc96bc05d3..6f249dd3af 100644
--- a/gnu/packages/python-compression.scm
+++ b/gnu/packages/python-compression.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2020 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
 ;;; Copyright © 2020, 2022, 2023 Marius Bakke <marius <at> gnu.org>
 ;;; Copyright © 2021 Brendan Tildesley <mail <at> brendan.scot>
+;;; Copyright © 2023 Troy Figiel <troy <at> troyfigiel.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -416,6 +417,39 @@ (define-public python-lzstring
     (description "Lz-string is a string compressor library for Python.")
     (license license:expat)))
 
+(define-public python-python-snappy
+  (package
+    ;; PyPI contains both `snappy' and `python-snappy' as completely distinct
+    ;; packages. To avoid a name collision in Guix, we use the variable name
+    ;; `python-python-snappy' for the package called `python-snappy' on PyPI.
+    (name "python-python-snappy")
+    (version "0.6.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-snappy" version))
+       (sha256
+        (base32 "0amv12w0ybn6n1lk36x70a3l8bdjv4mn7iflb59wqsi00smhg8dn"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (when tests?
+                        (invoke "pytest" "-vv" "-k"
+                                ;; CFFI is only supported for PyPy builds.
+                                (string-append "not test_snappy_cffi_enum "
+                                               "and not test_snappy_all_cffi"))))))))
+    (inputs (list snappy))
+    (native-inputs (list python-pytest))
+    (home-page "https://github.com/andrix/python-snappy")
+    (synopsis "Python bindings for the Snappy compression library")
+    (description
+     "@code{python-python-snappy} provides bindings to the Snappy library and
+can be used to compress and decompress files and streams.  It can also be used
+directly from the command line.")
+    (license license:bsd-3)))
+
 (define-public bitshuffle
   (package
     (name "bitshuffle")

base-commit: ee0cf3b9ff4cd5a9d3637d09677195ea9ee1a8c0
-- 
2.42.0





Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Tue, 09 Jan 2024 08:56:01 GMT) Full text and rfc822 format available.

Notification sent to Troy Figiel <troy <at> troyfigiel.com>:
bug acknowledged by developer. (Tue, 09 Jan 2024 08:56:01 GMT) Full text and rfc822 format available.

Message #22 received at 68147-done <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Troy Figiel <troy <at> troyfigiel.com>
Cc: 68147-done <at> debbugs.gnu.org
Subject: Re: [bug#68147] [PATCH v2] gnu: Add python-python-snappy.
Date: Tue, 09 Jan 2024 09:55:07 +0100
> * gnu/packages/python-compression.scm (python-python-snappy): New variable.

Applied, thanks,

Mathieu




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 06 Feb 2024 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.