2011-07-29 03:14:09 +02:00
|
|
|
.. -*- mode: rst; coding: utf-8 -*-
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
pypiserver - minimal PyPI server for use with pip/easy_install
|
|
|
|
==============================================================================
|
|
|
|
|
2011-07-31 23:42:37 +02:00
|
|
|
:Authors: Ralf Schmitt <ralf@systemexit.de>
|
|
|
|
|
|
|
|
.. contents:: Table of Contents
|
|
|
|
:backlinks: top
|
|
|
|
|
|
|
|
|
2011-07-29 03:14:09 +02:00
|
|
|
pypiserver is a minimal PyPI compatible server. It can be used to
|
|
|
|
serve a set of packages and eggs to easy_install or pip.
|
|
|
|
|
|
|
|
Installation and Usage/Quickstart
|
|
|
|
=================================
|
2011-07-31 23:42:37 +02:00
|
|
|
pypiserver will work with python 2.5, 2.6 and 2.7. It will *not* work
|
|
|
|
with python versions >= 3 or < 2.5.
|
|
|
|
|
2011-07-29 03:14:09 +02:00
|
|
|
Run the following commands to get your PyPI server up and running::
|
|
|
|
|
|
|
|
pip install pypiserver
|
|
|
|
mkdir ~/packages
|
|
|
|
# copy some source packages or eggs to this directory
|
2011-08-01 01:58:04 +02:00
|
|
|
pypi-server -p 8080 ~/packages
|
2011-07-29 03:14:09 +02:00
|
|
|
pip install -i http://localhost:8080/simple/ ...
|
|
|
|
|
2011-08-01 23:09:42 +02:00
|
|
|
Alternative Installation as standalone script
|
|
|
|
=============================================
|
|
|
|
The git repository contains a 'pypi-server-standalone.py' script,
|
|
|
|
which is a single python file ready to be executed without any other
|
|
|
|
dependencies.
|
|
|
|
|
|
|
|
Run the following commands to download the script with wget::
|
|
|
|
|
|
|
|
wget https://raw.github.com/schmir/pypiserver/standalone/pypi-server-standalone.py
|
|
|
|
chmod +x pypi-server-standalone.py
|
|
|
|
|
|
|
|
or with curl::
|
|
|
|
|
|
|
|
curl -O https://raw.github.com/schmir/pypiserver/standalone/pypi-server-standalone.py
|
|
|
|
chmod +x pypi-server-standalone.py
|
|
|
|
|
|
|
|
The server can then be started with::
|
|
|
|
|
|
|
|
./pypi-server-standalone.py
|
|
|
|
|
|
|
|
Feel free to rename the script and move it into your $PATH.
|
|
|
|
|
2011-07-29 03:14:09 +02:00
|
|
|
|
2011-08-01 01:58:04 +02:00
|
|
|
Detailed Usage
|
|
|
|
=================================
|
|
|
|
pypi-server -h will print a detailed usage message::
|
|
|
|
|
|
|
|
pypi-server [OPTIONS] [PACKAGES_DIRECTORY]
|
|
|
|
start PyPI compatible package server serving packages from
|
|
|
|
PACKAGES_DIRECTORY. If PACKAGES_DIRECTORY is not given on the
|
|
|
|
command line, it uses the default ~/packages.
|
|
|
|
|
|
|
|
pypi-server understands the following options:
|
|
|
|
|
|
|
|
-p PORT, --port PORT
|
|
|
|
listen on port PORT (default: 8080)
|
|
|
|
|
|
|
|
-i INTERFACE, --interface INTERFACE
|
|
|
|
listen on interface INTERFACE (default: 0.0.0.0, any interface)
|
|
|
|
|
2011-08-09 23:03:50 +02:00
|
|
|
--disable-fallback
|
|
|
|
disable redirect to real PyPI index for packages not found in the
|
|
|
|
local index
|
2011-08-01 01:58:04 +02:00
|
|
|
|
|
|
|
--server METHOD
|
|
|
|
use METHOD to run the server. Valid values include paste,
|
|
|
|
cherrypy, twisted, gunicorn, gevent, wsgiref, auto. The
|
|
|
|
default is to use "auto" which chooses one of paste, cherrypy,
|
|
|
|
twisted or wsgiref.
|
|
|
|
|
2011-08-09 23:03:50 +02:00
|
|
|
-r PACKAGES_DIRECTORY, --root PACKAGES_DIRECTORY
|
|
|
|
[deprecated] serve packages from PACKAGES_DIRECTORY
|
|
|
|
|
2011-08-01 01:58:04 +02:00
|
|
|
pypi-server -h
|
|
|
|
pypi-server --help
|
|
|
|
show this help message
|
|
|
|
|
|
|
|
pypi-server --version
|
|
|
|
show pypi-server's version
|
|
|
|
|
|
|
|
Visit http://pypi.python.org/pypi/pypiserver for more information.
|
|
|
|
|
2011-08-09 23:28:14 +02:00
|
|
|
Configuring pip/easy_install
|
|
|
|
============================
|
|
|
|
Always specifying the the pypi url on the command line is a bit
|
|
|
|
cumbersome. Since pypi-server redirects pip/easy_install to the
|
|
|
|
pypi.python.org index if it doesn't have a requested package, it's a
|
|
|
|
good idea to configure them to always use your local pypi index.
|
|
|
|
|
|
|
|
pip
|
|
|
|
~~~~~
|
|
|
|
For pip this can be done by setting the environment variable
|
|
|
|
PIP_INDEX_URL in your .bashrc/.profile/.zshrc::
|
|
|
|
|
|
|
|
export PIP_INDEX_URL=http://localhost:8080/simple/
|
|
|
|
|
|
|
|
or by adding the following lines to ~/.pip/pip.conf::
|
|
|
|
|
|
|
|
[global]
|
|
|
|
index-url = http://localhost:8080/simple/
|
|
|
|
|
|
|
|
easy_install
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
For easy_install it can be configured with the following setting in
|
|
|
|
~/.pydistutils.cfg::
|
|
|
|
|
|
|
|
[easy_install]
|
|
|
|
index_url = http://localhost:8080/simple/
|
|
|
|
|
|
|
|
|
2011-08-01 01:58:04 +02:00
|
|
|
|
2011-07-29 03:14:09 +02:00
|
|
|
Optional dependencies
|
|
|
|
=====================
|
|
|
|
- pypiserver ships with it's own copy of bottle. It's possible to use
|
|
|
|
bottle with different wsgi servers. pypiserver chooses any of the
|
|
|
|
following paste, cherrypy, twisted, wsgiref (part of python) if
|
|
|
|
available.
|
|
|
|
|
2011-08-01 23:09:42 +02:00
|
|
|
Source
|
|
|
|
===========
|
|
|
|
Source releases can be downloaded from
|
|
|
|
http://pypi.python.org/pypi/pypiserver
|
|
|
|
|
|
|
|
https://github.com/schmir/pypiserver carries a git repository of the
|
|
|
|
in-development version.
|
|
|
|
|
|
|
|
Use::
|
|
|
|
|
|
|
|
git clone https://github.com/schmir/pypiserver.git
|
|
|
|
|
|
|
|
to create a copy of the repository, then::
|
|
|
|
|
|
|
|
git pull
|
|
|
|
|
|
|
|
inside the copy to receive the latest version.
|
|
|
|
|
2011-07-29 03:14:09 +02:00
|
|
|
|
|
|
|
Bugs
|
|
|
|
=============
|
2011-07-31 23:42:37 +02:00
|
|
|
pypiserver does not implement the full API as seen on PyPI_. It
|
|
|
|
implements just enough to make easy_install and pip install work.
|
|
|
|
|
|
|
|
The following limitations are known:
|
|
|
|
|
2011-07-29 03:14:09 +02:00
|
|
|
- pypiserver doesn't support uploading files. One might also consider
|
|
|
|
that a feature. scp provides a nice workaround.
|
2011-07-31 23:42:37 +02:00
|
|
|
- pypiserver doesn't implement the XMLRPC interface: pip search
|
|
|
|
will not work.
|
|
|
|
- pypiserver doesn't implement the json based '/pypi' interface. pyg_
|
|
|
|
uses that and will not work.
|
|
|
|
|
2011-08-01 23:09:42 +02:00
|
|
|
Please use github's bugtracker
|
|
|
|
https://github.com/schmir/pypiserver/issues if you find any other
|
|
|
|
bugs.
|
|
|
|
|
|
|
|
|
2011-07-31 23:42:37 +02:00
|
|
|
License
|
|
|
|
=============
|
|
|
|
pypiserver contains a copy of bottle_ which is available under the
|
|
|
|
MIT license::
|
|
|
|
|
|
|
|
Copyright (c) 2010, Marcel Hellkamp.
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
The remaining part is distributed under the zlib/libpng license::
|
|
|
|
|
|
|
|
Copyright (c) 2011 Ralf Schmitt
|
|
|
|
|
|
|
|
This software is provided 'as-is', without any express or implied
|
|
|
|
warranty. In no event will the authors be held liable for any damages
|
|
|
|
arising from the use of this software.
|
|
|
|
|
|
|
|
Permission is granted to anyone to use this software for any purpose,
|
|
|
|
including commercial applications, and to alter it and redistribute it
|
|
|
|
freely, subject to the following restrictions:
|
|
|
|
|
|
|
|
1. The origin of this software must not be misrepresented; you must not
|
|
|
|
claim that you wrote the original software. If you use this software
|
|
|
|
in a product, an acknowledgment in the product documentation would be
|
|
|
|
appreciated but is not required.
|
|
|
|
|
|
|
|
2. Altered source versions must be plainly marked as such, and must not be
|
|
|
|
misrepresented as being the original software.
|
|
|
|
|
|
|
|
3. This notice may not be removed or altered from any source
|
|
|
|
distribution.
|
|
|
|
|
|
|
|
|
|
|
|
Similar Projects
|
|
|
|
====================
|
|
|
|
There are lots of other projects, which allow you to run your own
|
|
|
|
PyPI server. If pypiserver doesn't work for you, try one of the
|
|
|
|
following alternatives:
|
|
|
|
|
2011-08-01 01:58:04 +02:00
|
|
|
chishop (http://pypi.python.org/pypi/chishop)
|
2011-07-31 23:42:37 +02:00
|
|
|
a django based server, which also allows uploads
|
2011-08-01 01:58:04 +02:00
|
|
|
|
|
|
|
simplepypi (http://pypi.python.org/pypi/simplepypi)
|
2011-07-31 23:42:37 +02:00
|
|
|
a twisted based solution, which allows uploads
|
2011-08-01 01:58:04 +02:00
|
|
|
|
|
|
|
ClueReleaseManager (http://pypi.python.org/pypi/ClueReleaseManager)
|
2011-07-31 23:42:37 +02:00
|
|
|
Werkzeug based solution, allows uploads
|
2011-08-01 01:58:04 +02:00
|
|
|
|
|
|
|
haufe.eggserver (http://pypi.python.org/pypi/haufe.eggserver)
|
2011-08-01 02:40:38 +02:00
|
|
|
GROK/Zope based, allows uploads
|
2011-08-01 01:58:04 +02:00
|
|
|
|
|
|
|
scrambled (http://pypi.python.org/pypi/scrambled)
|
2011-07-31 23:42:37 +02:00
|
|
|
doesn't require external dependencies, no uploads.
|
2011-08-01 01:58:04 +02:00
|
|
|
|
|
|
|
EggBasket (http://pypi.python.org/pypi/EggBasket)
|
2011-08-01 02:40:38 +02:00
|
|
|
TurboGears based, allows uploads
|
2011-07-31 23:42:37 +02:00
|
|
|
|
|
|
|
.. _bottle: http://bottlepy.org
|
|
|
|
.. _PyPI: http://pypi.python.org
|
|
|
|
.. _pyg: http://pypi.python.org/pypi/pyg
|