diff mbox series

[bug#62077,v2] gnu: Add python-slugid.

Message ID 20230331181928.6626-1-jgart@dismail.de
State New
Headers show
Series [bug#62077,v2] gnu: Add python-slugid. | expand

Commit Message

jgart March 31, 2023, 6:19 p.m. UTC
* gnu/packages/python-xyz.scm (python-slugid): New variable.

Co-authored-by: jgart <jgart@dismail.de>
---

Hi Adam,

Thanks for the patch and sorry for the delay in reviewing this. I've
been busy. I've attached a version 2 of your patch with modifications.
I've also added myself as a "co-author" since I've made a few changes
to your patch.

I modified the package to take the source from GitHub since the GitHub
repository includes the tests and the PyPi version does not. We usually
try to enable the tests on all of our packages when available and
practical. I added a phase in the arguments <package> field implementing
that.

I also added a comment mentioning that tests are run by nose via tox. In
my approach here I just run nose directly and forego using tox.

Hi Lars, 

WDYT. Can this be merged? I don't have commit access so someone
else would have to merge it.

all best,

jgart

 gnu/packages/python-xyz.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ca6c68ec7c..5c44817afa 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16801,6 +16801,36 @@  (define-public python-rarfile
 is made as zipfile like as possible.")
     (license license:isc)))
 
+(define-public python-slugid
+  (package
+    (name "python-slugid")
+    (version "2.0.0")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+              (url "https://github.com/taskcluster/slugid.py")
+              (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32 "1h64p2jlqv6lsmw8h2j203kx3bhv72cwzpk5gdhsaamw30cp3h1i"))))
+    (build-system python-build-system)
+    (native-inputs (list python-nose))
+    (arguments
+      (list #:phases
+        #~(modify-phases %standard-phases
+            (replace 'check
+              (lambda* (#:key inputs tests? #:allow-other-keys)
+                (when tests?
+                  ;; The project uses tox to run the tests via nose.
+                  (invoke "nosetests" "-v" "test.py")))))))
+    (home-page "http://taskcluster.github.io/slugid.py")
+    (synopsis "Module for Base64 encoded UUID v4 slugs")
+    (description "This package provides a module for generating v4
+UUIDs and encoding them into 22 character URL-safe base64 slug
+representation.")
+    (license license:mpl2.0)))
+
 (define-public python-rich
   (package
     (name "python-rich")