[PATCH] gnu: Add python-murmurhash3

DoneSubmitted by Artyom V. Poptsov.
Details
2 participants
  • Ludovic Courtès
  • Artyom V. Poptsov
Owner
unassigned
Severity
normal
A
A
Artyom V. Poptsov wrote on 14 May 11:01 +0200
(address . guix-patches@gnu.org)
87bkw07ajo.fsf@gmail.com
Hello,

this patch adds a python module murmurhash3[1] under the name
'python-murmurhash3'.

- Artyom

From 694a99cd88fa88c0bf420f9e6dd755187c91d037 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sat, 14 May 2022 11:59:07 +0300
Subject: [PATCH] gnu: Add python-murmurhash3

* gnu/packages/python-xyz.scm (python-murmurhash3): New variable.
---
gnu/packages/python-xyz.scm | 43 +++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

Toggle diff (60 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 020f078dee..94eedcb221 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -121,6 +121,7 @@
 ;;; Copyright © 2022 Peter Polidoro <peter@polidoro.io>
 ;;; Copyright © 2022 Wamm K. D. <jaft.r@outlook.com>
 ;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com>
+;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31150,3 +31151,45 @@ object, which can be useful if you want to force your objects into a table.")
      "The @code{deep-merge} Python library provides a toolset to deeply merge
 nested data structures in Python like lists and dictionaries.")
     (license license:expat)))
