| Store | Cart

Re: [Distutils] PEP 503 - Simple Repository API

From: Marius Gedminas <mar...@gedmin.as>
Sat, 5 Sep 2015 11:44:33 +0300
On Fri, Sep 04, 2015 at 09:17:18PM -0400, Donald Stufft wrote:
> You can see this PEP online at https://www.python.org/dev/peps/pep-0503/ or I> have reproduced it inline below.> 
> Below the root URL is another URL for each individual project contained within> a repository. The format of this URL is ``/<project>/`` where the ``<project>``> is replaced by the normalized name for that project, so a project named> "HolyGrail" would have an URL like ``/holygrail/``. This URL must response with

Typo: "must response" -> "must respond"

> a valid HTML5 page with a single anchor element per file for the project. The> text of the anchor tag **MUST** be the filename of the file and the href> attribute **MUST** be an URL that links to the location of the file for> download. The URL **SHOULD** include a hash in the form of an URL fragment with> the following syntax: ``#<hashname>=<hashvalue>``, where ``<hashname>`` is the> lowercase name of the hash function (such as ``sha256``) and ``<hashvalue>`` is> the hex encoded digest.> > In addition to the above, the following constraints are placed on the API:> > * All URLs **MUST** end with a ``/`` and the repository **SHOULD** redirect the>   URLs without a ``/`` to add a ``/`` to the end.

(except for URLs pointing to downloadable files, I presume?)

> * There is no constraints on where the files must be hosted relative to the>   repository.> Normalized Names> ----------------> > This PEP references the concept of a "normalized" project name. As per PEP 426> the only valid characters in a name are the ASCII alphabet, ASCII numbers,> ``.``, ``-``, and ``_``.

For a second I thought this referred to a normalized name and got
confused ("I thought _ and - were interchangeable?").

Maybe it's worth clarifying with s/in a name/in a ("unnormalized")
name/.  Or maybe not -- the rest of the paragraph clears away the
confusion quickly enough.

> The name should be lowercased with all runs of the> characters ``.``, ``-``, or ``_`` replaced with a single ``-`` character. This> can be implemented in Python with the ``re`` module::> >    import re> >    def normalize(name):>        return re.sub(r"[-_.]+", "-", name).lower()

Oh, excellent!  Having this documented briefly and clearly is most welcome!

Marius Gedminas
<Corsac> yeah, i'm reading the answers, currently
<Corsac> but what I see is that there is no real procedure to rebuild initfs
<Corsac> the common way seems to use a loop device with a jffs2 filesystem, put
         original files there, and add other files, then umount, flash and pray
   <dwd> Corsac: You forgot "ritual sacrifice of a medium sized rodent".
         Without that, it'll never work.
   <zuh> And if it doesn't work the first time, re-adjust towel ordering in the
         restroom and try again
                -- #maemo

Distutils-SIG maillist  -  Dist...@python.org

Recent Messages in this Thread
Donald Stufft Sep 05, 2015 01:17 am
Donald Stufft Sep 05, 2015 01:19 am
Nick Coghlan Sep 05, 2015 03:09 am
Marius Gedminas Sep 05, 2015 08:44 am
M.-A. Lemburg Sep 05, 2015 09:43 am
Donald Stufft Sep 05, 2015 04:12 pm
Donald Stufft Sep 05, 2015 04:15 pm
Paul Moore Sep 07, 2015 02:43 pm
Wes Turner Sep 07, 2015 05:05 pm
Nick Coghlan Sep 08, 2015 12:43 am
Nick Coghlan Sep 08, 2015 01:07 am
Wes Turner Sep 07, 2015 05:29 pm
M.-A. Lemburg Sep 07, 2015 09:05 pm
Donald Stufft Sep 08, 2015 01:37 am
Wes Turner Sep 08, 2015 03:19 am
Donald Stufft Sep 24, 2015 04:03 pm
Messages in this thread