From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkF5q-0006PN-8O for guix-patches@gnu.org; Tue, 22 Aug 2017 15:44:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkF5n-0004gZ-2n for guix-patches@gnu.org; Tue, 22 Aug 2017 15:44:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:41213) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dkF5m-0004gM-VO for guix-patches@gnu.org; Tue, 22 Aug 2017 15:44:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dkF5m-0000Hq-Mx for guix-patches@gnu.org; Tue, 22 Aug 2017 15:44:02 -0400 Subject: [bug#28151] [PATCH] gnu: Add honcho. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkF4Z-00063V-O8 for guix-patches@gnu.org; Tue, 22 Aug 2017 15:42:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkF4W-00040u-Gv for guix-patches@gnu.org; Tue, 22 Aug 2017 15:42:47 -0400 Received: from dd5424.kasserver.com ([85.13.138.252]:55738) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkF4W-00040R-6Z for guix-patches@gnu.org; Tue, 22 Aug 2017 15:42:44 -0400 Received: from localhost (37-186-9-252.ip.as39912.net [37.186.9.252]) by dd5424.kasserver.com (Postfix) with ESMTPA id 8D17DB5804CD for ; Tue, 22 Aug 2017 21:42:37 +0200 (CEST) From: Stefan =?UTF-8?Q?Reich=C3=B6r?= In-Reply-To: <87378k4m57.fsf@fastmail.com> (Marius Bakke's message of "Tue, 22 Aug 2017 00:00:04 +0200") References: <87valj72yp.fsf@xsteve.at> <87378k4m57.fsf@fastmail.com> Date: Tue, 22 Aug 2017 21:42:36 +0200 Message-ID: <87378jo0cz.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 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/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:= =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. > 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.