Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 May 2016 08:39:47 +0300
From:      Roman Bogorodskiy <novel@FreeBSD.org>
To:        python@FreeBSD.org
Subject:   pypi URL schema change
Message-ID:  <20160501053945.GA2709@kloomba>

next in thread | raw e-mail | index | archive | help

--wRRV7LY7NUeQGEoC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

Recently pypi has changed its URL schema for distfiles. Specifically,
it was:

  /packages/{python version}/{name[0]}/{name}/{filename}

and now it is:

  /packages/{hash[:2]}/{hash[2:4]}/{hash[4:]}/{filename} Where hash is
  blake2b(file_content, digest_size=32).hexdigest().lower()

(copy/pasted from [1]).

That means that if you have MASTER_SITES= CHEESESHOP it won't be able to
fetch newer packages (however, it looks like it's still fine for the
previously uploaded packages).

As per [1], there's a fix applied on pypi.io that supports the old
schema by redirection to a proper URL. However, it looks like fetch(1)
is not quite happy about such a direct:

=> Attempting to fetch
https://pypi.io/packages/source/p/positional/positional-1.1.0.tar.gz
fetch:
https://pypi.io/packages/source/p/positional/positional-1.1.0.tar.gz:
Temporary Redirect
=> Attempting to fetch
http://distcache.FreeBSD.org/ports-distfiles/positional-1.1.0.tar.gz
fetch:
http://distcache.FreeBSD.org/ports-distfiles/positional-1.1.0.tar.gz:
Not Found

For now I have to redefine SUBDIR manually with the hash, e.g.:

MASTER_SITES=   CHEESESHOP
MASTER_SITE_SUBDIR=
bf/a8/bc656a556a60b76c32830b57279f51714ab7c6366fd243d6ea86b6fcad46

However, it feels a little awkward to keep a long hash like that in the
Makefile.

Any thoughts if there's a way to avoid that?

1: https://bitbucket.org/pypa/pypi/issues/438/backwards-compatible-un-hashed-package

Roman Bogorodskiy

--wRRV7LY7NUeQGEoC
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJXJZahAAoJEMltX/4IwiJqUoAIAJ7NSVoPevEl0JRpa1T0uJgd
D2IbHLiFcdqhJ/vovtOCNLmQ7XDnajPghzUDe5ihc4Zf7+afebyeOYYGqlMRENNv
qDqvqchkQ+pxNf8jZcn2EqrRJemDtCqny1s1zOqIj/a/GvTNtDRhliwJBF3T786A
TDHdaysnc82PaFZKx6ELD9ja/a1psYF+Zqtr3X9rfAFetsB9UeRGtDoTq0zDnZsi
FQfPCPwLk5mBGlRdnQFNULqh2qygh2Y6ehQ1Rw3Aj884keNj0OyaSAYWu5OwcXx3
cAtqwLcFm+1zV0Dw676iQwzcLkCRrf9lXAB7UEtMNCt+K/+tebI0RlRU/bVXJio=
=8llV
-----END PGP SIGNATURE-----

--wRRV7LY7NUeQGEoC--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160501053945.GA2709>