Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A buildout config for mirroring PyPi. With this solution you will have your own PyPi in your home or bussiness network.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 doc
Octocat-spinner-32 etc
Octocat-spinner-32 patch
Octocat-spinner-32 CHANGELOG
Octocat-spinner-32 README.rst
Octocat-spinner-32 bootstrap.py
Octocat-spinner-32 buildout.cfg
README.rst

PyPi Mirror Installer

The PyPi mirror installer is a source-installation kit that installs a PyPi mirror and all its dependencies.

Feedback/bugs to: sven@so36.net

Credits:

Issue tracker and development

This buildout for PyPi Mirror is developed on Github. The issue tracker also lives there.

Installation Instructions

The installer will compile Nginx and it will install required python eggs from Pypi. (See "Dependencies" below.)

It's recommended to install PyPi Mirror inside a virtualenv.

First of all, edit buildout.cfg and modify the following parameters:

mirror-base at repository section. This is the directory where all packages will be downloaded.

Example:

mirror-base = /media/sd/pypi

url at mirror-config. That URL will be the URL for access to your PyPi mirror.

Example:

url = http://pypi.mviera.es

Once you have installed all required dependencies, you can continue with the installation process. So you execute the following command:

$ python2.6 bootstrap.py

You should have the buildout environment ready to go. Now, you must execute the buildout installation:

$ bin/buildout

At the end, you should have the 'bin/pypimirror' binary. Now it's time to start downloading packages from PyPi executing the following command:

$ bin/pypimirror -I -c -v etc/pypi/pypimirror.cfg

Dependencies

The following packages are necessary to run buildout and install the PyPi mirror.:

setuptools
gcc
GNU make
libpcre3-dev
libssl-dev

Startup/Shutdown/Restart instructions

You should run bin/supervisord and Nginx server should be automatically started.

To start Nginx,:

$HOME/bin/supervisorctl start nginx

To stop Nginx,:

$HOME/bin/supervisorctl stop nginx

To restart Nginx,:

$HOME/bin/supervisorctl restart nginx

To check status,:

$HOME/bin/supervisorctl status nginx

Also, you can access to Supervisor Admin Panel at:

http://localhost:9000/

(Use the default admin password in doc/adminPassword.txt)

To change the admin password, edit the supervisor part in buildout.cfg and run bin/buildout.

Password changes will not be reflected in doc/adminPassword.txt.

Ports

Nginx server runs on port 8080

Supervisord server runs on port 9000

Edit buildout.cfg and run bin/buildout to change ports.

Post-installation instructions

Now, we have our PyPi mirror ready to go. We must to run the following command::

$HOME/bin/pypimirror -I -c -v $HOME/etc/pypi/pypimirror.cfg

This command will start downloading all packages from PyPi. When finished an index.html file will be generated containing an index with all downloaded packages.

At this time, you should be able to access to that index at:

http://localhost:8080/

Mirror update

When the buildout installation process has finished it configures a cron job for keeping the mirror up to date every two hours.

You can see this cron job executing the following command:

$ crontab -l

Edit the buildout.cfg and run bin/buildout to change the cron job execution frequency.

Uninstall instructions

  1. Stop supervisord
  2. Remove the folder $HOME/pypi-mirror
Something went wrong with that request. Please try again.