Subject: bug#34266: pypi importer cannot handle [ and ] correctly

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 29 Mar 2019 00:19:12 -0400

swedebugia <[email-masked]> writes:

> $ ./pre-inst-env guix import pypi beaker
>
> following redirection to `https://pypi.org/pypi/Beaker/json'...
>
> Starting download of /tmp/guix-file.p15GJZ
> From
> https://files.pythonhosted.org/packages/c2/21/b052b2fbfee3def06670923d5d34b0d353d4c278013e4a714c3fb663f150/Beaker-1.10.0.tar.gz...
>  ...0.0.tar.gz  40KiB                 521KiB/s 00:00
> [##################] 100.0%
> (package
>   (name "python-beaker")
>   (version "1.10.0")
>   (source
>     (origin
>       (method url-fetch)
>       (uri (pypi-uri "beaker" version))
>       (sha256
>         (base32
>           "0l047yl3n9b3w7ba0wrqdb5fpww5y8pjy20kah2mlpr230lqjwk0"))))
>   (build-system python-build-system)
>   (propagated-inputs
>     `(("python-[crypto]" ,#{python-\x5b;crypto\x5d;}#)
>       ("python-[cryptography]"
>        ,#{python-\x5b;cryptography\x5d;}#)
>       ("python-[pycrypto]"
>        ,#{python-\x5b;pycrypto\x5d;}#)
>       ("python-[pycryptodome]"
>        ,#{python-\x5b;pycryptodome\x5d;}#)
>       ("python-[testsuite]"
>        ,#{python-\x5b;testsuite\x5d;}#)
>       ("python-coverage" ,python-coverage)
>       ("python-cryptography" ,python-cryptography)
>       ("python-cryptography" ,python-cryptography)
>       ("python-funcsigs" ,python-funcsigs)
>       ("python-memcached" ,python-memcached)
>       ("python-mock" ,python-mock)
>       ("python-nose" ,python-nose)
>       ("python-pycrypto" ,python-pycrypto)
>       ("python-pycryptodome" ,python-pycryptodome)
>       ("python-pycryptodome" ,python-pycryptodome)
>       ("python-pycryptopp" ,python-pycryptopp)
>       ("python-pylibmc" ,python-pylibmc)
>       ("python-pymongo" ,python-pymongo)
>       ("python-redis" ,python-redis)
>       ("python-sqlalchemy" ,python-sqlalchemy)
>       ("python-webtest" ,python-webtest)))
>   (home-page "https://beaker.readthedocs.io/")
>   (synopsis
>     "A Session and Caching library with WSGI Middleware")
>   (description
>     "A Session and Caching library with WSGI Middleware")
>   (license license:bsd-3))

Testing with my soon-to-be sent for review changes:

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix import pypi beaker
following redirection to `https://pypi.org/pypi/Beaker/json'...

Starting download of /tmp/guix-file.0MWu4B
>From https://files.pythonhosted.org/packages/76/87/ecc1a222f0caaa7ba7b8928737e89b2e91b8c22450c12b8a51ee625a4d87/Beaker-1.10.1.tar.gz...
 …0.1.tar.gz  40KiB                   487KiB/s 00:00 [##################] 100.0%
(package
  (name "python-beaker")
  (version "1.10.1")
  (source
    (origin
      (method url-fetch)
      (uri (pypi-uri "beaker" version))
      (sha256
        (base32
          "16zdjfl8v73yl1capph0n371vd26c7zpzb48n505ip32ffgmvc4f"))))
  (build-system python-build-system)
  (native-inputs
    `(("python-coverage" ,python-coverage)
      ("python-cryptography" ,python-cryptography)
      ("python-memcached" ,python-memcached)
      ("python-mock" ,python-mock)
      ("python-nose" ,python-nose)
      ("python-pycryptodome" ,python-pycryptodome)
      ("python-pylibmc" ,python-pylibmc)
      ("python-pymongo" ,python-pymongo)
      ("python-redis" ,python-redis)
      ("python-sqlalchemy" ,python-sqlalchemy)
      ("python-webtest" ,python-webtest)))
  (home-page "https://beaker.readthedocs.io/")
  (synopsis
    "A Session and Caching library with WSGI Middleware")
  (description
    "A Session and Caching library with WSGI Middleware")
  (license license:bsd-3))
--8<---------------cut here---------------end--------------->8---

Looking better?

Maxim