Skip to main content

Simple pypi package

Project description

Simple python package index

How simpypi works

The heart of simpypi is simpypi.wsgi.SimPyPI, a simple WSGI web app that accepts a uploaded python package distribution and places it according to its name and version metadata appropriate to the simple index protocol .

For security, SimPyPI returns straight HTTP 400 s for invalid requests. This could probably be improved.

SimPyPI itself does not serve this directory. The directory should be served by a fileserver that will generate directory indices (as apprpropriate to ) such as Apache or FileServer . simpypi.factory.factory does provide a factory to make a WSGI app that wraps FileServer in middleware and serves the simple index under /index/ and the SimPyPI app at /. Additionally, a simpypi command line program is provided that front-ends this.

Currently simpypi only works on source distributions (that is, packages made with python sdist).


I installed an instance of simpypi at for demonstration purposes with a package index at . For testing purposes, I made a script, that uploads the mozbase packages to simpypi. So the index is now populated with them.

You can upload packages with curl

> wget
> curl -F 'package=@PyYAML-3.10.tar.gz'

You can easy_install mozbase from . If a package’s dependencies can be found from the simpypi package index, they will also be installed from the index:

> tmp
New python executable in tmp/bin/python
Installing setuptools............done.
Installing pip...............done.
> cd tmp/
(tmp)│easy_install -i mozrunner
Searching for mozrunner
Best match: mozrunner 5.1
Processing mozrunner-5.1.tar.gz
Running mozrunner-5.1/ -q bdist_egg --dist-dir
Adding mozrunner 5.1 to easy-install.pth file
Installing mozrunner script to /home/jhammel/tmp/bin
Processing dependencies for mozrunner
Searching for mozprofile>=0.1
Best match: mozprofile 0.1
Processing mozprofile-0.1.tar.gz
Running mozprofile-0.1/ -q bdist_egg --dist-dir
Adding mozprofile 0.1 to easy-install.pth file
Installing mozprofile script to /home/jhammel/tmp/bin
Searching for mozprocess
Best match: mozprocess 0.1b2
Processing mozprocess-0.1b2.tar.gz
Running mozprocess-0.1b2/ -q bdist_egg --dist-dir
Adding mozprocess 0.1b2 to easy-install.pth file
Searching for mozinfo
Best match: mozinfo 0.3.3
Processing mozinfo-0.3.3.tar.gz
Running mozinfo-0.3.3/ -q bdist_egg --dist-dir
Adding mozinfo 0.3.3 to easy-install.pth file
Installing mozinfo script to /home/jhammel/tmp/bin
Searching for ManifestDestiny>=0.5.4
Best match: ManifestDestiny 0.5.4
Processing ManifestDestiny-0.5.4.tar.gz
Running ManifestDestiny-0.5.4/ -q bdist_egg --dist-dir
Adding ManifestDestiny 0.5.4 to easy-install.pth file
Installing manifestparser script to /home/jhammel/tmp/bin
Finished processing dependencies for mozrunner

Note that all of the packages come from the installation and not from .

Running the Tests

The tests directory contains doctests and the test-runner, . These tests illustrate basic functionality and protect from regressions if they are run before code is committed. tests-require.txt contains dependencies that should be installed to run the tests. Paste TestApp , though this could be transitioned to WebTest . virtualenv is used for isolating python environments.

To run the tests, do:



While simpypi is pretty simple, just because it is only 100 lines of code doesn’t mean that it is the right 100 lines of code. The following issues could be addressed:

  • the temporary package should be dealt with entirely in memory, ideally. Currently we write to a file and move it.

  • simpypi use pkginfo.sdist to read the data from a source distribution. Instead, the uploaded package should probably be unpacked and python sdist run and the resulting package put in the appropriate place. This will allow archives without PKG-INFO (e.g. ) to be uploaded as well as at least partially correct for the fact that currently simpypi only works for uploaded source distributions.

Project details

Download files

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

Source Distribution

simpypi-0.1.3.tar.gz (6.0 kB view hashes)

Uploaded Source

Supported by

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