From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Branching based on Python version (was [PATCH 2/6] gnu: add python-sqlparse and python2-sqlparse) Date: Sun, 24 Apr 2016 23:40:29 +0200 Message-ID: <87inz6ado2.fsf@gnu.org> References: <1461266395-2731-1-git-send-email-h.goebel@crazy-compilers.com> <1461266395-2731-3-git-send-email-h.goebel@crazy-compilers.com> <20160424192402.GD9128@jasmine> 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]:48292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auRlb-0002Fp-Vu for guix-devel@gnu.org; Sun, 24 Apr 2016 17:40:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1auRlY-000585-Mn for guix-devel@gnu.org; Sun, 24 Apr 2016 17:40:35 -0400 In-Reply-To: <20160424192402.GD9128@jasmine> (Leo Famulari's message of "Sun, 24 Apr 2016 15:24:02 -0400") 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: Leo Famulari Cc: guix-devel@gnu.org Leo Famulari skribis: > On Thu, Apr 21, 2016 at 09:19:49PM +0200, Hartmut Goebel wrote: >> * gnu/packages/python.scm (python-sqlparse) (python2-sqlparse): >> New variables. > >> + (arguments >> + `(#:phases >> + (modify-phases %standard-phases >> + (replace 'check >> + (lambda* _ >> + ;; setup.py-integrated 2to3 only affects the build files, = but >> + ;; py.test is using the source files. So we need to conver= t them >> + ;; manually. >> + (if (zero? (system* "python3")) >> + (system* "2to3" "--no-diff" "-wn" "sqlparse" "tests") >> + #t) >> + (zero? (system* "py.test"))))))) > > I think there must be a better way to do this conditional, but I'm not > sure what it is. Does anyone have any ideas? (guix build python-build-system) includes =E2=80=98get-python-version=E2=80= =99, which could be used for this purpose. But I think the above is acceptable here (I=E2=80=99d use =E2=80=98when=E2= =80=99 instead of the one-armed =E2=80=98if=E2=80=99, but that=E2=80=99s purely cosmetic.) Thanks, Ludo=E2=80=99.