GNU bug report logs - #49575
[PATCH] Add date2name

Previous Next

Package: guix-patches;

Reported by: phodina <phodina <at> protonmail.com>

Date: Thu, 15 Jul 2021 16:10:02 UTC

Severity: normal

Tags: patch

Merged with 49735

Done: Ludovic Courtès <ludo <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 49575 in the body.
You can then email your comments to 49575 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#49575; Package guix-patches. (Thu, 15 Jul 2021 16:10:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to phodina <phodina <at> protonmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 15 Jul 2021 16:10:02 GMT) Full text and rfc822 format available.

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

From: phodina <phodina <at> protonmail.com>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: [PATCH] Add date2name
Date: Thu, 15 Jul 2021 16:05:13 +0000
---
index d8c3fbec07..ac9a5f940d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -105,6 +105,7 @@
 ;;; Copyright © 2021 Danial Behzadi <dani.behzi <at> ubuntu.com>
 ;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be>
 ;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte <at> inria.fr>
+;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -904,6 +905,37 @@ iotop, uptime, pidof, tty, taskset, pmap.")
     (properties `((python2-variant . ,(delay python2-psutil))))
     (license license:bsd-3)))

+(define-public python-date2name
+(package
+  (name "date2name")
+  (version "6c8f37277e8ec82aa50f90b8921422be30c4e798")
+  (source (origin
+            (method git-fetch)
+            (uri
+	      (git-reference
+		(url "https://github.com/novoid/date2name")
+		(commit version)))
+            (sha256
+             (base32
+              "1vq96b7n16d932nyfhnzwdwxff0zrqanidmwr4cxj2p67ad9y3w7"))))
+  (build-system python-build-system)
+  (arguments
+    `(#:tests? #f
+      #:phases
+      (modify-phases %standard-phases
+	(delete 'build)
+	(replace 'install
+	 (lambda* (#:key outputs #:allow-other-keys)
+	  (let* ((bindir (string-append (assoc-ref outputs "out") "/bin"))
+		 (binary (string-append bindir "/date2name")))
+	    (mkdir-p bindir)
+	    (copy-file "date2name/__init__.py" binary)
+	    (chmod binary #o555)))))))
+  (synopsis "Handling time-stamps and date-stamps in file names")
+  (description "Per default, date2name gets the modification time of matching files and directories and adds a datestamp in standard ISO 8601+ format YYYY-MM-DD (http://datestamps.org/index.shtml) at the beginning of the file- or directoryname.")
+  (home-page "https://github.com/novoid/date2name")
+  (license license:gpl3)))
+
 (define-public python2-psutil
   (let ((base (package-with-python2 (strip-python2-variant python-psutil))))
     (package/inherit base
--
2.31.1




Information forwarded to guix-patches <at> gnu.org:
bug#49575; Package guix-patches. (Sun, 18 Jul 2021 10:25:02 GMT) Full text and rfc822 format available.

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

From: phodina <phodina <at> protonmail.com>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: Re: [PATCH] Add date2name
Date: Sun, 18 Jul 2021 10:24:06 +0000
Here's updated patch with following changes:
- removed trailing whitespace
- add comment for git commit
- add comment for no tests
- lines have less than 80 chars

---
index 2a4f50ad46..220ac39e1d 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -905,6 +905,40 @@ for the @code{pytest} framework.")
 rounds that are calibrated to the chosen timer.")
     (license license:bsd-2)))

+
+(define-public python-date2name
+(package
+  (name "date2name")
+  (version "6c8f37277e8ec82aa50f90b8921422be30c4e798") ; no tags
+  (source (origin
+            (method git-fetch)
+            (uri (git-reference
+                  (url "https://github.com/novoid/date2name")
+                  (commit version)))
+            (sha256
+             (base32
+              "1vq96b7n16d932nyfhnzwdwxff0zrqanidmwr4cxj2p67ad9y3w7"))))
+  (build-system python-build-system)
+  (arguments
+    `(#:tests? #f ; no tests
+      #:phases
+      (modify-phases %standard-phases
+       (delete 'build)
+       (replace 'install
+        (lambda* (#:key outputs #:allow-other-keys)
+         (let* ((bindir (string-append (assoc-ref outputs "out") "/bin"))
+                (binary (string-append bindir "/date2name")))
+          (mkdir-p bindir)
+          (copy-file "date2name/__init__.py" binary)
+          (chmod binary #o555)))))))
+  (synopsis "Handling time-stamps and date-stamps in file names")
+  (description "Per default, date2name gets the modification time of matching
+files and directories and adds a datestamp in standard ISO 8601+ format
+YYYY-MM-DD (http://datestamps.org/index.shtml) at the beginning of the file-
+or directoryname.")
+  (home-page "https://github.com/novoid/date2name")
+  (license license:gpl3)))
+
 (define-public python-pytest-xvfb
   (package
     (name "python-pytest-xvfb")
--
2.31.1




Merged 49575 49735. Request was from Sarah Morgensen <iskarian <at> mgsn.dev> to control <at> debbugs.gnu.org. (Sun, 25 Jul 2021 20:43:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#49575; Package guix-patches. (Thu, 29 Jul 2021 19:44:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: phodina <phodina <at> protonmail.com>
Cc: 49575 <at> debbugs.gnu.org
Subject: Re: bug#49575: [PATCH] Add date2name
Date: Thu, 29 Jul 2021 21:43:44 +0200
Hi phodina,

phodina <phodina <at> protonmail.com> skribis:

> Here's updated patch with following changes:
> - removed trailing whitespace
> - add comment for git commit
> - add comment for no tests
> - lines have less than 80 chars

Thanks for your patch!  Overall it looks like it’s almost ready.  Here
are suggestions to complete it:

> +(define-public python-date2name
> +(package
> +  (name "date2name")

This should be indented; please check the indentation of the packages
around, and consider running ./etc/indent-code.el as mentioned at:

  https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html

> +  (version "6c8f37277e8ec82aa50f90b8921422be30c4e798") ; no tags

Please check
<https://guix.gnu.org/manual/en/html_node/Version-Numbers.html> for how
to choose version numbers.

> +  (source (origin
> +            (method git-fetch)
> +            (uri (git-reference
> +                  (url "https://github.com/novoid/date2name")
> +                  (commit version)))
> +            (sha256
> +             (base32
> +              "1vq96b7n16d932nyfhnzwdwxff0zrqanidmwr4cxj2p67ad9y3w7"))))

‘guix lint’ would probably warn you about the file name of the checkout;
you can add a ‘file-name’ field to the origin to fix that.

> +  (build-system python-build-system)
> +  (arguments
> +    `(#:tests? #f ; no tests
> +      #:phases
> +      (modify-phases %standard-phases
> +       (delete 'build)
> +       (replace 'install
> +        (lambda* (#:key outputs #:allow-other-keys)
> +         (let* ((bindir (string-append (assoc-ref outputs "out") "/bin"))
> +                (binary (string-append bindir "/date2name")))
> +          (mkdir-p bindir)
> +          (copy-file "date2name/__init__.py" binary)
> +          (chmod binary #o555)))))))
> +  (synopsis "Handling time-stamps and date-stamps in file names")
> +  (description "Per default, date2name gets the modification time of matching

s/Per/By/

> +files and directories and adds a datestamp in standard ISO 8601+ format
> +YYYY-MM-DD (http://datestamps.org/index.shtml) at the beginning of the file-
> +or directoryname.")

s/file-/file/ and s/directoryname/directory name/

Please use @uref for the URL (Texinfo markup).

> +  (home-page "https://github.com/novoid/date2name")
> +  (license license:gpl3)))

This should be ‘license:gpl3+’ because nothing in the code says “version
3 only”.

Could you send an updated patch?

Thank you!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#49575; Package guix-patches. (Tue, 31 Aug 2021 11:16:02 GMT) Full text and rfc822 format available.

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

From: phodina <phodina <at> protonmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 49575 <at> debbugs.gnu.org
Subject: [PATCH v3] gnu: Add python-date2name.
Date: Tue, 31 Aug 2021 11:15:16 +0000
Hi Ludo,

thanks for the suggestions and excellent documentation! Here's the updated patch.
-------------------------------------

* gnu/packages/python-check.scm (date2name): New variable.

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 2a4f50ad46..afd5cb5cb9 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2021 Brendan Tildesley <mail <at> brendan.scot>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv <at> posteo.net>
 ;;; Copyright © 2021 Bonface Munyoki Kilyungi <me <at> bonfacemunyoki.com>
+;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -905,6 +906,42 @@ for the @code{pytest} framework.")
 rounds that are calibrated to the chosen timer.")
     (license license:bsd-2)))

+(define-public python-date2name
+  (let ((commit "6c8f37277e8ec82aa50f90b8921422be30c4e798")
+        (revision "1"))
+    (package
+      (name "python-date2name")
+      (version (git-version "" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/novoid/date2name")
+               (commit version)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "1vq96b7n16d932nyfhnzwdwxff0zrqanidmwr4cxj2p67ad9y3w7"))))
+      (build-system python-build-system)
+      (arguments
+       `(#:tests? #f                    ; no tests
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'build)
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((bindir (string-append (assoc-ref outputs "out") "/bin"))
+                      (binary (string-append bindir "/date2name")))
+                 (mkdir-p bindir)
+                 (copy-file "date2name/__init__.py" binary)
+                 (chmod binary #o555)))))))
+      (synopsis "Handling time-stamps and date-stamps in file names")
+      (description "By default, date2name gets the modification time of matching
+files and directories and adds a datestamp in standard ISO 8601+ format
+YYYY-MM-DD at the beginning of the file or directory name.")
+      (home-page "https://github.com/novoid/date2name")
+      (license license:gpl3+))))
+
 (define-public python-pytest-xvfb
   (package
     (name "python-pytest-xvfb")
--
2.32.0




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 01 Sep 2021 21:06:02 GMT) Full text and rfc822 format available.

Notification sent to phodina <phodina <at> protonmail.com>:
bug acknowledged by developer. (Wed, 01 Sep 2021 21:06:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: phodina <phodina <at> protonmail.com>
Cc: 49575-done <at> debbugs.gnu.org
Subject: Re: [PATCH v3] gnu: Add python-date2name.
Date: Wed, 01 Sep 2021 23:04:58 +0200
Hello,

phodina <phodina <at> protonmail.com> skribis:

> Hi Ludo,
>
> thanks for the suggestions and excellent documentation! Here's the updated patch.
> -------------------------------------
>
> * gnu/packages/python-check.scm (date2name): New variable.

I applied it with a couple of changes I forgot to suggest earlier:
moving it to python-xyz.scm (python-check.scm is for tools related to
test suites), renaming it to “date2name” since it’s a command-line tool
and not a Python library, and having the ‘commit’ field of
‘git-reference’ refer to the commit, not the version number.

Thanks!

Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 01 Sep 2021 21:06:02 GMT) Full text and rfc822 format available.

Notification sent to phodina <phodina <at> protonmail.com>:
bug acknowledged by developer. (Wed, 01 Sep 2021 21:06:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 30 Sep 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 202 days ago.

Previous Next


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