From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkFUz-0007Zl-Ri for guix-patches@gnu.org; Tue, 22 Aug 2017 16:10:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkFUw-000285-HS for guix-patches@gnu.org; Tue, 22 Aug 2017 16:10:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:41228) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dkFUw-00027q-Dz for guix-patches@gnu.org; Tue, 22 Aug 2017 16:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dkFUw-0002iF-7D for guix-patches@gnu.org; Tue, 22 Aug 2017 16:10:02 -0400 Subject: [bug#28151] [PATCH] gnu: Add honcho. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkFTW-0006mO-Ry for guix-patches@gnu.org; Tue, 22 Aug 2017 16:08:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkFTT-0000lR-Ke for guix-patches@gnu.org; Tue, 22 Aug 2017 16:08:34 -0400 Received: from dd5424.kasserver.com ([85.13.138.252]:56562) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkFTT-0000ke-Al for guix-patches@gnu.org; Tue, 22 Aug 2017 16:08:31 -0400 Received: from localhost (37-186-9-252.ip.as39912.net [37.186.9.252]) by dd5424.kasserver.com (Postfix) with ESMTPA id 95B9CB5804CD for ; Tue, 22 Aug 2017 22:08:26 +0200 (CEST) From: Stefan =?UTF-8?Q?Reich=C3=B6r?= In-Reply-To: <87378jo0cz.fsf@xsteve.at> ("Stefan =?UTF-8?Q?Reich=C3=B6r?="'s message of "Tue, 22 Aug 2017 21:42:36 +0200") References: <87valj72yp.fsf@xsteve.at> <87378k4m57.fsf@fastmail.com> <87378jo0cz.fsf@xsteve.at> Date: Tue, 22 Aug 2017 22:08:26 +0200 Message-ID: <87y3qbmklh.fsf@xsteve.at> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 28151@debbugs.gnu.org Stefan Reich=C3=B6r writes: > Marius Bakke writes: > >> Stefan Reich=C3=B6r 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/sto= re/bf54hnwd8mb63zmssc23fwslf5zvxpxs-python-wrapper-3.5.3/bin/python > | rootdir: /tmp/guix-build-python-honcho-1.0.1.drv-0/honcho-1.0.1, inifil= e:=20 > | 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=20 > |=20 > | 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 ...... > |=20 > | =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D 123 passed in 19.25 seconds =3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > `---- > > 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.