GNU bug report logs - #34365
[PATCH] gnu: Add python-daemon.

Previous Next

Package: guix-patches;

Reported by: Vagrant Cascadian <vagrant <at> debian.org>

Date: Thu, 7 Feb 2019 09:43:02 UTC

Severity: normal

Tags: patch

Done: Danny Milosavljevic <dannym <at> scratchpost.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 34365 in the body.
You can then email your comments to 34365 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#34365; Package guix-patches. (Thu, 07 Feb 2019 09:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vagrant Cascadian <vagrant <at> debian.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 07 Feb 2019 09:43:02 GMT) Full text and rfc822 format available.

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

From: Vagrant Cascadian <vagrant <at> debian.org>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add python-daemon.
Date: Thu, 07 Feb 2019 01:42:21 -0800
[Message part 1 (text/plain, inline)]
* gnu/packages/python-xyz.scm (python-daemon): New variable.
---
 gnu/packages/python-xyz.scm | 51 +++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d2b348942..f8a6db720 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -2188,6 +2188,57 @@ logging and tracing of the execution.")
 (define-public python2-joblib
   (package-with-python2 python-joblib))
 
+(define-public python-daemon
+  (package
+    (name "python-daemon")
+    (version "2.2.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-daemon" version))
+       (sha256
+        (base32
+         "09fcjdjzk9ywmpnrj62iyxqgcygzdafsz41qlrk2dknzbagcmzmg"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'disable-tests
+           (lambda _
+             ;; FIXME: Determine why test fails
+             (substitute* "test/test_daemon.py"
+               (("test_detaches_process_context")
+                "skip_test_detaches_process_context")))))))
+    (propagated-inputs
+     `(("python-docutils" ,python-docutils)
+       ("python-lockfile" ,python-lockfile)
+       ("python-setuptools" ,python-setuptools)))
+    (native-inputs
+     `(("python-unittest2" ,python-unittest2)
+       ("python-testtools" ,python-testtools)
+       ("python-testscenarios" ,python-testscenarios)
+       ("python-mock" ,python-mock)
+       ("python-docutils" ,python-docutils)))
+    (home-page "https://pagure.io/python-daemon/")
+    (synopsis "Python library for making a Unix daemon process")
+    (description "Python-daemon is a library that assists a Python program to
+turn itself into a well-behaved Unix daemon process, as specified in PEP 3143.
+
+This library provides a @code{DaemonContext} class that manages the following
+important tasks for becoming a daemon process:
+@enumerate
+@item Detach the process into its own process group.
+@item Set process environment appropriate for running inside a chroot.
+@item Renounce suid and sgid privileges.
+@item Close all open file descriptors.
+@item Change the working directory, uid, gid, and umask.
+@item Set appropriate signal handlers.
+@item Open new file descriptors for stdin, stdout, and stderr.
+@item Manage a specified PID lock file.
+@item Register cleanup functions for at-exit processing.
+@end enumerate")
+    (license (list license:asl2.0 license:gpl3+))))
+
 (define-public python-docutils
   (package
     (name "python-docutils")
-- 
2.20.1

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

Information forwarded to guix-patches <at> gnu.org:
bug#34365; Package guix-patches. (Thu, 07 Feb 2019 11:43:02 GMT) Full text and rfc822 format available.

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

From: Vagrant Cascadian <vagrant <at> debian.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 34365 <at> debbugs.gnu.org
Subject: Re: [bug#34365] [PATCH] gnu: Add python-daemon.
Date: Thu, 07 Feb 2019 03:42:29 -0800
[Message part 1 (text/plain, inline)]
On 2019-02-07, Ricardo Wurmus wrote:
>> * gnu/packages/python-xyz.scm (python-daemon): New variable.
>
> Thanks for the patch!

Thanks for the lightning fast review!


>> +         (add-before 'check 'disable-tests
>> +           (lambda _
>> +             ;; FIXME: Determine why test fails
>> +             (substitute* "test/test_daemon.py"
>> +               (("test_detaches_process_context")
>> +                "skip_test_detaches_process_context")))))))
>
> Before pushing this I’ll add a final #T to this phase.  (In the past #F
> would indicate failure, but that’s on longer the case.  “substitute*”
> annoyingly returns an unspecified value.)

My eyes still have trouble identifying where exactly this would
go... and #T/#F vs. #t/#f has me a bit confused for good measure!

Obviously, it'd be better to fix the test, or at least understand why it
fails...


