unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#28151] [PATCH] gnu: Add honcho.
@ 2017-08-19 19:49 Stefan Reichör
  2017-08-21 22:00 ` Marius Bakke
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Reichör @ 2017-08-19 19:49 UTC (permalink / raw)
  To: 28151

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-gnu-Add-honcho.patch --]
[-- Type: text/x-diff, Size: 1595 bytes --]

From fd43ad462227e46d34c48c5a7ae41009f0d20d45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Reich=C3=B6r?= <stefan@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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#28151] [PATCH] gnu: Add honcho.
  2017-08-19 19:49 [bug#28151] [PATCH] gnu: Add honcho Stefan Reichör
@ 2017-08-21 22:00 ` Marius Bakke
  2017-08-22 19:42   ` Stefan Reichör
  0 siblings, 1 reply; 7+ messages in thread
From: Marius Bakke @ 2017-08-21 22:00 UTC (permalink / raw)
  To: Stefan Reichör, 28151

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]

Stefan Reichör <stefan@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!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#28151] [PATCH] gnu: Add honcho.
  2017-08-21 22:00 ` Marius Bakke
@ 2017-08-22 19:42   ` Stefan Reichör
  2017-08-22 20:08     ` Stefan Reichör
  2017-08-22 20:21     ` Marius Bakke
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Reichör @ 2017-08-22 19:42 UTC (permalink / raw)
  To: 28151

Marius Bakke <mbakke@fastmail.com> writes:

> Stefan Reichör <stefan@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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#28151] [PATCH] gnu: Add honcho.
  2017-08-22 19:42   ` Stefan Reichör
@ 2017-08-22 20:08     ` Stefan Reichör
  2017-08-22 20:21     ` Marius Bakke
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Reichör @ 2017-08-22 20:08 UTC (permalink / raw)
  To: 28151

Stefan Reichör <stefan@xsteve.at> writes:

> Marius Bakke <mbakke@fastmail.com> writes:
>
>> Stefan Reichör <stefan@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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#28151] [PATCH] gnu: Add honcho.
  2017-08-22 19:42   ` Stefan Reichör
  2017-08-22 20:08     ` Stefan Reichör
@ 2017-08-22 20:21     ` Marius Bakke
  2017-08-23 20:23       ` Stefan Reichör
  1 sibling, 1 reply; 7+ messages in thread
From: Marius Bakke @ 2017-08-22 20:21 UTC (permalink / raw)
  To: Stefan Reichör, 28151

[-- Attachment #1: Type: text/plain, Size: 2385 bytes --]

Stefan Reichör <stefan@xsteve.at> writes:

> Marius Bakke <mbakke@fastmail.com> writes:
>
>> Stefan Reichör <stefan@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 :)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#28151] [PATCH] gnu: Add honcho.
  2017-08-22 20:21     ` Marius Bakke
@ 2017-08-23 20:23       ` Stefan Reichör
  2017-08-24 19:29         ` bug#28151: " Marius Bakke
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Reichör @ 2017-08-23 20:23 UTC (permalink / raw)
  To: 28151

[-- Attachment #1: Type: text/plain, Size: 1046 bytes --]

Marius Bakke <mbakke@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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-honcho.patch --]
[-- Type: text/x-diff, Size: 2611 bytes --]

From dc289a9c328f6a8f77e88decfa93695da4c735f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Reich=C3=B6r?= <stefan@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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#28151: [PATCH] gnu: Add honcho.
  2017-08-23 20:23       ` Stefan Reichör
@ 2017-08-24 19:29         ` Marius Bakke
  0 siblings, 0 replies; 7+ messages in thread
From: Marius Bakke @ 2017-08-24 19:29 UTC (permalink / raw)
  To: Stefan Reichör, 28151-done

[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]

Stefan Reichör <stefan@xsteve.at> writes:

> Marius Bakke <mbakke@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!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-08-24 19:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-19 19:49 [bug#28151] [PATCH] gnu: Add honcho Stefan Reichör
2017-08-21 22:00 ` Marius Bakke
2017-08-22 19:42   ` Stefan Reichör
2017-08-22 20:08     ` Stefan Reichör
2017-08-22 20:21     ` Marius Bakke
2017-08-23 20:23       ` Stefan Reichör
2017-08-24 19:29         ` bug#28151: " Marius Bakke

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).