GNU bug report logs - #28151
[PATCH] gnu: Add honcho.

Previous Next

Package: guix-patches;

Reported by: Stefan Reichör <stefan <at> xsteve.at>

Date: Sat, 19 Aug 2017 19:50:02 UTC

Severity: normal

Tags: patch

Done: Marius Bakke <mbakke <at> fastmail.com>

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 28151 in the body.
You can then email your comments to 28151 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#28151; Package guix-patches. (Sat, 19 Aug 2017 19:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Reichör <stefan <at> xsteve.at>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 19 Aug 2017 19:50:02 GMT) Full text and rfc822 format available.

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

From: Stefan Reichör <stefan <at> xsteve.at>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add honcho.
Date: Sat, 19 Aug 2017 21:49:18 +0200
[0001-gnu-Add-honcho.patch (text/x-diff, inline)]
From fd43ad462227e46d34c48c5a7ae41009f0d20d45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Reich=C3=B6r?= <stefan <at> xsteve.at>
Date: Sat, 19 Aug 2017 21:46:38 +0200
Subject: [PATCH] gnu: Add honcho.

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

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 6da5ad8..afa7ca5 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -5226,6 +5226,31 @@ cluster without needing to write any wrapper code yourself.")
 (define-public python2-gridmap
   (package-with-python2 python-gridmap))
 