>> +    (propagated-inputs
>> +     `(("python-docutils" ,python-docutils)
>> +       ("python-lockfile" ,python-lockfile)
>> +       ("python-setuptools" ,python-setuptools)))
>> +    (native-inputs
>> +     `(("python-unittest2" ,python-unittest2)
>> +       ("python-testtools" ,python-testtools)
>> +       ("python-testscenarios" ,python-testscenarios)
>> +       ("python-mock" ,python-mock)
>> +       ("python-docutils" ,python-docutils)))
>
> Docutils is both among native inputs as well as regular inputs.  Is this
> intended?

I *think* it only needs to be in native-inputs; I think propagated
outputs was generated by the importer... and now that my attention is
drawn to it, I'm dubious of python-setuptools needing to be in
propagated-inputs as well. I can update it and check again later...


>> +    (license (list license:asl2.0 license:gpl3+))))
>
> What does this list mean?

I guess it's best practice in Guix to make a comment when multiple
licenses are listed?

Apparently only setup.py is gpl3+, everything else is apache 2.0
licensed. That was my quick look at the code itself, and basically
confirmed by:

  https://sources.debian.org/src/python-daemon/2.2.3-1/debian/copyright/


live well,
  vagrant
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#34365; Package guix-patches. (Thu, 07 Feb 2019 13:08:02 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Vagrant Cascadian <vagrant <at> debian.org>
Cc: 34365 <at> debbugs.gnu.org
Subject: Re: [bug#34365] [PATCH] gnu: Add python-daemon.
Date: Thu, 07 Feb 2019 14:07:12 +0100
Vagrant Cascadian <vagrant <at> debian.org> writes:

>> Before pushing this I’ll add a final #T to this phase.  (In the past #F
>> would indicate failure, but that’s on longer the case.  “substitute*”
>> annoyingly returns an unspecified value.)
>
> My eyes still have trouble identifying where exactly this would
> go... and #T/#F vs. #t/#f has me a bit confused for good measure!

Oh sorry.  It should go after the (substitute* …) clause.  We sometimes
capitalize variable names and values when referring to them.  We would
write “#t” here.

>>> +    (license (list license:asl2.0 license:gpl3+))))
>>
>> What does this list mean?
>
> I guess it's best practice in Guix to make a comment when multiple
> licenses are listed?

Yes.  We don’t have a syntactic way to express license algebra, so we
usually add a comment when a list of licenses applies.

> Apparently only setup.py is gpl3+, everything else is apache 2.0
> licensed. That was my quick look at the code itself, and basically
> confirmed by:
>
>   https://sources.debian.org/src/python-daemon/2.2.3-1/debian/copyright/

Excellent.  This can be added as a short comment above the license
field.

Thanks!

--
Ricardo





Information forwarded to guix-patches <at> gnu.org:
bug#34365; Package guix-patches. (Thu, 07 Feb 2019 14:51:02 GMT) Full text and rfc822 format available.

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

From: Vagrant Cascadian <vagrant <at> debian.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 34365 <at> debbugs.gnu.org
Subject: Re: [bug#34365] [PATCH] gnu: Add python-daemon.
Date: Thu, 07 Feb 2019 06:49:48 -0800
[Message part 1 (text/plain, inline)]
On 2019-02-07, Ricardo Wurmus wrote:
> Vagrant Cascadian <vagrant <at> debian.org> writes:
>
>>> Before pushing this I’ll add a final #T to this phase.  (In the past #F
>>> would indicate failure, but that’s on longer the case.  “substitute*”
>>> annoyingly returns an unspecified value.)
...
>>>> +    (license (list license:asl2.0 license:gpl3+))))
>>>
>>> What does this list mean?
...
>> Apparently only setup.py is gpl3+, everything else is apache 2.0
>> licensed. That was my quick look at the code itself, and basically
>> confirmed by:
>>
>>   https://sources.debian.org/src/python-daemon/2.2.3-1/debian/copyright/
>
> Excellent.  This can be added as a short comment above the license
> field.

Ok, the attached patch should address the above two issues and removed
the needless python-setuptools and python-docutils propagated inputs
mentioned earlier.

live well,
  vagrant

[0001-gnu-Add-python-daemon.patch (text/x-diff, inline)]
From e22c1ac09a3db62eca7db12d4322672ab18c2ffc Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant <at> debian.org>
Date: Thu, 7 Feb 2019 01:27:41 -0800
Subject: [PATCH] gnu: Add python-daemon.

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d2b348942..cf293c004 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -2188,6 +2188,57 @@ logging and tracing of the execution.")
 (define-public python2-joblib
   (package-with-python2 python-joblib))
 
