From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emIQP-0006UM-Tu for guix-patches@gnu.org; Thu, 15 Feb 2018 07:14:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emIQM-0000Mu-JT for guix-patches@gnu.org; Thu, 15 Feb 2018 07:14:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:35831) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emIQM-0000La-Ec for guix-patches@gnu.org; Thu, 15 Feb 2018 07:14:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1emIQL-0001J4-VS for guix-patches@gnu.org; Thu, 15 Feb 2018 07:14:02 -0500 Subject: [bug#30341] [PATCH 4/4] gnu: Add bpython. Resent-Message-ID: From: Marius Bakke In-Reply-To: <20180203222735.14042-3-h.goebel@crazy-compilers.com> References: <20180203222735.14042-1-h.goebel@crazy-compilers.com> <20180203222735.14042-3-h.goebel@crazy-compilers.com> Date: Thu, 15 Feb 2018 13:13:44 +0100 Message-ID: <87bmgqwivb.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: Hartmut Goebel , 30341@debbugs.gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hartmut Goebel writes: > * gnu/packages/python.scm (bpython, bpython2): New variables. [...] > +(define-public bpython > + (package > + (name "bpython") > + (version "0.17") > + (source > + (origin > + (method url-fetch) > + (uri (pypi-uri "bpython" version)) > + (sha256 > + (base32 > + "1mbah208jhd7bsfaa17fwpi55f7fvif0ghjwgrjmpmx8w1vqab9l")) > + (file-name (string-append name "-" version ".tar.gz")))) I think (file-name ...) here is unnecessary, no? > + (build-system python-build-system) > + (arguments > + `(#:phases > + (modify-phases %standard-phases > + (add-after 'unpack 'remove-failing-test ;; FIXME > + (lambda _ > + (delete-file "bpython/test/test_args.py"))) #t)) Could you add some information about why this is deleted? > + (add-after 'wrap 'add-aliases > + ;; for symmetry to bpython2, add symlinks bypthon3, bpdb3, et= c. > + (lambda* (#:key outputs #:allow-other-keys) > + (let ((out (assoc-ref outputs "out"))) > + (for-each > + (lambda (old new) > + (symlink old ;; (string-append out "/bin/" old) ^^^ leftover comment? :) > + (string-append out "/bin/" new))) > + '("bpython" "bpython-curses" "bpython-urwid" "bpdb") > + '("bpython3" "bpython3-curses" "bpython3-urwid" "bpdb3")= ))))))) #t))) > + (propagated-inputs > + `(("python-pygments" ,python-pygments) > + ("python-requests", python-requests) > + ("python-babel" ,python-babel) ;; optional, for internationalizat= ion > + ("python-curtsies" ,python-curtsies) ;; >=3D 0.1.18 > + ("python-greenlet" ,python-greenlet) > + ("python-urwid" ,python-urwid) ;; for bpython-urwid only ^^^ only one semicolon for inline comm= ents. > + ("python-six" ,python-six))) > + (native-inputs > + `(("python-sphinx" ,python-sphinx) > + ("python-mock" ,python-mock))) > + (home-page "https://bpython-interpreter.org/") > + (synopsis "Fancy interface to the Python interpreter") > + (description "Bpython is a fancy interface to the Python > +interpreter. bpython's main features are > + > +@enumerate > +@item in-line syntax highlighting, > +@item readline-like autocomplete with suggestions displayed as you type, > +@item expected parameter list for any Python function, > +@item \"rewind\" function to pop the last line of code from memory and > + re-evaluate, > +@item send the code you've entered off to a pastebin, > +@item save the code you've entered to a file, and > +@item auto-indentation. > +@end enumerate") > + (license license:expat))) > + > +(define-public bpython2 > + (let ((base (package-with-python2 > + (strip-python2-variant bpython)))) > + (package (inherit base) > + (name "bpython2") > + (arguments > + `(#:python ,python-2 > + #:phases > + (modify-phases %standard-phases > + (add-after 'unpack 'remove-failing-test ;; FIXME > + (lambda _ > + (delete-file "bpython/test/test_args.py") > + (substitute* "bpython/test/test_curtsies_repl.py" > + (("^(\\s*def )(test_get_last_word_with_prev_line\\W)" _ a= b) > + (string-append a "xxx_off_" b)) > + (("^(\\s*def )(test_complex\\W)" _ a b) > + (string-append a "xxx_off_" b))))) #t)) I'm not sure what's going on here, can you add a comment? Other than that looks good, thanks! > + (add-before 'build 'rename-scripts > + ;; rename the scripts to bypthon2, bpdb2, etc. > + (lambda _ > + (substitute* "setup.py" > + (("^(\\s+'bpdb)(\\s+=3D.*',?)\\s*?$" _ name rest) > + (string-append name "2" rest "\n")) > + (("^(\\s+'bpython)(-\\S+)?(\\s+=3D.*',?)\\s*?$" _ name = sub rest) > + (string-append name "2" (or sub "") rest "\n"))) > + #t)))))))) > --=20 > 2.13.6 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEyBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlqFeXgACgkQoqBt8qM6 VPrsVgf4xtReNi+5Q32FNV9/TdqEkujQnMoViy6cHEk7rZhotry3ERK/xewAsxLD Q2b+vWTZvrPhET1QBcFMMG+oiknUjAbONLPegZKdlsQ2Y1GpOWbWfxfGEKx6XzV7 V9sNL8AcYUXcQyBricM/dxV6olU1NlOw8sBB9qc68IZpx4ZA7Lpuu4gVB67aw+RW eKBJh+T7nUwQFQsoIVVP5dcQSLSyOpC25cv9as6YubvWgXC3wCHYojhwPdQ0JHFh hNxu5nyR4fFe6YpfIfX/dj/f792uv03m4dxCnFq3jkUukJ+TXAF3Uex57znsQ8wB spgrLO22GTYR7/qVeHXhUYjtxlj7 =K5XF -----END PGP SIGNATURE----- --=-=-=--