Skip to main content

Mirroring tool that implements a local pip mirror via PyPi

Project description

This application implements a PyPI mirror application according to PEP 381.

Installation

It is possible to run this application directly from the source distribution. Alternatively, ‘python setup.py install’ could be used.

The actual mirroring is performed by the pip_mirrorrun script, which should be invoked through cron like this:

*/15 *  *   *   *     /path/pip_mirror/pip_mirror -q /var/pypi

The command line arguments points to root of the data files that the mirror creates. An initial run (without the -q option) should be performed manually. It is possible to interrupt the mirroring; it will automatically know where to continue when restarted.

In above example, /var/pypi/web must be served through the webserver. An Apache configuration could read like this:

<VirtualHost IPADDRESS:80>
  ServerName X.pypi.python.org
  CustomLog /var/log/apache2/pypi.log combined
  DocumentRoot /var/pypi/web
  SetEnv PYPITARGET /var/pypi
  ScriptAlias /sync /path/pip_mirrorsync.cgi
</VirtualHost>

Notice that supporting the sync URL requires that the web server user has access to the mirror data, or else that the CGI script runs as the mirror user.

To propagate the download statistics back to the central server, processlogs must be run regularly, e.g. through:

10 7  *   *   *     /path/pip_mirror/processlogs /var/pypi /var/log/apache2/pypi.log{,.1}

Contact

If you have questions or comments, please submit a bug report to https://github.com/ianmaguire/pip_mirror/issues, or contact me at mr.scalability@gmail.com

Changes

1.0 (2018-01-25):

  • Forked from pep381_client

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pip_mirror-0.2.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pip_mirror-0.2-py2.py3-none-any.whl (14.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pip_mirror-0.2.tar.gz.

File metadata

  • Download URL: pip_mirror-0.2.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pip_mirror-0.2.tar.gz
Algorithm Hash digest
SHA256 a8795e6f4333393785605bb585e7c62714ee9d8ae8d371451e0d57e753c238d9
MD5 21716d8deabff5d0841ff2d403ba5728
BLAKE2b-256 ca3deae1ab2b1bbcf9f308a7bdbf28f9a0f03c6d144114af2d86c8fd052bd041

See more details on using hashes here.

File details

Details for the file pip_mirror-0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pip_mirror-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1041ce9fdaae7df0594f69a965b66f1bcc65c1f51a179b1f63ac4ee0575ab632
MD5 78b8ab239de9a3e1aa84eb5e9bdb27bd
BLAKE2b-256 47906621df48d1cda3022b84f22d39016c3c96f66a4729ced07a7b0bcb12309f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page