+(define-public python-daemon
+  (package
+    (name "python-daemon")
+    (version "2.2.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-daemon" version))
+       (sha256
+        (base32
+         "09fcjdjzk9ywmpnrj62iyxqgcygzdafsz41qlrk2dknzbagcmzmg"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'disable-tests
+           (lambda _
+             ;; FIXME: Determine why test fails
+             (substitute* "test/test_daemon.py"
+               (("test_detaches_process_context")
+                "skip_test_detaches_process_context"))
+             #t)))))
+    (propagated-inputs
+     `(("python-lockfile" ,python-lockfile)))
+    (native-inputs
+     `(("python-unittest2" ,python-unittest2)
+       ("python-testtools" ,python-testtools)
+       ("python-testscenarios" ,python-testscenarios)
+       ("python-mock" ,python-mock)
+       ("python-docutils" ,python-docutils)))
+    (home-page "https://pagure.io/python-daemon/")
+    (synopsis "Python library for making a Unix daemon process")
+    (description "Python-daemon is a library that assists a Python program to
+turn itself into a well-behaved Unix daemon process, as specified in PEP 3143.
+
+This library provides a @code{DaemonContext} class that manages the following
+important tasks for becoming a daemon process:
+@enumerate
+@item Detach the process into its own process group.
+@item Set process environment appropriate for running inside a chroot.
+@item Renounce suid and sgid privileges.
+@item Close all open file descriptors.
+@item Change the working directory, uid, gid, and umask.
+@item Set appropriate signal handlers.
+@item Open new file descriptors for stdin, stdout, and stderr.
+@item Manage a specified PID lock file.
+@item Register cleanup functions for at-exit processing.
+@end enumerate")
+    ;; Only setup.py is gpl3+, everything else is apache 2.0 licensed.
+    (license (list license:asl2.0 license:gpl3+))))
+
 (define-public python-docutils
   (package
     (name "python-docutils")
-- 
2.20.1

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

Information forwarded to guix-patches <at> gnu.org:
bug#34365; Package guix-patches. (Fri, 08 Feb 2019 05:37:02 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Vagrant Cascadian <vagrant <at> debian.org>
Cc: 34365 <at> debbugs.gnu.org
Subject: Re: [bug#34365] [PATCH] gnu: Add python-daemon.
Date: Thu, 07 Feb 2019 10:49:40 +0100
Hi Vagrant,

> * gnu/packages/python-xyz.scm (python-daemon): New variable.

Thanks for the patch!

> +         (add-before 'check 'disable-tests
> +           (lambda _
> +             ;; FIXME: Determine why test fails
> +             (substitute* "test/test_daemon.py"
> +               (("test_detaches_process_context")
> +                "skip_test_detaches_process_context")))))))

Before pushing this I’ll add a final #T to this phase.  (In the past #F
would indicate failure, but that’s on longer the case.  “substitute*”
annoyingly returns an unspecified value.)

> +    (propagated-inputs
> +     `(("python-docutils" ,python-docutils)
> +       ("python-lockfile" ,python-lockfile)
> +       ("python-setuptools" ,python-setuptools)))
> +    (native-inputs
> +     `(("python-unittest2" ,python-unittest2)
> +       ("python-testtools" ,python-testtools)
> +       ("python-testscenarios" ,python-testscenarios)
> +       ("python-mock" ,python-mock)
> +       ("python-docutils" ,python-docutils)))

Docutils is both among native inputs as well as regular inputs.  Is this
intended?

> +    (license (list license:asl2.0 license:gpl3+))))

What does this list mean?

-- 
Ricardo





Reply sent to Danny Milosavljevic <dannym <at> scratchpost.org>:
You have taken responsibility. (Mon, 11 Feb 2019 09:49:01 GMT) Full text and rfc822 format available.

Notification sent to Vagrant Cascadian <vagrant <at> debian.org>:
bug acknowledged by developer. (Mon, 11 Feb 2019 09:49:02 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Vagrant Cascadian <vagrant <at> debian.org>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 34365-done <at> debbugs.gnu.org
Subject: Re: [bug#34365] [PATCH] gnu: Add python-daemon.
Date: Mon, 11 Feb 2019 10:48:44 +0100
[Message part 1 (text/plain, inline)]
Hi Vagrant,

thanks!  I've applied this to guix master.

I've also reported the test failure upstream as https://pagure.io/python-daemon/issue/28

[Message part 2 (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 11 Mar 2019 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 47 days ago.

Previous Next


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