+
+(define-public python-murmurhash3
+  (package
+  (name "python-murmurhash3")
+  (version "2.3.5")
+  (source
+   (origin
+     (method url-fetch)
+     (uri (pypi-uri "murmurhash3" version))
+     (sha256
+      (base32 "1gdzys1212dx70byz07ipknbw1awbqskh6aznlkm85js8b8qfczm"))))
+  (build-system python-build-system)
+  (native-inputs
+   (list python-cython
+         python-pytest))
+  (inputs
+   (list python))
+  (arguments
+   (list
+    #:modules '((ice-9 ftw)
+                (ice-9 match)
+                (guix build utils)
+                (guix build python-build-system))
+    #:phases
+    #~(modify-phases %standard-phases
+        (add-after 'unpack 'set-source-file-times-to-1980
+          ;; XXX One of the tests uses a ZIP library to pack up some of the
+          ;; source tree, and fails with "ZIP does not support timestamps
+          ;; before 1980".  Work around this by setting the file times in the
+          ;; source tree to sometime in early 1980.
+          (lambda _
+            (let ((circa-1980 (* 10 366 24 60 60)))
+              (ftw "." (lambda (file stat flag)
+                         (utime file circa-1980 circa-1980)
+                         #t))))))))
+  (home-page "https://github.com/veegee/mmh3")
+  (synopsis "Python wrapper for MurmurHash (MurmurHash3)")
+  (description
+   "@code{murmurhash3} is a Python library for MurmurHash (MurmurHash3), a set
+of fast and robust hash functions.  This library is a Python extension module
+written in C.")
+  (license license:public-domain)))
-- 
2.25.1
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmJ/b9sACgkQ6cWi2QiY
oC9Ojwf5ASIPA/EDjOBGYbfASdRavZcnxRiAaX7rZ0fDIzoE8ndbCXZek1lxvi6y
eRnUXOlNd9dVsVGrG61ZW+aSiCjEDra+17WcZh9yaLJ1lpRLrsMQ/1dQ6j35dNUf
vmTsrPPJA4Ea9HBY0VzNWtUWClOXJcnPlVxdWDN9B5VXTM190cvkGgEJAw6IdmxE
aphQlyTcCA8/j3ltDMVJg3F5CUpXo2DEiL/Fq+/Ifqn9uIip0fKbYqkQYh+vSCzm
CB//ig+stNYSCdnEJima/21Y+6ZR7RqJ+Z129tS/aueprlkBY5mFxsEEnNpRlykL
b9qRo6oG94oiiewq8mD8a5JCt3Ye4w==
=X1pm
-----END PGP SIGNATURE-----

A
A
Artyom V. Poptsov wrote on 14 May 21:24 +0200
Re: [PATCH] gnu: Add python-murmurhash
(address . guix-patches@gnu.org)
877d6n7w97.fsf@gmail.com
Hello,

this patch adds a Python module murmurhash[1] under the name
'python-murmurhash'.

This patch depends on my previous patch with 'python-murmurhash3'.

- Artyom

References:
From 2f564f0ef57ddb5f99473ce49923222f6fcfed67 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sat, 14 May 2022 22:22:06 +0300
Subject: [PATCH] gnu: Add python-murmurhash

* gnu/packages/python-xyz.scm (python-murmurhash): New variable.
---
gnu/packages/python-xyz.scm | 41 +++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

Toggle diff (51 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 94eedcb221..5460fcebcf 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -31193,3 +31193,44 @@ nested data structures in Python like lists and dictionaries.")
 of fast and robust hash functions.  This library is a Python extension module
 written in C.")
   (license license:public-domain)))
+
+(define-public python-murmurhash
+  (package
+  (name "python-murmurhash")
+  (version "1.0.7")
+  (source
+   (origin
+     (method url-fetch)
+     (uri (pypi-uri "murmurhash" version))
+     (sha256
+      (base32 "0vwkn98c703nvsigl2nz99rax2pafkx3djjfkgc49jiipmp3j2k3"))))
+  (build-system python-build-system)
+  (native-inputs
+   (list python-cython
+         python-pytest))
+  (inputs
+   (list python
+         python-murmurhash3))
+  (arguments
+   (list
+    #:modules '((ice-9 ftw)
+                (ice-9 match)
+                (guix build utils)
+                (guix build python-build-system))
+    #:phases
+    #~(modify-phases %standard-phases
+        (add-after 'unpack 'set-source-file-times-to-1980
+          ;; XXX One of the tests uses a ZIP library to pack up some of the
+          ;; source tree, and fails with "ZIP does not support timestamps
+          ;; before 1980".  Work around this by setting the file times in the
+          ;; source tree to sometime in early 1980.
+          (lambda _
+            (let ((circa-1980 (* 10 366 24 60 60)))
+              (ftw "." (lambda (file stat flag)
+                         (utime file circa-1980 circa-1980)
+                         #t))))))))
+  (home-page "https://github.com/explosion/murmurhash")
+  (synopsis "Cython bindings for MurmurHash2")
+  (description
+   "Cython bindings for MurmurHash2.")
+  (license license:expat)))
-- 
2.25.1
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmKAAfQACgkQ6cWi2QiY
oC8x6wf/Sn7KbM15aEvHeVOoufbv+ZvqzmKViHtPWZaR4pkplVJKP/ROZ1L9qEXh
sPjXQNnpVaewnxtrrK1Wugt0yGRsZDFsKFpHiic8b0yF/35esZ1Yhl172T9ycjiU
MS2V6D/rX8q+g/QliN9Q0pSwnwe0cL6+x8l9puz+Fcj7nwoWA9XP7Gjst4IG8dHy
+3mJ9ZQbYZR4j0oOHr0+crfqqoU0ZubbCKdr1r/M1TvdCrB2xs0d7rSajzyFd5ha
C2ps1Rr1DD0pQnsjgEL1ZAtdzJn0z6SsBCYOdlAjaqjsmD7+LP9CVYVgxKSESEd2
M0+TkrFghgrwbT7Ib3a7EOQNLSgCEQ==
=irWA
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 21 May 00:11 +0200
Re: bug#55409: [PATCH] gnu: Add python-murmurhash3
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)(address . 55409-done@debbugs.gnu.org)
87tu9jvoqa.fsf@gnu.org
Hi Artyom,

"Artyom V. Poptsov" <poptsov.artyom@gmail.com> skribis:

Toggle quote (3 lines)
> this patch adds a python module murmurhash3[1] under the name
> 'python-murmurhash3'.

[...]

Toggle quote (3 lines)
> this patch adds a Python module murmurhash[1] under the name
> 'python-murmurhash'.

Applied both patches after passing them through ‘guix style’.

Thanks,
Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 55409@debbugs.gnu.org