From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 4/5] import: pypi: Compute test requirements when reading requirements files. Date: Fri, 22 Jul 2016 23:30:37 +0200 Message-ID: <87d1m5pdhe.fsf@gnu.org> References: <1468682605-12622-1-git-send-email-tipecaml@gmail.com> <1468682605-12622-5-git-send-email-tipecaml@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQi1t-000821-L5 for guix-devel@gnu.org; Fri, 22 Jul 2016 17:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQi1p-00062v-NU for guix-devel@gnu.org; Fri, 22 Jul 2016 17:30:45 -0400 In-Reply-To: <1468682605-12622-5-git-send-email-tipecaml@gmail.com> (Cyril Roelandt's message of "Sat, 16 Jul 2016 17:23:24 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Cyril Roelandt Cc: guix-devel@gnu.org Cyril Roelandt skribis: > * guix/import/pypi.scm (guess-requirement-from-source): Read > test-requirements.txt as well as requirements.txt. > * tests/pypi.scm ("pypi->guix-package"): Update accordingly. [...] > (let* ((req-file (string-append dirname "/requirements.txt")) > - (exit-code (system* "tar" "xf" tarball req-file))) > + (test-req-file (string-append dirname "/test-requiremen= ts.txt")) > + (exit-code (system* "tar" "xf" tarball req-file)) > + (test-exit-code (system* "tar" "xf" tarball test-req-fi= le))) > ;; TODO: support more formats. > - (if (zero? exit-code) > + (if (or (zero? exit-code) > + (zero? test-exit-code)) This seems to suggest that this could be factorized somehow. Maybe unpack once and read the two files at once? Ludo=E2=80=99.