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

Simplify dependencies in standalone.

+ Submodules repor in github is not used anymore.
This commit is contained in:
ankostis on tokoti 2015-09-17 01:39:13 +02:00
parent 133afe28f7
commit 8303a99806
4 changed files with 101 additions and 93 deletions

3
.gitmodules vendored

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

@ -73,7 +73,12 @@ Currently only password-protected uploads are supported!
.. Tip:: .. Tip::
Read this SO question for running `htpasswd` cmd under *Windows*: Read this SO question for running `htpasswd` cmd under *Windows*:
http://serverfault.com/questions/152950/how-to-create-and-edit-htaccess-and-htpasswd-locally-on-my-computer-and-then-u 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/
It is also possible to disable authentication even for uploads. It is also possible to disable authentication even for uploads.
Read the help for ``-P`` and ``-a`` options to see how it is done. Read the help for ``-P`` and ``-a`` options to see how it is done.
@ -231,8 +236,8 @@ Running ``pypi-server -h`` will print a detailed usage message::
use apache htpasswd file PASSWORD_FILE to set usernames & passwords use apache htpasswd file PASSWORD_FILE to set usernames & passwords
used for authentication of certain actions (see -a option). used for authentication of certain actions (see -a option).
Set it explicitly to '.' to allow empty list of actions to authenticate; Set it explicitly to '.' to allow empty list of actions to authenticate;
then no `register` command is neccessary, but `~/.pypirc` still needs then no `register` command is neccessary
`username` and `password` fields, even if bogus. (but `~/.pypirc` still need username and password fields, even if bogus).
--disable-fallback --disable-fallback
disable redirect to real PyPI index for packages not found in the disable redirect to real PyPI index for packages not found in the

@ -13,14 +13,18 @@ wheel="./dist/pypiserver-*.whl"
## Modify `wheel` archive with `__main__.py` at root, ## Modify `wheel` archive with `__main__.py` at root,
# prepend it with a python-flashbang, and # add dependencies, and
# add header-comments >= 10-lines so that # prepend it with a python-flashbang + some header-comments >= 10-lines
# ``head pypiserver*.py`` behaves politely. # so that ``head pypiserver*.py``behaves politely.
# #
gitversion=$(git describe --tags) 1.6.5-py2.py3-none-any.whl
unzip -jo $wheel pypiserver/__main__.py -d ./dist unzip -jo $wheel pypiserver/__main__.py -d ./dist
zip -d $wheel pypiserver/__main__.py zip -d $wheel pypiserver/__main__.py
zip -mj $wheel ./dist/__main__.py zip -mj $wheel ./dist/__main__.py
wget https://pypi.python.org/packages/2.7/p/passlib/passlib-1.6.5-py2.py3-none-any.whl#md5=03de8f28697eaa67835758a60386c9fa \
-O dist/passlib-1.6.5-py2.py3-none-any.whl
zip -mj $wheel ./dist/passlib-*.whl
gitversion=$(git describe --tags)
cat - $wheel > "$exec_zip" << EOF cat - $wheel > "$exec_zip" << EOF
#!/usr/bin/env python #!/usr/bin/env python
## ##

