1
0
mirror of https://github.com/pypiserver/pypiserver synced 2024-11-09 16:45:51 +01:00

docs: Update github-links, suitable python-versions, changes and

rel-date.

- Update maintainers.
- Update python-classifiers.
- Various README edits.
- #38: Update suggestion on welcome-file.
- Add ankostis to authors (so Ralf may avoid half harassment for
this release).
This commit is contained in:
ankostis on tokoti 2015-02-27 23:02:07 +01:00 committed by Kostis Anagnostopoulos, Yoga-2
parent 1450b625bb
commit d50cdb6c3b
5 changed files with 133 additions and 99 deletions

2
.gitmodules vendored

@ -1,3 +1,3 @@
[submodule "vendor"] [submodule "vendor"]
path = vendor path = vendor
url = https://github.com/schmir/pypiserver-vendor.git url = https://github.com/pypiserver/pypiserver-vendor.git

@ -5,55 +5,67 @@ pypiserver - minimal PyPI server for use with pip/easy_install
============================================================================== ==============================================================================
:Authors: Ralf Schmitt <ralf@systemexit.de> :Authors: Ralf Schmitt <ralf@systemexit.de>, Kostis Anagnostopoulos <ankostis@gmail.com>
:Version: 1.1.6 :Version: 1.1.7
:Date: 2014-03-05 :Date: 2015-02-28
:Download: https://pypi.python.org/pypi/pypiserver#downloads :Source: https://github.com/pypiserver/pypiserver
:Code: https://github.com/schmir/pypiserver :Download: https://pypi.python.org/pypi/pypiserver#downloads
.. contents:: Table of Contents .. contents:: Table of Contents
:backlinks: top :backlinks: top
pypiserver is a minimal PyPI compatible server. It can be used to *pypiserver* is a minimal PyPI_ compatible server. It can be used to
serve a set of packages and eggs to easy_install or pip. upload and serve a set of packages, wheels and eggs to *pip* or
*easy_install*.
Installation and Usage/Quickstart Installation and Usage/Quickstart
================================= =================================
pypiserver will work with python 2.5, 2.6, 2.7, 3.2 and 3.3. python *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 with 3.0 and 3.1 may also work, but pypiserver is not being tested with
these versions. these versions.
Run the following commands to get your PyPI server up and running:: Run the following commands to get your PyPI server up and running::
## Installation.
pip install pypiserver pip install pypiserver
mkdir ~/packages mkdir ~/packages ## Copy packages/wheels/eggs to this directory.
# copy some source packages or eggs to this directory
pypi-server -p 8080 ~/packages ## Start server.
pypi-server -p 8080 ~/packages &
## Install hosted packages.
pip install --extra-index-url http://localhost:8080/simple/ ... pip install --extra-index-url http://localhost:8080/simple/ ...
.. NOTE::
You can even install the latest *pypiserver* directly from github with this command,
assuming you have *git* installed on your `PATH`::
pip install git+git://github.com/pypiserver/pypiserver.git
.. Note::
The above commands do work on an unix like operating system with a The above commands do work on an unix like operating system with a
posix shell. If you're using windows, you'll have to run their posix shell. If you're using windows, you'll have to run their
'windows counterparts'. The same is true for the rest of this 'windows counterparts'. The same is true for the rest of this
documentation. documentation.
Alternative Installation as standalone script Alternative Installation as standalone script
============================================= =============================================
The git repository contains a 'pypi-server-standalone.py' script, The git repository contains a ``pypi-server-standalone.py`` script,
which is a single python file ready to be executed without any other which is a single python file ready to be executed without any other
dependencies. dependencies.
Run the following commands to download the script with wget:: Run the following commands to download the script with `wget`::
wget https://raw.github.com/schmir/pypiserver/standalone/pypi-server-standalone.py wget https://raw.github.com/pypiserver/pypiserver/standalone/pypi-server-standalone.py
chmod +x pypi-server-standalone.py chmod +x pypi-server-standalone.py
or with curl:: or with `curl`::
curl -O https://raw.github.com/schmir/pypiserver/standalone/pypi-server-standalone.py curl -O https://raw.github.com/pypiserver/pypiserver/standalone/pypi-server-standalone.py
chmod +x pypi-server-standalone.py chmod +x pypi-server-standalone.py
The server can then be started with:: The server can then be started with::
@ -62,12 +74,14 @@ The server can then be started with::
Feel free to rename the script and move it into your $PATH. Feel free to rename the script and move it into your $PATH.
Running on heroku/dotcloud Running on heroku/dotcloud
================================= =================================
https://github.com/dexterous/pypiserver-on-the-cloud contains https://github.com/dexterous/pypiserver-on-the-cloud contains
instructions on how to run pypiserver on one of the supported cloud instructions on how to run pypiserver on one of the supported cloud
service providers. service providers.
Detailed Usage Detailed Usage
================================= =================================
pypi-server -h will print a detailed usage message:: pypi-server -h will print a detailed usage message::
@ -125,6 +139,10 @@ pypi-server -h will print a detailed usage message::
-v -v
enable INFO logging; repeate for more verbosity. enable INFO logging; repeate for more verbosity.
--log-conf <FILE>
read logging configuration from FILE.
By default, configuration is read from `log.conf` if found in server's dir.
--log-file <FILE> --log-file <FILE>
write logging info into this FILE. write logging info into this FILE.
@ -180,10 +198,10 @@ 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 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. good idea to configure them to always use your local pypi index.
pip `pip`
----- -----
For *pip* this can be done by setting the environment variable For *pip* this can be done by setting the environment variable
PIP_EXTRA_INDEX_URL in your .bashrc/.profile/.zshrc:: `PIP_EXTRA_INDEX_URL` in your `.bashrc`/`.profile`/`.zshrc`::
export PIP_EXTRA_INDEX_URL=http://localhost:8080/simple/ export PIP_EXTRA_INDEX_URL=http://localhost:8080/simple/
@ -198,32 +216,32 @@ or by adding the following lines to ~/.pip/pip.conf::
the '--trusted-host` option. You can include this option permanently the '--trusted-host` option. You can include this option permanently
in your configuration-files or environment variables. in your configuration-files or environment variables.
easy_install `easy_install`
------------ --------------
For easy_install it can be configured with the following setting in For *easy_install* it can be configured with the following setting in
~/.pydistutils.cfg:: `~/.pydistutils.cfg`::
[easy_install] [easy_install]
index_url = http://localhost:8080/simple/ index_url = http://localhost:8080/simple/
Uploads via setup.py upload Uploads via `setup.py` upload
=========================== =============================
Uploading packages via `python setup.py upload` is also Uploading packages via ``python setup.py upload`` is also
possible. First make sure you have the passlib module installed:: possible. First make sure you have the *passlib* module installed::
pip install passlib pip install passlib
Then create a apache htpassword file with:: Then create a apache *htpassword* file with::
htpasswd -sc .htaccess myusername htpasswd -sc .htaccess myusername
You'll be prompted for a password. You'll need to restart the server You'll be prompted for a password. You'll need to restart the server
with the -P option:: with the `-P` option::
pypi-server -p 8080 -P /path/to/.htaccess /path/to/private_pypi_folder/ pypi-server -p 8080 -P /path/to/.htaccess /path/to/private_pypi_folder/
Edit or create a ~/.pypirc file with the following content:: Edit or create a `~/.pypirc` file with the following content::
[distutils] [distutils]
index-servers = index-servers =
@ -246,13 +264,14 @@ Uploading then works by running::
Managing the package directory Managing the package directory
============================== ==============================
pypi-server's -U option makes it possible to search for updates of The `pypi-server` command has the `-U` option that searches for updates of
available packages. It scans the package directory for available available packages. It scans the package directory for available
packages and searches on pypi.python.org for updates. Without further packages and searches on pypi.python.org for updates. Without further
options 'pypi-server -U' will just print a list of commands which must options ``pypi-server -U`` will just print a list of commands which must
be run in order to get the latest version of each package. Output be run in order to get the latest version of each package. Output
looks like:: looks like::
$ ./pypi-server -U
checking 106 packages for newer version checking 106 packages for newer version
.........u.e...........e..u............. .........u.e...........e..u.............
@ -268,50 +287,54 @@ looks like::
pip -q install --no-deps --extra-index-url http://pypi.python.org/simple -d /home/ralf/packages/mirror greenlet==0.3.4 pip -q install --no-deps --extra-index-url http://pypi.python.org/simple -d /home/ralf/packages/mirror greenlet==0.3.4
It first prints for each package a single character after checking the It first prints for each package a single character after checking the
available versions on pypi. A dot means the package is up-to-date, 'u' 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 means the package can be updated and `e` means the list of releases on
pypi is empty. After that it show a pip command line which can be used pypi is empty. After that it shows a *pip* command line which can be used
to update a one package. Either copy and paste that or run to update a one package. Either copy and paste that or run
"pypi-server -Ux" in order to really execute those commands. You need ``pypi-server -Ux`` in order to really execute those commands. You need
to have pip installed for that to work however. to have *pip* installed for that to work however.
Specifying an additional '-u' option will also allow alpha, beta and Specifying an additional `-u` option will also allow alpha, beta and
release candidates to be downloaded. Without this option these release candidates to be downloaded. Without this option these
releases won't be considered. releases won't be considered.
Optional dependencies Optional dependencies
===================== =====================
- pypiserver ships with it's own copy of bottle. It's possible to use *pypiserver* relies on the *passlib* module for parsing apache htpasswd
bottle with different WSGI servers. pypiserver chooses any of the files. You need to install it, when using the `-P`, `--passwords`
following paste, cherrypy, twisted, wsgiref (part of python) if option. The following command will do that::
available.
- pypiserver relies on the passlib module for parsing apache htpasswd
files. You need to install it, when using the -P, --passwords
option. The following command will do that::
pip install passlib pip install passlib
Using a different WSGI server Using a different WSGI server
============================= =============================
If none of the above servers matches your needs, pypiserver also - *pypiserver* ships with it's own copy of bottle.
exposes an API to get the internal WSGI app, which you can then run It's possible to use bottle with different WSGI servers.
under any WSGI server you like. pypiserver.app has the following
interface::
def app(root=None, - *pypiserver* chooses any of the
redirect_to_fallback=True, following *paste*, *cherrypy*, *twisted*, *wsgiref* (part of python) if
fallback_url="http://pypi.python.org/simple") available.
- 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,
redirect_to_fallback=True,
fallback_url="http://pypi.python.org/simple")
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.
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.
gunicorn gunicorn
---------------- --------
The following command uses gunicorn to start pypiserver:: The following command uses *gunicorn* to start *pypiserver*::
gunicorn -w4 'pypiserver:app("/home/ralf/packages")' gunicorn -w4 'pypiserver:app("/home/ralf/packages")'
@ -321,8 +344,8 @@ or when using multiple roots::
apache/mod_wsgi apache/mod_wsgi
---------------- ---------------
In case you're using apache 2 with mod_wsgi, the following config file In case you're using *apache2* with *mod_wsgi*, the following config-file
(contributed by Thomas Waldmann) can be used:: (contributed by Thomas Waldmann) can be used::
# An example pypiserver.wsgi for use with apache2 and mod_wsgi, edit as necessary. # An example pypiserver.wsgi for use with apache2 and mod_wsgi, edit as necessary.
@ -339,9 +362,10 @@ In case you're using apache 2 with mod_wsgi, the following config file
import pypiserver import pypiserver
application = pypiserver.app(PACKAGES, redirect_to_fallback=True, password_file=HTPASSWD) application = pypiserver.app(PACKAGES, redirect_to_fallback=True, password_file=HTPASSWD)
paste/pastedeploy paste/pastedeploy
---------------------- -----------------
paste allows to run multiple WSGI applications under different URL *paste* allows to run multiple WSGI applications under different URL
paths. Therefore it's possible to serve different set of packages on paths. Therefore it's possible to serve different set of packages on
different paths. different paths.
@ -369,8 +393,7 @@ unstable packages on different paths::
workers = 5 workers = 5
accesslog = - accesslog = -
.. NOTE:: .. Note::
You need to install some more dependencies for this to work, You need to install some more dependencies for this to work,
e.g. run:: e.g. run::
@ -382,17 +405,17 @@ unstable packages on different paths::
Source Sources
=========== =======
Source releases can be downloaded from Source releases can be downloaded from
https://pypi.python.org/pypi/pypiserver https://pypi.python.org/pypi/pypiserver
https://github.com/schmir/pypiserver carries a git repository of the https://github.com/pypiserver/pypiserver carries a git repository of the
in-development version. in-development version.
Use:: Use::
git clone https://github.com/schmir/pypiserver.git git clone https://github.com/pypiserver/pypiserver.git
to create a copy of the repository, then:: to create a copy of the repository, then::
@ -402,28 +425,30 @@ inside the copy to receive the latest version.
Bugs Bugs
============= ====
pypiserver does not implement the full API as seen on PyPI_. It *pypiserver* does not implement the full API as seen on PyPI_. It
implements just enough to make easy_install and pip install work. implements just enough to make *easy_install* and *pip* install work.
The following limitations are known: The following limitations are known:
- pypiserver doesn't implement the XMLRPC interface: pip search - It doesn't implement the XMLRPC interface: pip search
will not work. will not work.
- pypiserver doesn't implement the json based '/pypi' interface. - It doesn't implement the json based '/pypi' interface.
- pypiserver accepts documentation uploads but does not save them to - It accepts documentation uploads but does not save them to
disk (see https://github.com/schmir/pypiserver/issues/47 for a disk (see https://github.com/pypiserver/pypiserver/issues/47 for a
discussion) discussion)
- It does not handle misspelled packages as pypi-repo does,
Please use github's bugtracker therefore it is suggested to use it with `--extra-index-url` instead
https://github.com/schmir/pypiserver/issues if you find any other of `--index-url` (see discussion at https://github.com/pypiserver/pypiserver/issues/38)
bugs.
Please use github's `bugtracker <https://github.com/pypiserver/pypiserver/issues>`_
if you find any other bugs.
License License
============= =======
pypiserver contains a copy of bottle_ which is available under the *pypiserver* contains a copy of bottle_ which is available under the
MIT license:: *MIT* license::
Copyright (c) 2012, Marcel Hellkamp. Copyright (c) 2012, Marcel Hellkamp.
@ -446,7 +471,7 @@ MIT license::
SOFTWARE. SOFTWARE.
The remaining part is distributed under the zlib/libpng license:: The remaining part is distributed under the *zlib/libpng* license::
Copyright (c) 2011-2014 Ralf Schmitt Copyright (c) 2011-2014 Ralf Schmitt
@ -471,22 +496,25 @@ The remaining part is distributed under the zlib/libpng license::
Similar Projects Similar Projects
==================== ================
There are lots of other projects, which allow you to run your own 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 PyPI server. If *pypiserver* doesn't work for you, the following are
following alternatives: among the most popular alternatives:
devpi-server (https://pypi.python.org/pypi/devpi-server) *devpi-server* (https://pypi.python.org/pypi/devpi-server)
easy-to-use caching proxy server easy-to-use caching proxy server
proxypypi (https://pypi.python.org/pypi/proxypypi) *proxypypi* (https://pypi.python.org/pypi/proxypypi)
a PyPI caching proxy a PyPI caching proxy
Changelog Changelog
========= =========
1.1.7 (2015-02-23) 1.1.7 (2015-02-28)
------------------ ------------------
1st release under cooperative ownership:
- #65, #66: Improve Auth for private repos by supporting i - #65, #66: Improve Auth for private repos by supporting i
password protected package listings and downloads, password protected package listings and downloads,
in addition to uploads (use the -a, --authenticate option in addition to uploads (use the -a, --authenticate option
@ -496,7 +524,9 @@ Changelog
- #58, #62: Log all http-requests. - #58, #62: Log all http-requests.
- #61: Possible to change welcome-msg. - #61: Possible to change welcome-msg.
- #77, #78: Avoid XSS by generating web-content with SimpleTemplate - #77, #78: Avoid XSS by generating web-content with SimpleTemplate
instead of python's string-substs. instead of python's string-substs.
- #38: Instruct to use --extra-index-url for misspelled dependencies to work.
1.1.6 (2014-03-05) 1.1.6 (2014-03-05)
------------------ ------------------
@ -515,7 +545,7 @@ Changelog
1.1.4 (2014-01-03) 1.1.4 (2014-01-03)
------------------ ------------------
- make pypiserver compatible with pip 1.5 - make pypiserver compatible with pip 1.5
(https://github.com/schmir/pypiserver/pull/42) (https://github.com/pypiserver/pypiserver/pull/42)
1.1.3 (2013-07-22) 1.1.3 (2013-07-22)
------------------ ------------------
@ -550,9 +580,9 @@ Changelog
------------------ ------------------
- make 'pypi-server -Ux' work on windows - make 'pypi-server -Ux' work on windows
('module' object has no attribute 'spawnlp', ('module' object has no attribute 'spawnlp',
https://github.com/schmir/pypiserver/issues/26) https://github.com/pypiserver/pypiserver/issues/26)
- use absolute paths in hrefs for root view - use absolute paths in hrefs for root view
(https://github.com/schmir/pypiserver/issues/25) (https://github.com/pypiserver/pypiserver/issues/25)
- add description of uploads to the documentation - add description of uploads to the documentation
- make the test suite work on python 3 - make the test suite work on python 3
- make pypi-server-standalone work with python 2.5 - make pypi-server-standalone work with python 2.5

@ -4,7 +4,7 @@
<p> To use this server with pip, run the the following command: <p> To use this server with pip, run the the following command:
<blockquote><pre> <blockquote><pre>
pip install -i {{URL}}simple/ PACKAGE [PACKAGE2...] pip install --extra-index-url {{URL}}simple/ PACKAGE [PACKAGE2...]
</pre></blockquote></p> </pre></blockquote></p>
<p> To use this server with easy_install, run the the following command: <p> To use this server with easy_install, run the the following command:

@ -33,9 +33,9 @@ setup(name="pypiserver",
version=get_version(), version=get_version(),
packages=["pypiserver"], packages=["pypiserver"],
package_data={'pypiserver': ['welcome.html']}, package_data={'pypiserver': ['welcome.html']},
url="https://github.com/schmir/pypiserver", url="https://github.com/pypiserver/pypiserver",
maintainer="Ralf Schmitt", maintainer="Ralf Schmitt, Kostis Anagnostopoulos",
maintainer_email="ralf@systemexit.de", maintainer_email="ralf@systemexit.de, ankostis@gmail.com",
classifiers=[ classifiers=[
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",
"Environment :: Web Environment", "Environment :: Web Environment",
@ -43,6 +43,10 @@ setup(name="pypiserver",
"Intended Audience :: System Administrators", "Intended Audience :: System Administrators",
"License :: OSI Approved :: BSD License", "License :: OSI Approved :: BSD License",
"License :: OSI Approved :: zlib/libpng License", "License :: OSI Approved :: zlib/libpng License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2", "Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.6",

@ -236,7 +236,7 @@ def test_nonroot_simple_packages(root, testpriv):
def test_root_no_relative_paths(testpriv): def test_root_no_relative_paths(testpriv):
"""https://github.com/schmir/pypiserver/issues/25""" """https://github.com/pypiserver/pypiserver/issues/25"""
resp = testpriv.get("/priv/") resp = testpriv.get("/priv/")
hrefs = [x["href"] for x in resp.html("a")] hrefs = [x["href"] for x in resp.html("a")]
assert hrefs == ['/priv/packages/', '/priv/simple/', 'http://pypi.python.org/pypi/pypiserver'] assert hrefs == ['/priv/packages/', '/priv/simple/', 'http://pypi.python.org/pypi/pypiserver']