[PATCH] gnu: Add python-daemon.

  • Done
  • quality assurance status badge
Details
3 participants
  • Danny Milosavljevic
  • Ricardo Wurmus
  • Vagrant Cascadian
Owner
unassigned
Submitted by
Vagrant Cascadian
Severity
normal

Debbugs page

Vagrant Cascadian wrote 6 years ago
(address . guix-patches@gnu.org)
87va1w6iki.fsf@ponder
* gnu/packages/python-xyz.scm (python-daemon): New variable.
---
gnu/packages/python-xyz.scm | 51 +++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)

Toggle diff (64 lines)
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
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCXFv9fQAKCRDcUY/If5cW
qh7GAQD2XluCmztriX1YGP+CimnchEieSbB2lAPdtx+TCOtZVwD/bVqoxY1Wkaw8
/kxNKsgOMt9bl89kWmB3hRNPWpsOKwU=
=tJDI
-----END PGP SIGNATURE-----

Vagrant Cascadian wrote 6 years ago
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 34365@debbugs.gnu.org)
87sgwz7rkq.fsf@ponder
On 2019-02-07, Ricardo Wurmus wrote:
Toggle quote (4 lines)
>> * gnu/packages/python-xyz.scm (python-daemon): New variable.
>
> Thanks for the patch!

Thanks for the lightning fast review!


Toggle quote (11 lines)
>> + (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...


Toggle quote (14 lines)
>> + (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...


Toggle quote (4 lines)
>> + (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:



live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCXFwZpgAKCRDcUY/If5cW
qp5PAP0TOhbEY1XyFy7oOSOmRpMXySdGkU5Ul7ghc3WqlqhaDAD8CwxsFWsvlxT7
lw67oPHzsEtb0EtKN2DRml+RvC75iQE=
=pkAH
-----END PGP SIGNATURE-----

Ricardo Wurmus wrote 6 years ago
(name . Vagrant Cascadian)(address . vagrant@debian.org)(address . 34365@debbugs.gnu.org)
87va1v4uin.fsf@elephly.net
Vagrant Cascadian <vagrant@debian.org> writes:

Toggle quote (7 lines)
>> 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.

Toggle quote (7 lines)
>>> + (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.

Toggle quote (6 lines)
> 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
Vagrant Cascadian wrote 6 years ago
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 34365@debbugs.gnu.org)
87pns37iwj.fsf@ponder
On 2019-02-07, Ricardo Wurmus wrote:
Toggle quote (5 lines)
> Vagrant Cascadian <vagrant@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.)
...
Toggle quote (3 lines)
>>>> + (license (list license:asl2.0 license:gpl3+))))
>>>
>>> What does this list mean?
...
Toggle quote (9 lines)
>> 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
From e22c1ac09a3db62eca7db12d4322672ab18c2ffc Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@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(+)

Toggle diff (64 lines)
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
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCXFxFjQAKCRDcUY/If5cW
qmGbAP9+q2TIvSqfKsrvBvH2xDB6g8AVcKaMnxQe0aZA4LI54AEA6DdNA08C/Iir
vwnZjXXriALsPu1+B0oNseC3I9MydwY=
=EUdL
-----END PGP SIGNATURE-----

Ricardo Wurmus wrote 6 years ago
(name . Vagrant Cascadian)(address . vagrant@debian.org)(address . 34365@debbugs.gnu.org)
874l9gexmz.fsf@elephly.net
Hi Vagrant,

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

Thanks for the patch!

Toggle quote (7 lines)
> + (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.)

Toggle quote (11 lines)
> + (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?

Toggle quote (2 lines)
> + (license (list license:asl2.0 license:gpl3+))))

What does this list mean?

--
Ricardo
Danny Milosavljevic wrote 6 years ago
(name . Vagrant Cascadian)(address . vagrant@debian.org)
20190211104844.4053dfba@scratchpost.org
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
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlxhRPwACgkQ5xo1VCww
uqXGMgf8DkcZpMR6mdlQXFOosnhNH8sf/UvztyV7sbr7c+U1lYRyrml0MfCNP4lc
zvz7YDH3DDO2AdkynmxDOI9BNyOqVp8IZ6fcg+aDDjmKp4z4+vYJh6r9Z7imoY/k
aLscdiwBcT3WCJPhk4Qvl0gm6ztTKOrt5qKgBDMT5WZYgqCEsiKf1v3z3D6VqOuY
qOhN9trJ+yM+7b+ZqMlw3tXjlAkfasE9vlqDqtRhwKv/yfXhGo6mqfAYqMAov9EV
LLQrsFyfpHyvQeUZNMlRtSRYL3oGGhsW0Z5TzFOE5ZIxdSLuswhHpNwrPmsL0CLa
pDUc9qAGDx3Na4YTInPCr8XiTp1VJg==
=r0wc
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 34365
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help