PEP 503 Simple Repository index by declaring routing rules

Inspired by @xafer’s comment in Dependency notation including the index URL:

I put together a tool that does this with local directories.

This is of course at alpha quality at best, although there isn’t really much that can go wrong—there’s no caching, no mirroring, no nothing; requests to non-local sources are transparently redirected with HTTP 302. I did some quick testing and things seem to work as expected.

I know very little about S3 and other web storage stuff, so it’s probably best to leave this in others’ hands.


Very nice!

I took a quick look, and would suggest you probably want an explicit extensibility/contrib mechanism, so that other can easily build the wrappers they need without having to force it all back onto yourself.

But as you say, there isn’t much to it :wink: PEP 503 is a pretty nicely designed system.

1 Like

0.2.0 now offers extensibility by registering simpleindex.routes.Route subclasses as simpleindex.routes entry points! I also wrote down briefly what a subclass should do in the readme.

1 Like

Which reminds me, when mousebender.simple gets upstreamed to packaging that we should include some code to get the appropriate HTML to make this sort of project even easier.

Does this mean something like turning an ArchiveLink back to an HTML anchor tag? That would definitely be very helpful.

Yep. If we know what the HTML is supposed to be like then we might as well provide it to help make sure people can generate standards-compliant simple indexes.