@ -6,6 +6,7 @@ import getopt
import re import re
import logging import logging
from pypiserver import __version__ from pypiserver import __version__
from textwrap import dedent
DEFAULT_SERVER = "auto" DEFAULT_SERVER = "auto"
@ -21,116 +22,117 @@ def init_logging(level=None, frmt=None, filename=None):
def usage(): def usage():
return """pypi-server [OPTIONS] [PACKAGES_DIRECTORY...] return dedent("""\
start PyPI compatible package server serving packages from pypi-server [OPTIONS] [PACKAGES_DIRECTORY...]
PACKAGES_DIRECTORY. If PACKAGES_DIRECTORY is not given on the start PyPI compatible package server serving packages from
command line, it uses the default ~/packages. pypiserver scans this PACKAGES_DIRECTORY. If PACKAGES_DIRECTORY is not given on the
directory recursively for packages. It skips packages and command line, it uses the default ~/packages. pypiserver scans this
directories starting with a dot. Multiple package directories can be directory recursively for packages. It skips packages and
specified. directories starting with a dot. Multiple package directories can be
specified.
pypi-server understands the following options: pypi-server understands the following options:
-p, --port PORT -p, --port PORT
listen on port PORT (default: 8080) listen on port PORT (default: 8080)
-i, --interface INTERFACE -i, --interface INTERFACE
listen on interface INTERFACE (default: 0.0.0.0, any interface) listen on interface INTERFACE (default: 0.0.0.0, any interface)
-a, --authenticate (UPDATE|download|list), ... -a, --authenticate (UPDATE|download|list), ...
comma-separated list of (case-insensitive) actions to authenticate comma-separated list of (case-insensitive) actions to authenticate
Requires -P option and cannot not be empty unless -P is '.' Requires -P option and cannot not be empty unless -P is '.'
For example to password-protect package downloads (in addition to uploads) For example to password-protect package downloads (in addition to uploads)
while leaving listings public, give: while leaving listings public, give:
-P foo/htpasswd.txt -a update,download -P foo/htpasswd.txt -a update,download
To drop all authentications, use: To drop all authentications, use:
-P . -a '' -P . -a ''
By default, only 'update' is password-protected. By default, only 'update' is password-protected.
-P, --passwords PASSWORD_FILE -P, --passwords PASSWORD_FILE
use apache htpasswd file PASSWORD_FILE to set usernames & passwords use apache htpasswd file PASSWORD_FILE to set usernames & passwords
used for authentication of certain actions (see -a option). used for authentication of certain actions (see -a option).
Set it explicitly to '.' to allow empty list of actions to authenticate; Set it explicitly to '.' to allow empty list of actions to authenticate;
then no `register` command is neccessary, but `~/.pypirc` still needs then no `register` command is neccessary
`username` and `password` fields, even if bogus. (but `~/.pypirc` still need username and password fields, even if bogus).
--disable-fallback --disable-fallback
disable redirect to real PyPI index for packages not found in the disable redirect to real PyPI index for packages not found in the
local index local index
--fallback-url FALLBACK_URL --fallback-url FALLBACK_URL
for packages not found in the local index, this URL will be used to for packages not found in the local index, this URL will be used to
redirect to (default: http://pypi.python.org/simple) redirect to (default: http://pypi.python.org/simple)
--server METHOD --server METHOD
use METHOD to run the server. Valid values include paste, use METHOD to run the server. Valid values include paste,
cherrypy, twisted, gunicorn, gevent, wsgiref, auto. The cherrypy, twisted, gunicorn, gevent, wsgiref, auto. The
default is to use "auto" which chooses one of paste, cherrypy, default is to use "auto" which chooses one of paste, cherrypy,
twisted or wsgiref. twisted or wsgiref.
-r, --root PACKAGES_DIRECTORY -r, --root PACKAGES_DIRECTORY
[deprecated] serve packages from PACKAGES_DIRECTORY [deprecated] serve packages from PACKAGES_DIRECTORY
-o, --overwrite -o, --overwrite
allow overwriting existing package files allow overwriting existing package files
--welcome HTML_FILE --welcome HTML_FILE
uses the ASCII contents of HTML_FILE as welcome message response. uses the ASCII contents of HTML_FILE as welcome message response.
-v -v
enable verbose logging; repeat for more verbosity. enable verbose logging; repeat for more verbosity.
--log-file <FILE> --log-file <FILE>
write logging info into this FILE. write logging info into this FILE.
--log-frmt <FILE> --log-frmt <FILE>
the logging format-string. (see `logging.LogRecord` class from standard python library) the logging format-string. (see `logging.LogRecord` class from standard python library)
[Default: %(asctime)s|%(levelname)s|%(thread)d|%(message)s] [Default: %(asctime)s|%(levelname)s|%(thread)d|%(message)s]
--log-req-frmt FORMAT --log-req-frmt FORMAT
a format-string selecting Http-Request properties to log; set to '%s' to see them all. a format-string selecting Http-Request properties to log; set to '%s' to see them all.
[Default: %(bottle.request)s] [Default: %(bottle.request)s]
--log-res-frmt FORMAT --log-res-frmt FORMAT
a format-string selecting Http-Response properties to log; set to '%s' to see them all. a format-string selecting Http-Response properties to log; set to '%s' to see them all.
[Default: %(status)s] [Default: %(status)s]
--log-err-frmt FORMAT --log-err-frmt FORMAT
a format-string selecting Http-Error properties to log; set to '%s' to see them all. a format-string selecting Http-Error properties to log; set to '%s' to see them all.
[Default: %(body)s: %(exception)s \n%(traceback)s] [Default: %(body)s: %(exception)s \n%(traceback)s]
--cache-control AGE --cache-control AGE
Add "Cache-Control: max-age=AGE, public" header to package downloads. Add "Cache-Control: max-age=AGE, public" header to package downloads.
Pip 6+ needs this for caching. Pip 6+ needs this for caching.
pypi-server -h pypi-server -h
pypi-server --help pypi-server --help
show this help message show this help message
pypi-server --version pypi-server --version
show pypi-server's version show pypi-server's version
pypi-server -U [OPTIONS] [PACKAGES_DIRECTORY...] pypi-server -U [OPTIONS] [PACKAGES_DIRECTORY...]
update packages in PACKAGES_DIRECTORY. This command searches update packages in PACKAGES_DIRECTORY. This command searches
pypi.python.org for updates and shows a pip command line which pypi.python.org for updates and shows a pip command line which
updates the package. updates the package.
The following additional options can be specified with -U: The following additional options can be specified with -U:
-x -x
execute the pip commands instead of only showing them execute the pip commands instead of only showing them
-d DOWNLOAD_DIRECTORY -d DOWNLOAD_DIRECTORY
download package updates to this directory. The default is to use download package updates to this directory. The default is to use
the directory which contains the latest version of the package to the directory which contains the latest version of the package to
be updated. be updated.
-u -u
allow updating to unstable version (alpha, beta, rc, dev versions) allow updating to unstable version (alpha, beta, rc, dev versions)
Visit https://pypi.python.org/pypi/pypiserver for more information. Visit https://pypi.python.org/pypi/pypiserver for more information.
""" """)
def main(argv=None): def main(argv=None):