+(define-public python-honcho
+  (package
+    (name "python-honcho")
+    (version "1.0.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "honcho" version))
+       (sha256
+        (base32 "0vpadk37y27m98x9lk151k96vp319w7jv8f6hdr7fdz3s8m412f1"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-jinja2" ,python-jinja2)))
+    (home-page "https://github.com/nickstenning/honcho")
+    (synopsis "Manage Procfile-based applications")
+    (description
+      "A Procfile is a file which describes how to run an application
+consisting of serveral processes. honcho starts all listed processes.
+The output of all running processes is collected by honcho and
+displayed.")
+    (license license:expat)))
+
+(define-public python2-honcho
+  (package-with-python2 python-honcho))
+
 (define-public python-pexpect
   (package
     (name "python-pexpect")
-- 
2.7.4





Information forwarded to guix-patches <at> gnu.org:
bug#28151; Package guix-patches. (Mon, 21 Aug 2017 22:01:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Stefan Reichör <stefan <at> xsteve.at>, 28151 <at> debbugs.gnu.org
Subject: Re: [bug#28151] [PATCH] gnu: Add honcho.
Date: Tue, 22 Aug 2017 00:00:04 +0200
[Message part 1 (text/plain, inline)]
Stefan Reichör <stefan <at> xsteve.at> writes:

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

Thanks!  I noticed this runs no tests, can you try to add a phase that
invokes "pytest" instead of relying on the default "setup.py test"?

It looks like it might require some extra (native) inputs, but they
should already be in Guix:

https://github.com/nickstenning/honcho/blob/master/tox.ini#L17

Also, since this seems to be some kind of process manager, perhaps it
would be better suited in 'admin.scm' (without the 'python-' prefix)?

Just a question, anyway.  The patch looks good to me (but make sure it
passes `guix lint`).

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

Information forwarded to guix-patches <at> gnu.org:
bug#28151; Package guix-patches. (Tue, 22 Aug 2017 19:44:02 GMT) Full text and rfc822 format available.

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

From: Stefan Reichör <stefan <at> xsteve.at>
To: guix-patches <at> gnu.org
Subject: Re: [bug#28151] [PATCH] gnu: Add honcho.
Date: Tue, 22 Aug 2017 21:42:36 +0200
Marius Bakke <mbakke <at> fastmail.com> writes:

> Stefan Reichör <stefan <at> xsteve.at> writes:
>
>> * gnu/packages/python.scm (python-honcho): New variable.
>
> Thanks!  I noticed this runs no tests, can you try to add a phase that
> invokes "pytest" instead of relying on the default "setup.py test"?
>
> It looks like it might require some extra (native) inputs, but they
> should already be in Guix:
>
> https://github.com/nickstenning/honcho/blob/master/tox.ini#L17

I tried to add a py.test check phase. But I failed.

By reading python.scm I found two ways to do such tests

a) before installation
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (replace 'check
           (lambda _
             (zero? (system* "py.test" "-vv" )))))))

b) after installation
    (arguments
	 `(#:phases
	   (modify-phases %standard-phases
		 (delete 'check)
		 (add-after 'install 'check
		   (lambda* (#:key outputs inputs #:allow-other-keys)
			 ;; It's easier to run tests after install.
			 ;; Make installed package available for running the tests
			 (add-installed-pythonpath inputs outputs)
			 (zero? (system* "py.test" "-vv")))))))


I added the following to get pytest dependencies in:
    (native-inputs
     `(("python-pytest" ,python-pytest)
       ("python-mock" ,python-mock)
       ("python-tox" ,python-tox))) ;for tests

Both ways have the same effect: They don't collect any tests:
,----
| platform linux -- Python 3.5.3 -- py-1.4.32 -- pytest-2.7.3 -- /gnu/store/bf54hnwd8mb63zmssc23fwslf5zvxpxs-python-wrapper-3.5.3/bin/python
| rootdir: /tmp/guix-build-python-honcho-1.0.1.drv-0/honcho-1.0.1, inifile: 
| collecting ... collected 0 items
`----

When I run py.test on my Ubuntu machine, the tox.ini file is picked up
and I can run the tests:
,----
| platform linux2 -- Python 2.7.12, pytest-2.8.7, py-1.4.31, pluggy-0.3.1
| rootdir: /home/stefan/work/git/honcho, inifile: tox.ini
| plugins: mock-0.8.1
| collected 123 items 
| 
| tests/test_colour.py ..
| tests/test_environ.py ..........................................
| tests/test_export_base.py .............
| tests/test_export_runit.py ..
| tests/test_export_supervisord.py ..
| tests/test_export_upstart.py .....
| tests/test_manager.py ...............
| tests/test_printer.py ..............
| tests/test_process.py ..............
| tests/integration/test_check.py .
| tests/integration/test_export.py ...
| tests/integration/test_run.py ....
| tests/integration/test_start.py ......
| 
| ============================= 123 passed in 19.25 seconds ================
`----

Of course, the python versions are different. But the test for the guix
package seems to be run either in a wrong directory or some files
(tox.ini) are missing...

Sorry - I have no idea how to proceed.


> Also, since this seems to be some kind of process manager, perhaps it
> would be better suited in 'admin.scm' (without the 'python-' prefix)?

This was also my first intention.

However, after reading https://honcho.readthedocs.io/en/latest/,
I thought that honcho could also be used as python library.
No idea how many users will do that...

> Just a question, anyway.  The patch looks good to me (but make sure it
> passes `guix lint`).
>
> TIA!


Stefan.




Information forwarded to guix-patches <at> gnu.org:
bug#28151; Package guix-patches. (Tue, 22 Aug 2017 20:10:02 GMT) Full text and rfc822 format available.

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

From: Stefan Reichör <stefan <at> xsteve.at>
To: guix-patches <at> gnu.org
Subject: Re: [bug#28151] [PATCH] gnu: Add honcho.
Date: Tue, 22 Aug 2017 22:08:26 +0200
Stefan Reichör <stefan <at> xsteve.at> writes:

> Marius Bakke <mbakke <at> fastmail.com> writes:
>
>> Stefan Reichör <stefan <at> xsteve.at> writes:
>>
>>> * gnu/packages/python.scm (python-honcho): New variable.
>>
>> Thanks!  I noticed this runs no tests, can you try to add a phase that
>> invokes "pytest" instead of relying on the default "setup.py test"?
>>
>> It looks like it might require some extra (native) inputs, but they
>> should already be in Guix:
>>
>> https://github.com/nickstenning/honcho/blob/master/tox.ini#L17
>
> I tried to add a py.test check phase. But I failed.
>
> By reading python.scm I found two ways to do such tests
>
> a) before installation
>     (arguments
>      '(#:phases
>        (modify-phases %standard-phases
>          (replace 'check
>            (lambda _
>              (zero? (system* "py.test" "-vv" )))))))
>
> b) after installation
>     (arguments
> 	 `(#:phases
> 	   (modify-phases %standard-phases
> 		 (delete 'check)
> 		 (add-after 'install 'check
> 		   (lambda* (#:key outputs inputs #:allow-other-keys)
> 			 ;; It's easier to run tests after install.
> 			 ;; Make installed package available for running the tests
> 			 (add-installed-pythonpath inputs outputs)
> 			 (zero? (system* "py.test" "-vv")))))))
>
>
> I added the following to get pytest dependencies in:
>     (native-inputs
>      `(("python-pytest" ,python-pytest)
>        ("python-mock" ,python-mock)
>        ("python-tox" ,python-tox))) ;for tests
>
> Both ways have the same effect: They don't collect any tests:
> ,----
> | platform linux -- Python 3.5.3 -- py-1.4.32 -- pytest-2.7.3 -- /gnu/store/bf54hnwd8mb63zmssc23fwslf5zvxpxs-python-wrapper-3.5.3/bin/python
> | rootdir: /tmp/guix-build-python-honcho-1.0.1.drv-0/honcho-1.0.1, inifile: 
> | collecting ... collected 0 items
> `----
>
> When I run py.test on my Ubuntu machine, the tox.ini file is picked up
> and I can run the tests:
> ,----
> | platform linux2 -- Python 2.7.12, pytest-2.8.7, py-1.4.31, pluggy-0.3.1
> | rootdir: /home/stefan/work/git/honcho, inifile: tox.ini
> | plugins: mock-0.8.1
> | collected 123 items 
> | 
> | tests/test_colour.py ..
> | tests/test_environ.py ..........................................
> | tests/test_export_base.py .............
> | tests/test_export_runit.py ..
> | tests/test_export_supervisord.py ..
> | tests/test_export_upstart.py .....
> | tests/test_manager.py ...............
> | tests/test_printer.py ..............
> | tests/test_process.py ..............
> | tests/integration/test_check.py .
> | tests/integration/test_export.py ...
> | tests/integration/test_run.py ....
> | tests/integration/test_start.py ......
> | 
> | ============================= 123 passed in 19.25 seconds ================
> `----
>
> Of course, the python versions are different. But the test for the guix
> package seems to be run either in a wrong directory or some files
> (tox.ini) are missing...
>
> Sorry - I have no idea how to proceed.

To follow up on my mail.
I took a look at the downloaded honcho distribution .tgz:
/gnu/store/74vi1s1rjhr9xzn0vzsqh8rx2b121lsj-honcho-1.0.1.tar.gz

It does not contain the tests.
If we really need to run the tests we can't use the release tarball.

I am not sure if this is worth the extra hassle...
What do you think?

>
>> Also, since this seems to be some kind of process manager, perhaps it
>> would be better suited in 'admin.scm' (without the 'python-' prefix)?
>
> This was also my first intention.
>
> However, after reading https://honcho.readthedocs.io/en/latest/,
> I thought that honcho could also be used as python library.
> No idea how many users will do that...
>
>> Just a question, anyway.  The patch looks good to me (but make sure it
>> passes `guix lint`).
>>
>> TIA!
>
>
> Stefan.




Information forwarded to guix-patches <at> gnu.org:
bug#28151; Package guix-patches. (Tue, 22 Aug 2017 20:22:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Stefan Reichör <stefan <at> xsteve.at>, 28151 <at> debbugs.gnu.org
Subject: Re: [bug#28151] [PATCH] gnu: Add honcho.
Date: Tue, 22 Aug 2017 22:21:09 +0200
[Message part 1 (text/plain, inline)]
Stefan Reichör <stefan <at> xsteve.at> writes:

> Marius Bakke <mbakke <at> fastmail.com> writes:
>
>> Stefan Reichör <stefan <at> xsteve.at> writes:
>>
>>> * gnu/packages/python.scm (python-honcho): New variable.
>>
>> Thanks!  I noticed this runs no tests, can you try to add a phase that
>> invokes "pytest" instead of relying on the default "setup.py test"?
>>
>> It looks like it might require some extra (native) inputs, but they
>> should already be in Guix:
>>
>> https://github.com/nickstenning/honcho/blob/master/tox.ini#L17
>
> I tried to add a py.test check phase. But I failed.
>
> By reading python.scm I found two ways to do such tests
>
> a) before installation
>     (arguments
>      '(#:phases
>        (modify-phases %standard-phases
>          (replace 'check
>            (lambda _
>              (zero? (system* "py.test" "-vv" )))))))
>
> b) after installation
>     (arguments
> 	 `(#:phases
> 	   (modify-phases %standard-phases
> 		 (delete 'check)
> 		 (add-after 'install 'check
> 		   (lambda* (#:key outputs inputs #:allow-other-keys)
> 			 ;; It's easier to run tests after install.
> 			 ;; Make installed package available for running the tests
> 			 (add-installed-pythonpath inputs outputs)
> 			 (zero? (system* "py.test" "-vv")))))))
>
>
> I added the following to get pytest dependencies in:
>     (native-inputs
>      `(("python-pytest" ,python-pytest)
>        ("python-mock" ,python-mock)
>        ("python-tox" ,python-tox))) ;for tests
>
> Both ways have the same effect: They don't collect any tests:
> ,----
> | platform linux -- Python 3.5.3 -- py-1.4.32 -- pytest-2.7.3 -- /gnu/store/bf54hnwd8mb63zmssc23fwslf5zvxpxs-python-wrapper-3.5.3/bin/python
> | rootdir: /tmp/guix-build-python-honcho-1.0.1.drv-0/honcho-1.0.1, inifile: 
> | collecting ... collected 0 items
> `----

Aaah, sorry.  I was browsing the GitHub source code and failed to notice
that the distribution tarball on PyPi does not contain any tests.

So we can either switch to using the GitHub snapshots so that we can
notice breakage early, or lose tests but gain the integrity guarantees
from using the PGP-signed tarball on PyPi.

I don't really have a strong preference, but it's worth creating an
upstream issue in either case IMO.  Ideally we'd have both.

I'll let you be the judge, being the end user and all :)
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#28151; Package guix-patches. (Wed, 23 Aug 2017 20:24:02 GMT) Full text and rfc822 format available.

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

From: Stefan Reichör <stefan <at> xsteve.at>
To: guix-patches <at> gnu.org
Subject: Re: [bug#28151] [PATCH] gnu: Add honcho.
Date: Wed, 23 Aug 2017 22:23:12 +0200
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

>>
>> Both ways have the same effect: They don't collect any tests:
>> ,----
>> | platform linux -- Python 3.5.3 -- py-1.4.32 -- pytest-2.7.3 -- /gnu/store/bf54hnwd8mb63zmssc23fwslf5zvxpxs-python-wrapper-3.5.3/bin/python
>> | rootdir: /tmp/guix-build-python-honcho-1.0.1.drv-0/honcho-1.0.1, inifile: 
>> | collecting ... collected 0 items
>> `----
>
> Aaah, sorry.  I was browsing the GitHub source code and failed to notice
> that the distribution tarball on PyPi does not contain any tests.
>
> So we can either switch to using the GitHub snapshots so that we can
> notice breakage early, or lose tests but gain the integrity guarantees
> from using the PGP-signed tarball on PyPi.
>
> I don't really have a strong preference, but it's worth creating an
> upstream issue in either case IMO.  Ideally we'd have both.
>
> I'll let you be the judge, being the end user and all :)

