Hosting your own simple repositoryยถ
If you wish to host your own simple repository [1], you can either use a software package like devpi or you can simply create the proper directory structure and use any web server that can serve static files and generate an autoindex.
In either case, since youโll be hosting a repository that is likely not in your userโs default repositories, you should instruct them in your projectโs description to configure their installer appropriately. For example with pip:
python3 -m pip install --extra-index-url https://python.example.com/ foobar
py -m pip install --extra-index-url https://python.example.com/ foobar
In addition, it is highly recommended that you serve your repository with valid HTTPS. At this time, the security of your userโs installations depends on all repositories using a valid HTTPS setup.
โManualโ repositoryยถ
The directory layout is fairly simple, within a root directory you need to create a directory for each project. This directory should be the normalized name of the project. Within each of these directories simply place each of the downloadable files. If you have the projects โFooโ (with the versions 1.0 and 2.0) and โbarโ (with the version 0.1) You should end up with a structure that looks like:
.
โโโ bar
โย ย โโโ bar-0.1.tar.gz
โโโ foo
โโโ Foo-1.0.tar.gz
โโโ Foo-2.0.tar.gz
Once you have this layout, simply configure your webserver to serve the root
directory with autoindex enabled. For an example using the built in Web server
in Twisted, you would simply run twistd -n web --path . and then
instruct users to add the URL to their installerโs configuration.
Existing projectsยถ
Project |
Package upload |
PyPI fall-through [2] |
Additional notes |
|---|---|---|---|
โ |
โ |
multiple indexes with inheritance, with syncing, replication, fail-over; mirroring |
|
โ |
|||
โ |
|||
unmaintained; also cached proxying; authentication, authorisation |
|||
unmaintained; serve files in GitHub |
|||
โ |
also mirroring, proxying; plugin for Pulp |
||
also mirroring; manual synchronisation |
|||
not a server, but a static file site generator |
|||
standard-library |
|||
โ |
using mod_rewrite and mod_cache_disk, you can cache requests to package indexes through an Apache server |