unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Reichör" <stefan@xsteve.at>
To: 28151@debbugs.gnu.org
Subject: [bug#28151] [PATCH] gnu: Add honcho.
Date: Tue, 22 Aug 2017 22:08:26 +0200	[thread overview]
Message-ID: <87y3qbmklh.fsf@xsteve.at> (raw)
In-Reply-To: <87378jo0cz.fsf@xsteve.at> ("Stefan Reichör"'s message of "Tue, 22 Aug 2017 21:42:36 +0200")

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.

  reply	other threads:[~2017-08-22 20:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-08-22 20:21     ` Marius Bakke
2017-08-23 20:23       ` Stefan Reichör
2017-08-24 19:29         ` bug#28151: " Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y3qbmklh.fsf@xsteve.at \
    --to=stefan@xsteve.at \
    --cc=28151@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).