2011-07-29 03:14:09 +02:00
|
|
|
.. -*- mode: rst; coding: utf-8 -*-
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
pypiserver - minimal PyPI server for use with pip/easy_install
|
|
|
|
==============================================================================
|
2015-09-11 18:40:07 +02:00
|
|
|
|pypi-ver| |travis-status| |dependencies| |downloads-count| |python-ver| \
|
|
|
|
|proj-license|
|
2011-07-29 03:14:09 +02:00
|
|
|
|
2015-12-21 02:09:43 +01:00
|
|
|
:Version: 1.1.9-dev.4
|
2015-03-08 18:37:34 +01:00
|
|
|
:Date: 2015-03-8
|
2015-02-27 23:02:07 +01:00
|
|
|
:Source: https://github.com/pypiserver/pypiserver
|
2015-09-16 23:54:41 +02:00
|
|
|
:PyPI: https://pypi.python.org/pypi/pypiserver
|
2015-09-15 21:28:25 +02:00
|
|
|
:Travis: https://travis-ci.org/pypiserver/pypiserver
|
2015-12-21 11:49:14 +01:00
|
|
|
:Maintainer: Kostis Anagnostopoulos <ankostis@gmail.com>
|
2015-09-11 18:40:07 +02:00
|
|
|
:License: zlib/libpng + MIT
|
2011-07-31 23:42:37 +02:00
|
|
|
|
|
|
|
.. contents:: Table of Contents
|
|
|
|
:backlinks: top
|
|
|
|
|
|
|
|
|
2015-09-11 18:40:07 +02:00
|
|
|
*pypiserver* is a minimal PyPI_ compatible server.
|
|
|
|
It can be used to upload and serve packages, wheels and eggs
|
|
|
|
to *pip* or *easy_install*.
|
2015-03-08 23:21:35 +01:00
|
|
|
The packages are stored in regular directories.
|
2015-02-27 23:02:07 +01:00
|
|
|
|
2011-07-29 03:14:09 +02:00
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
|
|
|
|
Quickstart: Installation and Usage
|
|
|
|
==================================
|
2015-09-11 18:40:07 +02:00
|
|
|
*pypiserver* will work with python 2.5 --> 2.7 and 3.2 --> 3.4.
|
|
|
|
Python 3.0 and 3.1 may also work, but pypiserver is not being tested
|
2015-03-08 18:37:34 +01:00
|
|
|
with these versions.
|
2011-07-31 23:42:37 +02:00
|
|
|
|
2011-07-29 03:14:09 +02:00
|
|
|
Run the following commands to get your PyPI server up and running::
|
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
## Installation.
|
2015-09-24 14:37:29 +02:00
|
|
|
pip install pypiserver[passlib]
|
2015-03-08 18:37:34 +01:00
|
|
|
mkdir ~/packages ## Copy packages into this directory.
|
2015-09-11 18:40:07 +02:00
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
## Start server.
|
2015-05-09 17:35:59 +02:00
|
|
|
pypi-server -p 8080 ~/packages & ## Will listen to all IPs.
|
2015-02-27 23:02:07 +01:00
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
## Download and Install hosted packages.
|
2015-02-27 13:13:54 +01:00
|
|
|
pip install --extra-index-url http://localhost:8080/simple/ ...
|
2011-07-29 03:14:09 +02:00
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
See also `Client-side configurations`_ for avoiding tedious typing.
|
2014-01-05 01:32:34 +01:00
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
.. Note::
|
|
|
|
The above commands work on a unix-like operating system with a posix shell.
|
|
|
|
The ``~`` character expands to user's home directory.
|
2015-09-11 18:40:07 +02:00
|
|
|
|
|
|
|
If you're using windows, you'll have to use their "windows counterparts".
|
2015-03-08 18:37:34 +01:00
|
|
|
The same is true for the rest of this documentation.
|
2015-02-27 23:02:07 +01:00
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
|
|
|
|
Uploading packages from sources, remotely
|
|
|
|
-----------------------------------------
|
2015-09-11 18:40:07 +02:00
|
|
|
Instead of copying packages directly to the server's folder,
|
2015-03-08 18:37:34 +01:00
|
|
|
you may also upload them remotely with a ``python setup.py upload`` command.
|
|
|
|
Currently only password-protected uploads are supported!
|
|
|
|
|
2015-09-11 18:40:07 +02:00
|
|
|
#. First make sure you have the *passlib* module installed,
|
2015-03-08 18:37:34 +01:00
|
|
|
which is needed for parsing the apache *htpasswd* file specified by
|
|
|
|
the `-P`, `--passwords` option (see next steps)::
|
|
|
|
|
|
|
|
pip install passlib
|
|
|
|
|
2015-09-11 18:40:07 +02:00
|
|
|
#. Create the apache *htpasswd* file with at least one user/password pair
|
2015-03-08 18:37:34 +01:00
|
|
|
with this command (you'll be prompted for a password)::
|
|
|
|
|
|
|
|
htpasswd -sc .htaccess <some_username>
|
|
|
|
|
|
|
|
.. Tip::
|
2015-09-11 18:40:07 +02:00
|
|
|
Read this SO question for running `htpasswd` cmd under *Windows*:
|
|
|
|
|
2015-09-17 01:39:13 +02:00
|
|
|
http://serverfault.com/questions/152950/how-to-create-and-edit-htaccess-and-htpasswd-locally-on-my-computer-and-then-u
|
|
|
|
|
|
|
|
or if you have bogus passwords for an internal service you may use this
|
|
|
|
public service:
|
|
|
|
|
|
|
|
http://www.htaccesstools.com/htpasswd-generator/
|
2015-09-11 18:40:07 +02:00
|
|
|
|
|
|
|
It is also possible to disable authentication even for uploads.
|
2015-09-17 13:52:00 +02:00
|
|
|
To avoid lazy security decisions, read help for ``-P`` and ``-a`` options.
|
2015-09-11 18:40:07 +02:00
|
|
|
|
|
|
|
#. You need to restart the server with the `-P` option only once
|
2015-03-08 18:37:34 +01:00
|
|
|
(but user/password pairs can later be added or updated on the fly)::
|
|
|
|
|
|
|
|
./pypi-server -p 8080 -P .htaccess ~/packages &
|
|
|
|
|
|
|
|
#. On client-side, edit or create a `~/.pypirc` file with a similar content::
|
|
|
|
|
|
|
|
[distutils]
|
|
|
|
index-servers =
|
|
|
|
pypi
|
2015-09-17 13:52:00 +02:00
|
|
|
local
|
2015-09-11 18:40:07 +02:00
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
[pypi]
|
|
|
|
username:<your_pypi_username>
|
|
|
|
password:<your_pypi_passwd>
|
2015-09-11 18:40:07 +02:00
|
|
|
|
2015-09-17 13:52:00 +02:00
|
|
|
[local]
|
2015-03-08 18:37:34 +01:00
|
|
|
repository: http://localhost:8080
|
|
|
|
username: <some_username>
|
|
|
|
password: <some_passwd>
|
|
|
|
|
2015-09-11 18:40:07 +02:00
|
|
|
#. Then from within the directory of the python-project you wish to upload,
|
2015-03-08 18:37:34 +01:00
|
|
|
issue this command::
|
|
|
|
|
2015-09-17 13:52:00 +02:00
|
|
|
python setup.py sdist upload -r local
|
|
|
|
|
2015-09-18 18:26:25 +02:00
|
|
|
.. Tip::
|
|
|
|
To avoid storing you passwords on disk in clear text, you may either:
|
|
|
|
- Use the `register` command with the `-r` option, like that::
|
2015-09-19 02:09:20 +02:00
|
|
|
|
2015-09-18 18:26:25 +02:00
|
|
|
python setup.py sdist register -r local upload -r local
|
2015-09-19 02:09:20 +02:00
|
|
|
|
2015-09-18 18:26:25 +02:00
|
|
|
- Use `twine <https://pypi.python.org/pypi/twine>`_ library which
|
2015-09-19 02:09:20 +02:00
|
|
|
breaks the procedure in two steps.
|
2015-03-08 18:37:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
Client-side configurations
|
|
|
|
--------------------------
|
|
|
|
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_EXTRA_INDEX_URL` in your `.bashrc`/`.profile`/`.zshrc`::
|
|
|
|
|
|
|
|
export PIP_EXTRA_INDEX_URL=http://localhost:8080/simple/
|
|
|
|
|
|
|
|
or by adding the following lines to `~/.pip/pip.conf`::
|
|
|
|
|
|
|
|
[global]
|
|
|
|
extra-index-url = http://localhost:8080/simple/
|
2015-02-27 23:02:07 +01:00
|
|
|
|
|
|
|
.. Note::
|
2015-09-11 18:40:07 +02:00
|
|
|
If you have installed *pypi-server* on a remote url without *https*
|
2015-03-08 18:37:34 +01:00
|
|
|
you wil receive an "untrusted" warning from *pip*, urging you to append
|
|
|
|
the `--trusted-host` option. You can also include this option permanently
|
|
|
|
in your configuration-files or environment variables.
|
|
|
|
|
|
|
|
`easy_install`
|
|
|
|
~~~~~~~~~~~~~~
|
|
|
|
For *easy_install* it can be configured with the following setting in
|
|
|
|
`~/.pydistutils.cfg`::
|
|
|
|
|
|
|
|
[easy_install]
|
|
|
|
index_url = http://localhost:8080/simple/
|
2014-01-05 01:32:34 +01:00
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
|
2015-09-11 18:40:07 +02:00
|
|
|
Alternative Installation methods
|
2015-03-08 18:37:34 +01:00
|
|
|
================================
|
2015-09-11 18:40:07 +02:00
|
|
|
When trying the methods below, first use the following command to check whether
|
2015-03-08 18:37:34 +01:00
|
|
|
previous versions of *pypiserver* already exist, and (optionally) uninstall them::
|
|
|
|
|
|
|
|
## VERSION-CHECK: Fails if not installed.
|
|
|
|
pypi-server --version
|
2015-09-11 18:40:07 +02:00
|
|
|
|
|
|
|
## UNINSTALL: Invoke again untill it fails.
|
2015-03-08 18:37:34 +01:00
|
|
|
pip uninstall pypiserver
|
2015-09-11 18:40:07 +02:00
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
|
|
|
|
Installing the very latest version
|
|
|
|
----------------------------------
|
2015-09-11 18:40:07 +02:00
|
|
|
In case the latest version in *pypi* is a pre-release, you have to use
|
2015-03-08 18:37:34 +01:00
|
|
|
*pip*'s `--pre` option. And to update an existing installation combine it
|
|
|
|
with `--ignore-installed`::
|
|
|
|
|
|
|
|
pip install pypiserver --pre -I
|
2015-09-11 18:40:07 +02:00
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
You can even install the latest *pypiserver* directly from *github* with the
|
|
|
|
following command, assuming you have *git* installed on your `$PATH`::
|
|
|
|
|
|
|
|
pip install git+git://github.com/pypiserver/pypiserver.git
|
|
|
|
|
|
|
|
|
|
|
|
Installing it as standalone script
|
|
|
|
----------------------------------
|
2015-02-27 23:02:07 +01:00
|
|
|
The git repository contains a ``pypi-server-standalone.py`` script,
|
2015-03-08 18:37:34 +01:00
|
|
|
which is a single python file that can be executed without any other
|
2011-08-01 23:09:42 +02:00
|
|
|
dependencies.
|
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
Run the following commands to download the script with `wget`::
|
2011-08-01 23:09:42 +02:00
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
wget https://raw.github.com/pypiserver/pypiserver/standalone/pypi-server-standalone.py
|
2011-08-01 23:09:42 +02:00
|
|
|
chmod +x pypi-server-standalone.py
|
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
or with `curl`::
|
2011-08-01 23:09:42 +02:00
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
curl -O https://raw.github.com/pypiserver/pypiserver/standalone/pypi-server-standalone.py
|
2011-08-01 23:09:42 +02:00
|
|
|
chmod +x pypi-server-standalone.py
|
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
You can then start-up the server with::
|
2011-08-01 23:09:42 +02:00
|
|
|
|
|
|
|
./pypi-server-standalone.py
|
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
Feel free to rename the script and move it into your `$PATH`.
|
2011-08-01 23:09:42 +02:00
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
|
2012-10-05 00:22:58 +02:00
|
|
|
Running on heroku/dotcloud
|
2015-03-08 18:37:34 +01:00
|
|
|
--------------------------
|
2012-10-05 00:22:58 +02:00
|
|
|
https://github.com/dexterous/pypiserver-on-the-cloud contains
|
|
|
|
instructions on how to run pypiserver on one of the supported cloud
|
|
|
|
service providers.
|
2011-07-29 03:14:09 +02:00
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
|
2011-08-01 01:58:04 +02:00
|
|
|
Detailed Usage
|
|
|
|
=================================
|
2015-03-08 18:37:34 +01:00
|
|
|
Running ``pypi-server -h`` will print a detailed usage message::
|
2011-08-01 01:58:04 +02:00
|
|
|
|
2013-01-28 00:45:01 +01:00
|
|
|
pypi-server [OPTIONS] [PACKAGES_DIRECTORY...]
|
2011-08-01 01:58:04 +02:00
|
|
|
start PyPI compatible package server serving packages from
|
|
|
|
PACKAGES_DIRECTORY. If PACKAGES_DIRECTORY is not given on the
|
2011-10-07 21:09:58 +02:00
|
|
|
command line, it uses the default ~/packages. pypiserver scans this
|
|
|
|
directory recursively for packages. It skips packages and
|
2013-02-14 22:58:03 +01:00
|
|
|
directories starting with a dot. Multiple package directories can be
|
|
|
|
specified.
|
2011-08-01 01:58:04 +02:00
|
|
|
|
|
|
|
pypi-server understands the following options:
|
|
|
|
|
2015-02-23 19:46:26 +01:00
|
|
|
-p, --port PORT
|
2011-08-01 01:58:04 +02:00
|
|
|
listen on port PORT (default: 8080)
|
|
|
|
|
2015-02-23 19:46:26 +01:00
|
|
|
-i, --interface INTERFACE
|
2011-08-01 01:58:04 +02:00
|
|
|
listen on interface INTERFACE (default: 0.0.0.0, any interface)
|
|
|
|
|
2015-02-23 19:46:26 +01:00
|
|
|
-a, --authenticate (UPDATE|download|list), ...
|
|
|
|
comma-separated list of (case-insensitive) actions to authenticate
|
2015-09-17 13:52:00 +02:00
|
|
|
Use '.' or '' for empty. Requires to have set the password (-P option).
|
2015-09-11 15:10:41 +02:00
|
|
|
For example to password-protect package downloads (in addition to uploads)
|
|
|
|
while leaving listings public, give:
|
|
|
|
-P foo/htpasswd.txt -a update,download
|
|
|
|
To drop all authentications, use:
|
2015-09-17 13:52:00 +02:00
|
|
|
-P . -a .
|
2015-09-19 02:09:20 +02:00
|
|
|
Note that when uploads are not protected, the `register` command
|
2015-09-17 13:52:00 +02:00
|
|
|
is not necessary, but `~/.pypirc` still need username and password fields,
|
|
|
|
even if bogus.
|
2015-03-08 18:37:34 +01:00
|
|
|
By default, only 'update' is password-protected.
|
2015-01-09 11:08:10 +01:00
|
|
|
|
2015-02-23 19:46:26 +01:00
|
|
|
-P, --passwords PASSWORD_FILE
|
2015-09-19 02:09:20 +02:00
|
|
|
use apache htpasswd file PASSWORD_FILE to set usernames & passwords when
|
2015-09-17 13:52:00 +02:00
|
|
|
authenticating certain actions (see -a option).
|
2015-09-19 02:09:20 +02:00
|
|
|
If you want to allow un-authorized access, set this option and -a
|
|
|
|
explicitly to empty (either '.' or'').
|
2012-06-06 00:18:51 +02:00
|
|
|
|
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
|
|
|
|
2012-08-15 10:02:58 +02:00
|
|
|
--fallback-url FALLBACK_URL
|
|
|
|
for packages not found in the local index, this URL will be used to
|
|
|
|
redirect to (default: http://pypi.python.org/simple)
|
|
|
|
|
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.
|
|
|
|
|
2015-02-23 19:46:26 +01:00
|
|
|
-r, --root PACKAGES_DIRECTORY
|
2011-08-09 23:03:50 +02:00
|
|
|
[deprecated] serve packages from PACKAGES_DIRECTORY
|
|
|
|
|
2013-04-11 10:36:47 +02:00
|
|
|
-o, --overwrite
|
|
|
|
allow overwriting existing package files
|
2014-11-15 02:37:40 +01:00
|
|
|
|
2015-12-20 23:50:56 +01:00
|
|
|
--hash-algo ALGO
|
|
|
|
any `hashlib` available algo used as fragments on package links.
|
|
|
|
Set one of (0, no, off, false) to disabled it. (default: md5)
|
|
|
|
|
2014-11-14 00:36:32 +01:00
|
|
|
--welcome HTML_FILE
|
|
|
|
uses the ASCII contents of HTML_FILE as welcome message response.
|
|
|
|
|
2014-11-15 02:37:40 +01:00
|
|
|
-v
|
2015-03-16 01:25:51 +01:00
|
|
|
enable INFO logging; repeat for more verbosity.
|
2014-11-15 02:37:40 +01:00
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
--log-conf <FILE>
|
|
|
|
read logging configuration from FILE.
|
|
|
|
By default, configuration is read from `log.conf` if found in server's dir.
|
|
|
|
|
2014-11-15 02:37:40 +01:00
|
|
|
--log-file <FILE>
|
|
|
|
write logging info into this FILE.
|
|
|
|
|
|
|
|
--log-frmt <FILE>
|
|
|
|
the logging format-string. (see `logging.LogRecord` class from standard python library)
|
2015-12-21 22:57:55 +01:00
|
|
|
[Default: %(asctime)s|%(name)s|%(levelname)s|%(thread)d|%(message)s]
|
2014-11-15 02:37:40 +01:00
|
|
|
|
|
|
|
--log-req-frmt FORMAT
|
|
|
|
a format-string selecting Http-Request properties to log; set to '%s' to see them all.
|
2015-09-11 18:40:07 +02:00
|
|
|
[Default: %(bottle.request)s]
|
2014-11-15 02:37:40 +01:00
|
|
|
|
|
|
|
--log-res-frmt FORMAT
|
|
|
|
a format-string selecting Http-Response properties to log; set to '%s' to see them all.
|
|
|
|
[Default: %(status)s]
|
|
|
|
|
|
|
|
--log-err-frmt FORMAT
|
|
|
|
a format-string selecting Http-Error properties to log; set to '%s' to see them all.
|
|
|
|
[Default: %(body)s: %(exception)s \n%(traceback)s]
|
|
|
|
|
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
|
|
|
|
|
2013-02-14 22:58:03 +01:00
|
|
|
pypi-server -U [OPTIONS] [PACKAGES_DIRECTORY...]
|
2011-11-19 21:17:35 +01:00
|
|
|
update packages in PACKAGES_DIRECTORY. This command searches
|
|
|
|
pypi.python.org for updates and shows a pip command line which
|
|
|
|
updates the package.
|
|
|
|
|
|
|
|
The following additional options can be specified with -U:
|
|
|
|
|
|
|
|
-x
|
|
|
|
execute the pip commands instead of only showing them
|
|
|
|
|
|
|
|
-d DOWNLOAD_DIRECTORY
|
|
|
|
download package updates to this directory. The default is to use
|
|
|
|
the directory which contains the latest version of the package to
|
|
|
|
be updated.
|
|
|
|
|
|
|
|
-u
|
|
|
|
allow updating to unstable version (alpha, beta, rc, dev versions)
|
|
|
|
|
2015-09-16 23:54:41 +02:00
|
|
|
Visit https://github.com/pypiserver/pypiserver for more information.
|
2011-08-01 01:58:04 +02:00
|
|
|
|
2011-11-19 21:17:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
Managing the package directory
|
2015-03-08 18:37:34 +01:00
|
|
|
------------------------------
|
2015-02-27 23:02:07 +01:00
|
|
|
The `pypi-server` command has the `-U` option that searches for updates of
|
2011-11-19 21:17:35 +01:00
|
|
|
available packages. It scans the package directory for available
|
|
|
|
packages and searches on pypi.python.org for updates. Without further
|
2015-02-27 23:02:07 +01:00
|
|
|
options ``pypi-server -U`` will just print a list of commands which must
|
2011-11-19 21:17:35 +01:00
|
|
|
be run in order to get the latest version of each package. Output
|
|
|
|
looks like::
|
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
$ ./pypi-server -U
|
2012-02-23 11:24:09 +01:00
|
|
|
checking 106 packages for newer version
|
2011-11-19 21:17:35 +01:00
|
|
|
|
2012-02-23 11:24:09 +01:00
|
|
|
.........u.e...........e..u.............
|
|
|
|
.....e..............................e...
|
|
|
|
..........................
|
2011-11-19 21:17:35 +01:00
|
|
|
|
2012-02-23 11:24:09 +01:00
|
|
|
no releases found on pypi for PyXML, Pymacs, mercurial, setuptools
|
2011-11-19 21:17:35 +01:00
|
|
|
|
2012-02-23 11:24:09 +01:00
|
|
|
# update raven from 1.4.3 to 1.4.4
|
2015-02-27 13:13:54 +01:00
|
|
|
pip -q install --no-deps --extra-index-url http://pypi.python.org/simple -d /home/ralf/packages/mirror raven==1.4.4
|
2011-11-19 21:17:35 +01:00
|
|
|
|
2012-02-23 11:24:09 +01:00
|
|
|
# update greenlet from 0.3.3 to 0.3.4
|
2015-02-27 13:13:54 +01:00
|
|
|
pip -q install --no-deps --extra-index-url http://pypi.python.org/simple -d /home/ralf/packages/mirror greenlet==0.3.4
|
2011-11-19 21:17:35 +01:00
|
|
|
|
|
|
|
It first prints for each package a single character after checking the
|
2015-02-27 23:02:07 +01:00
|
|
|
available versions on pypi. A dot(`.`) means the package is up-to-date, `u`
|
|
|
|
means the package can be updated and `e` means the list of releases on
|
|
|
|
pypi is empty. After that it shows a *pip* command line which can be used
|
2011-11-19 21:17:35 +01:00
|
|
|
to update a one package. Either copy and paste that or run
|
2015-02-27 23:02:07 +01:00
|
|
|
``pypi-server -Ux`` in order to really execute those commands. You need
|
|
|
|
to have *pip* installed for that to work however.
|
2011-11-19 21:17:35 +01:00
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
Specifying an additional `-u` option will also allow alpha, beta and
|
2011-11-19 21:17:35 +01:00
|
|
|
release candidates to be downloaded. Without this option these
|
|
|
|
releases won't be considered.
|
2011-08-09 23:28:14 +02:00
|
|
|
|
2011-08-01 01:58:04 +02:00
|
|
|
|
2012-03-26 02:22:41 +02:00
|
|
|
Using a different WSGI server
|
2015-03-08 18:37:34 +01:00
|
|
|
-----------------------------
|
2015-09-11 18:40:07 +02:00
|
|
|
- *pypiserver* ships with it's own copy of bottle.
|
|
|
|
It's possible to use bottle with different WSGI servers.
|
2015-02-27 23:02:07 +01:00
|
|
|
|
|
|
|
- *pypiserver* chooses any of the
|
|
|
|
following *paste*, *cherrypy*, *twisted*, *wsgiref* (part of python) if
|
|
|
|
available.
|
2012-03-26 02:22:41 +02:00
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
- If none of the above servers matches your needs, pypiserver also
|
|
|
|
exposes an API to get the internal WSGI app, which you can then run
|
|
|
|
under any WSGI server you like. `pypiserver.app` has the following
|
|
|
|
interface::
|
|
|
|
|
|
|
|
def app(root=None,
|
2015-09-11 18:40:07 +02:00
|
|
|
redirect_to_fallback=True,
|
|
|
|
fallback_url="http://pypi.python.org/simple")
|
2015-02-27 23:02:07 +01:00
|
|
|
|
|
|
|
and returns the WSGI application. `root` is the package directory,
|
|
|
|
`redirect_to_fallback` specifies whether to redirect to `fallback_url` when
|
|
|
|
a package is missing.
|
2012-03-26 02:22:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
gunicorn
|
2015-03-08 18:37:34 +01:00
|
|
|
~~~~~~~~
|
2012-03-26 02:22:41 +02:00
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
The following command uses *gunicorn* to start *pypiserver*::
|
2012-03-26 02:22:41 +02:00
|
|
|
|
|
|
|
gunicorn -w4 'pypiserver:app("/home/ralf/packages")'
|
|
|
|
|
2013-01-28 00:45:01 +01:00
|
|
|
or when using multiple roots::
|
|
|
|
|
|
|
|
gunicorn -w4 'pypiserver:app(["/home/ralf/packages", "/home/ralf/experimental"])'
|
|
|
|
|
|
|
|
|
2012-03-26 02:22:41 +02:00
|
|
|
apache/mod_wsgi
|
2015-03-08 18:37:34 +01:00
|
|
|
~~~~~~~~~~~~~~~
|
2015-02-27 23:02:07 +01:00
|
|
|
In case you're using *apache2* with *mod_wsgi*, the following config-file
|
2012-03-26 02:22:41 +02:00
|
|
|
(contributed by Thomas Waldmann) can be used::
|
|
|
|
|
|
|
|
# An example pypiserver.wsgi for use with apache2 and mod_wsgi, edit as necessary.
|
|
|
|
#
|
|
|
|
# apache virtualhost configuration for mod_wsgi daemon mode:
|
2012-08-09 14:07:18 +02:00
|
|
|
# Alias /robots.txt /srv/yoursite/htdocs/robots.txt
|
|
|
|
# WSGIPassAuthorization On
|
|
|
|
# WSGIScriptAlias / /srv/yoursite/cfg/pypiserver.wsgi
|
|
|
|
# WSGIDaemonProcess pypisrv user=pypisrv group=pypisrv processes=1 threads=5 maximum-requests=500 umask=0007 display-name=wsgi-pypisrv inactivity-timeout=300
|
|
|
|
# WSGIProcessGroup pypisrv
|
2012-03-26 02:22:41 +02:00
|
|
|
|
|
|
|
PACKAGES = "/srv/yoursite/packages"
|
2012-08-09 14:07:18 +02:00
|
|
|
HTPASSWD = "/srv/yoursite/htpasswd"
|
2012-03-26 02:22:41 +02:00
|
|
|
import pypiserver
|
2012-08-09 14:07:18 +02:00
|
|
|
application = pypiserver.app(PACKAGES, redirect_to_fallback=True, password_file=HTPASSWD)
|
2012-03-26 02:22:41 +02:00
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
|
2012-04-08 00:29:14 +02:00
|
|
|
paste/pastedeploy
|
2015-03-08 18:37:34 +01:00
|
|
|
~~~~~~~~~~~~~~~~~
|
2015-02-27 23:02:07 +01:00
|
|
|
*paste* allows to run multiple WSGI applications under different URL
|
2013-01-07 13:58:47 +01:00
|
|
|
paths. Therefore it's possible to serve different set of packages on
|
2012-04-08 00:29:14 +02:00
|
|
|
different paths.
|
|
|
|
|
|
|
|
The following example `paste.ini` could be used to serve stable and
|
|
|
|
unstable packages on different paths::
|
|
|
|
|
|
|
|
[composite:main]
|
|
|
|
use = egg:Paste#urlmap
|
|
|
|
/unstable/ = unstable
|
|
|
|
/ = stable
|
|
|
|
|
|
|
|
[app:stable]
|
|
|
|
use = egg:pypiserver#main
|
2013-01-28 00:45:01 +01:00
|
|
|
root = ~/stable-packages
|
2012-04-08 00:29:14 +02:00
|
|
|
|
|
|
|
[app:unstable]
|
|
|
|
use = egg:pypiserver#main
|
2013-01-28 00:45:01 +01:00
|
|
|
root = ~/stable-packages
|
2015-09-11 18:40:07 +02:00
|
|
|
~/unstable-packages
|
2012-04-08 00:29:14 +02:00
|
|
|
|
|
|
|
[server:main]
|
|
|
|
use = egg:gunicorn#main
|
|
|
|
host = 0.0.0.0
|
|
|
|
port = 9000
|
|
|
|
workers = 5
|
|
|
|
accesslog = -
|
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
.. Note::
|
2012-04-08 00:29:14 +02:00
|
|
|
You need to install some more dependencies for this to work,
|
|
|
|
e.g. run::
|
|
|
|
|
|
|
|
pip install paste pastedeploy gunicorn pypiserver
|
|
|
|
|
|
|
|
The server can then be started with::
|
|
|
|
|
|
|
|
gunicorn_paster paste.ini
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
Sources
|
|
|
|
=======
|
2011-08-01 23:09:42 +02:00
|
|
|
Use::
|
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
git clone https://github.com/pypiserver/pypiserver.git
|
2011-08-01 23:09:42 +02:00
|
|
|
|
|
|
|
to create a copy of the repository, then::
|
|
|
|
|
|
|
|
git pull
|
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
inside the copy to receive any later changes.
|
|
|
|
|
2011-08-01 23:09:42 +02:00
|
|
|
|
2011-07-29 03:14:09 +02:00
|
|
|
|
|
|
|
Bugs
|
2015-02-27 23:02:07 +01:00
|
|
|
====
|
|
|
|
*pypiserver* does not implement the full API as seen on PyPI_. It
|
2015-03-08 18:37:34 +01:00
|
|
|
implements just enough to make ``easy_install`` and ``pip install`` to work.
|
2011-07-31 23:42:37 +02:00
|
|
|
|
|
|
|
The following limitations are known:
|
|
|
|
|
2015-09-12 19:20:53 +02:00
|
|
|
- It doesn't implement the XMLRPC json API interface: pip search
|
2011-07-31 23:42:37 +02:00
|
|
|
will not work.
|
2015-12-21 11:49:14 +01:00
|
|
|
- Command ``pypi -U`` that compares uploaded packages with *pypi* to see if
|
2015-09-12 19:20:53 +02:00
|
|
|
they are outdated does not respect a http-proxy environment variable
|
|
|
|
(see https://github.com/pypiserver/pypiserver/issues/19).
|
2015-02-27 23:02:07 +01:00
|
|
|
- It accepts documentation uploads but does not save them to
|
|
|
|
disk (see https://github.com/pypiserver/pypiserver/issues/47 for a
|
2014-03-05 22:53:09 +01:00
|
|
|
discussion)
|
2015-02-27 23:02:07 +01:00
|
|
|
- It does not handle misspelled packages as pypi-repo does,
|
|
|
|
therefore it is suggested to use it with `--extra-index-url` instead
|
2015-09-12 19:20:53 +02:00
|
|
|
of `--index-url` (see https://github.com/pypiserver/pypiserver/issues/38)
|
2015-09-11 18:40:07 +02:00
|
|
|
|
|
|
|
Please use github's `bugtracker <https://github.com/pypiserver/pypiserver/issues>`_
|
2015-02-27 23:02:07 +01:00
|
|
|
if you find any other bugs.
|
2011-08-01 23:09:42 +02:00
|
|
|
|
|
|
|
|
2011-07-31 23:42:37 +02:00
|
|
|
|
|
|
|
Similar Projects
|
2015-02-27 23:02:07 +01:00
|
|
|
================
|
2011-07-31 23:42:37 +02:00
|
|
|
There are lots of other projects, which allow you to run your own
|
2015-02-27 23:02:07 +01:00
|
|
|
PyPI server. If *pypiserver* doesn't work for you, the following are
|
|
|
|
among the most popular alternatives:
|
2011-07-31 23:42:37 +02:00
|
|
|
|
2015-03-08 17:38:35 +01:00
|
|
|
- `devpi-server <https://pypi.python.org/pypi/devpi-server>`_:
|
2015-09-11 18:40:07 +02:00
|
|
|
a reliable fast pypi.python.org caching server, part of
|
|
|
|
the comprehensive `github-style pypi index server and packaging meta tool
|
2015-03-08 17:38:35 +01:00
|
|
|
<https://pypi.python.org/pypi/devpi>`_.
|
|
|
|
(version: 2.1.4, access date: 8/3/2015)
|
|
|
|
|
2015-09-11 18:40:07 +02:00
|
|
|
- `pip2pi <https://github.com/wolever/pip2pi>`_
|
2015-03-08 17:38:35 +01:00
|
|
|
a simple cmd-line tool that builds a PyPI-compatible local folder from pip requirements
|
|
|
|
(version: 0.6.7, access date: 8/3/2015)
|
2011-08-09 23:47:34 +02:00
|
|
|
|
2015-03-08 18:37:34 +01:00
|
|
|
- Check this SO question: ` How to roll my own pypi <http://stackoverflow.com/questions/1235331/how-to-roll-my-own-pypi>`_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
License
|
|
|
|
=======
|
|
|
|
*pypiserver* contains a copy of bottle_ which is available under the
|
|
|
|
*MIT* license, and the remaining part is distributed under the *zlib/libpng* license.
|
|
|
|
See the `LICENSE.txt` file.
|
|
|
|
|
2013-05-29 00:15:35 +02:00
|
|
|
|
2015-02-27 23:02:07 +01:00
|
|
|
|
2011-07-31 23:42:37 +02:00
|
|
|
.. _bottle: http://bottlepy.org
|
|
|
|
.. _PyPI: http://pypi.python.org
|
2015-09-11 18:40:07 +02:00
|
|
|
.. |travis-status| image:: https://travis-ci.org/pypiserver/pypiserver.svg
|
|
|
|
:alt: Travis build status
|
2015-03-08 23:21:35 +01:00
|
|
|
:scale: 100%
|
2015-09-11 18:40:07 +02:00
|
|
|
:target: https://travis-ci.org/pypiserver/pypiserver
|
2015-03-08 23:21:35 +01:00
|
|
|
|
2015-09-11 18:40:07 +02:00
|
|
|
.. |pypi-ver| image:: https://img.shields.io/pypi/v/pypiserver.svg
|
2015-03-08 23:21:35 +01:00
|
|
|
:target: https://pypi.python.org/pypi/pypiserver/
|
|
|
|
:alt: Latest Version in PyPI
|
|
|
|
|
2015-09-11 18:40:07 +02:00
|
|
|
.. |python-ver| image:: https://img.shields.io/pypi/pyversions/pypiserver.svg
|
2015-03-08 23:21:35 +01:00
|
|
|
:target: https://pypi.python.org/pypi/pypiserver/
|
2015-09-11 18:40:07 +02:00
|
|
|
:alt: Supported Python versions
|
2015-03-08 23:21:35 +01:00
|
|
|
|
2015-09-11 18:40:07 +02:00
|
|
|
.. |downloads-count| image:: https://img.shields.io/pypi/dm/pypiserver.svg?period=week
|
2015-03-08 23:21:35 +01:00
|
|
|
:target: https://pypi.python.org/pypi/pypiserver/
|
|
|
|
:alt: Downloads
|
|
|
|
|
2015-09-21 04:38:47 +02:00
|
|
|
.. |proj-license| image:: https://img.shields.io/badge/license-BSD%2Bzlib%2Flibpng-blue.svg
|
2015-09-11 18:40:07 +02:00
|
|
|
:target: https://raw.githubusercontent.com/pypiserver/pypiserver/master/LICENSE.txt
|
|
|
|
:alt: Project License
|
|
|
|
|
|
|
|
.. |dependencies| image:: https://img.shields.io/requires/github/pypiserver/pypiserver.svg
|
|
|
|
:alt: Dependencies up-to-date?
|