I switched to the github tarball and I was able to get the testsuite to pass.

Attached is my current attempt.


Stefan.

[0001-gnu-Add-honcho.patch (text/x-diff, inline)]
From dc289a9c328f6a8f77e88decfa93695da4c735f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Reich=C3=B6r?= <stefan <at> xsteve.at>
Date: Wed, 23 Aug 2017 22:19:57 +0200
Subject: [PATCH] gnu: Add honcho.

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

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index d328178..9578f1c 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -5226,6 +5226,53 @@ cluster without needing to write any wrapper code yourself.")
 (define-public python2-gridmap
   (package-with-python2 python-gridmap))
 
+(define-public python-honcho
+  (package
+    (name "python-honcho")
+    (version "1.0.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/nickstenning/honcho/archive/v"
+             version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "0zizn61n5z5hq421hkypk9pw8s6fpxw30f4hsg7k4ivwzy3gjw9j"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("python-pytest" ,python-pytest-3.0)
+       ("python-mock" ,python-mock)
+       ("python-tox" ,python-tox)
+       ("which" ,which))) ;for tests
+    (propagated-inputs
+     `(("python-jinja2" ,python-jinja2)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             ;; fix honcho path in testsuite
+             (substitute* "tests/conftest.py"
+               (("'honcho'") (string-append "'" (assoc-ref outputs "out")
+                                            "/bin/honcho" "'")))
+             ;; It's easier to run tests after install.
+             ;; Make installed package available for running the tests
+             (add-installed-pythonpath inputs outputs)
+             (zero? (system* "py.test" "-v")))))))
+    (home-page "https://github.com/nickstenning/honcho")
+    (synopsis "Manage Procfile-based applications")
+    (description
+      "A Procfile is a file which describes how to run an application
+consisting of serveral processes. honcho starts all listed processes.
+The output of all running processes is collected by honcho and
+displayed.")
+    (license license:expat)))
+
+(define-public python2-honcho
+  (package-with-python2 python-honcho))
+
 (define-public python-pexpect
   (package
     (name "python-pexpect")
-- 
2.7.4


Reply sent to Marius Bakke <mbakke <at> fastmail.com>:
You have taken responsibility. (Thu, 24 Aug 2017 19:30:03 GMT) Full text and rfc822 format available.

Notification sent to Stefan Reichör <stefan <at> xsteve.at>:
bug acknowledged by developer. (Thu, 24 Aug 2017 19:30:03 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Stefan Reichör <stefan <at> xsteve.at>,
 28151-done <at> debbugs.gnu.org
Subject: Re: [bug#28151] [PATCH] gnu: Add honcho.
Date: Thu, 24 Aug 2017 21:29:47 +0200
[Message part 1 (text/plain, inline)]
Stefan Reichör <stefan <at> xsteve.at> writes:

> Marius Bakke <mbakke <at> fastmail.com> writes:
>
>>>
>>> Both ways have the same effect: They don't collect any tests:
>>> ,----
>>> | platform linux -- Python 3.5.3 -- py-1.4.32 -- pytest-2.7.3 -- /gnu/store/bf54hnwd8mb63zmssc23fwslf5zvxpxs-python-wrapper-3.5.3/bin/python
>>> | rootdir: /tmp/guix-build-python-honcho-1.0.1.drv-0/honcho-1.0.1, inifile: 
>>> | collecting ... collected 0 items
>>> `----
>>
>> Aaah, sorry.  I was browsing the GitHub source code and failed to notice
>> that the distribution tarball on PyPi does not contain any tests.
>>
>> So we can either switch to using the GitHub snapshots so that we can
>> notice breakage early, or lose tests but gain the integrity guarantees
>> from using the PGP-signed tarball on PyPi.
>>
>> I don't really have a strong preference, but it's worth creating an
>> upstream issue in either case IMO.  Ideally we'd have both.
>>
>> I'll let you be the judge, being the end user and all :)
>
> I switched to the github tarball and I was able to get the testsuite to pass.

Great!

>
> Attached is my current attempt.

Pushed as 84342e2fa95fb5ff972c5c216b0548787e25f142.

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

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

This bug report was last modified 7 years and 323 days ago.

Previous Next


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