Skip to content
This repository has been archived by the owner on Feb 15, 2020. It is now read-only.

Latest commit

 

History

History
79 lines (51 loc) · 2.13 KB

README.rst

File metadata and controls

79 lines (51 loc) · 2.13 KB

localshop

A pypi server which automatically proxies and mirrors pypi packages based upon packages requested. It also supports the uploading of local (private) packages.

Getting started

Download and install localshop via the following command:

pip install localshop

This should best be done in a new virtualenv. Now initialize your localshop environment by issuing the following command:

localshop init
localshop upgrade

And then start it via:

localshop run_gunicorn
localshop celeryd -B -E

Celeryd is required to do the mirroring of the pypi packages once they are needed.

Create an initial user via the following command:

localshop manage createsuperuser 

You can now visit http://localhost:8900/ and view all the packages in your localshop!

The next step is to give access to various hosts to use the shop. This is done via the webinterface (menu -> permissions -> cidr). Each ip address listed there will be able to download and upload packages.

How it works

Packages which are requested and are unknown are looked up on pypi via the xmlrpc interface. At the moment the client downloads one of the files which is not yet mirror'ed a 302 redirect is issued to the correct file (on pypi). At that point the worker starts downloading the package and stores it in ~/.localshop/files so that the next time the package is request it is available within your own shop!

Uploading local/private packages

To upload your own packages to your shop you need to modify/create a .pypirc file. See the following example:

[distutils]
index-servers =
    local

[local]
username: myusername
password: mysecret
repository: http://localhost:8900/simple/

To upload a custom package issue the following command in your package:

python setup.py upload -r local

It should now be available via the webinterace

Using the shop for package installation

To install packages with pip from your localshop add -i flag, e.g.:

pip install -i http://localhost:8900/simple/ localshop