From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:32931) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCfxD-0000Vs-Th for guix-patches@gnu.org; Fri, 13 Mar 2020 04:46:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCfxC-0002Eg-Mv for guix-patches@gnu.org; Fri, 13 Mar 2020 04:46:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jCfxC-0002Eb-J2 for guix-patches@gnu.org; Fri, 13 Mar 2020 04:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jCfxC-0001ro-HM for guix-patches@gnu.org; Fri, 13 Mar 2020 04:46:02 -0400 Subject: [bug#39777] [PATCH V3 04/11] gnu: python-jsonschema: Update to 3.2.0. Resent-Message-ID: Date: Fri, 13 Mar 2020 09:45:41 +0100 From: Tanguy Le Carrour Message-ID: <20200313084541.zeditu3oaouqm2du@rafflesia> References: <20200309081827.13489-1-tanguy@bioneland.org> <20200309081827.13489-4-tanguy@bioneland.org> <20200311191542.GB13879@jasmine.lan> <20200312084828.o5lsuze5mmdrjg6w@rafflesia> <20200312174421.GA2140@jasmine.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200312174421.GA2140@jasmine.lan> 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: Leo Famulari Cc: 39777@debbugs.gnu.org Le 03/12, Leo Famulari a écrit : > On Thu, Mar 12, 2020 at 09:48:28AM +0100, Tanguy Le Carrour wrote: > > The test relies on a call to `subprocess.check_output` to run > > `python -m jsonschema --version`, but it behaves like `--version` was > > never passed to the command?! > > How do you know it behaves like that? Is there some error output? Actually, you're right, I don't know, because I didn't reproduce the exact same error! ``` $ ./pre-inst-env guix build python-jsonschema -K […] subprocess.CalledProcessError: Command '['/gnu/store/l8nphg0idd8pfddyad8f92lx8d1hc053-python-wrapper-3.7.4/bin/python', '-m', 'jsonschema', '--version']' returned non-zero exit status 1. ``` The exit status is 1. To reproduce it in the build directory I did the following: ``` $ cd /tmp/guix-build-python-jsonschema-3.2.0.drv-0/jsonschema-3.2.0/ $ guix environment python-jsonschema --ad-hoc python-importlib-metadata $ set -x PYTHONPATH .:$PYTHONPATH # I'm using Fish $ trial jsonschema/tests/test_cli.py [env] GUIX jsonschema.tests.test_cli TestCLI test_draft3_schema_draft4_validator ... [OK] test_successful_validation ... [OK] test_unsuccessful_validation ... [OK] test_unsuccessful_validation_multiple_instances ... [OK] test_version ... [ERROR] =============================================================================== [ERROR] Traceback (most recent call last): […] subprocess.CalledProcessError: Command '['/gnu/store/m4kgg8z52kn6xspmd3brvivd129d4i3s-python-wrapper-3.7.4/bin/python', '-m', 'jsonschema', '--version']' returned non-zero exit status 2. ``` But the exit status was… 2! Which I didn't pay attention at first. Then, I modified the code of the test to add some log: ``` $ trial jsonschema/tests/test_cli.py [env] GUIX jsonschema.tests.test_cli TestCLI test_draft3_schema_draft4_validator ... [OK] test_successful_validation ... [OK] test_unsuccessful_validation ... [OK] test_unsuccessful_validation_multiple_instances ... [OK] test_version ... usage: __main__.py [-h] [-i INSTANCES] [-F ERROR_FORMAT] [-V VALIDATOR] schema __main__.py: error: the following arguments are required: schema [ERROR] ``` This error message in the output is the one I would get by calling `python -m jsonschema` without `--version`. This was the end of my investigation and… a mistake! ^_^' Right after your question, I tried to do the same but directly from my package definition by adding a `substitute`: ``` (add-before 'check 'replace-check-output (lambda _ (substitute* "jsonschema/tests/test_cli.py" (("check_output") "check_call")) #t)) ``` Re-built the package and… got the exit status 1 with a different error message in the log: ``` jsonschema.tests.test_cli TestCLI test_draft3_schema_draft4_validator ... [OK] test_successful_validation ... [OK] test_unsuccessful_validation ... [OK] test_unsuccessful_validation_multiple_instances ... [OK] test_version ... /gnu/store/l8nphg0idd8pfddyad8f92lx8d1hc053-python-wrapper-3.7.4/bin/python: No module named jsonschema [ERROR] =============================================================================== [ERROR] Traceback (most recent call last): […] subprocess.CalledProcessError: Command '['/gnu/store/l8nphg0idd8pfddyad8f92lx8d1hc053-python-wrapper-3.7.4/bin/python', '-m', 'jsonschema', '--version']' returned non-zero exit status 1. ``` So, I'm left with the same question: - why does it fail with `No module named jsonschema`? and with a second one - why wasn't I able to reproduce the error from the build directory?! I still have a lot to learn! :-( Any help welcome! -- Tanguy