Ensured plugins are installed with package

* Used `find_packages()` in `setup.py` to ensure non-top-level packges
would also be installed
* Updated `.dockerignore` to include some other unnecessary items
* Updated `__main__.py` to not bomb when `update_packages` is not in the
`config` object (i.e. when using `pypiserver run`)
This commit is contained in:
Matthew Planchard 2018-07-26 19:26:56 -05:00
parent 5ea2a9eb5c
commit c10f31339d
6 changed files with 13 additions and 8 deletions

@ -13,6 +13,9 @@
.~ .~
.DS_Store .DS_Store
.ropeproject .ropeproject
.cache
.pytest_cache
.standalone
ID ID
__pycache__/ __pycache__/
/build/ /build/

@ -6,8 +6,7 @@ WORKDIR /code
RUN addgroup -S -g 9898 pypiserver && \ RUN addgroup -S -g 9898 pypiserver && \
adduser -S -u 9898 -G pypiserver pypiserver && \ adduser -S -u 9898 -G pypiserver pypiserver && \
python setup.py install && \ pip install .[passlib] && \
pip install passlib && \
cd / && \ cd / && \
rm -rf /code && \ rm -rf /code && \
mkdir -p /data/packages && \ mkdir -p /data/packages && \
@ -21,5 +20,7 @@ USER pypiserver
WORKDIR /data WORKDIR /data
EXPOSE 8080 EXPOSE 8080
ENTRYPOINT ["pypi-server", "-p", "8080"] ENV PYPISERVER_PORT=8080
CMD ["packages"]
ENTRYPOINT ["pypiserver"]
CMD ["run", "packages"]

@ -59,7 +59,7 @@ def _run_app_from_config(config):
level=config.verbosity, filename=config.log_file, frmt=config.log_frmt level=config.verbosity, filename=config.log_file, frmt=config.log_frmt
) )
if config.update_packages: if hasattr(config, 'update_packages') and config.update_packages:
from pypiserver.manage import update_all_packages from pypiserver.manage import update_all_packages
update_all_packages( update_all_packages(
config.roots, config.roots,

@ -376,7 +376,7 @@ class Config(object):
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
''')) '''))
) )
server.add_argument( server.add_argument(
'--hash-algo', '--hash-algo',

@ -49,6 +49,7 @@ def _validate_roots(roots):
'{}'.format(root, repr(exc)) '{}'.format(root, repr(exc))
) )
def _welcome_msg(welcome_file): def _welcome_msg(welcome_file):
"""Parse the provided welcome file to get the welcome message.""" """Parse the provided welcome file to get the welcome message."""
try: try:

@ -4,7 +4,7 @@
from os import path from os import path
import sys import sys
from setuptools import setup from setuptools import find_packages, setup
tests_require = ['pytest>=2.3', 'tox', 'twine', 'pip>=7', tests_require = ['pytest>=2.3', 'tox', 'twine', 'pip>=7',
@ -37,7 +37,7 @@ setup(
description="A minimal PyPI server for use with pip/easy_install.", description="A minimal PyPI server for use with pip/easy_install.",
long_description=open("README.rst").read(), long_description=open("README.rst").read(),
version=get_version(), version=get_version(),
packages=["pypiserver"], packages=find_packages(exclude=('tests', 'tests.*')),
package_data={'pypiserver': ['welcome.html']}, package_data={'pypiserver': ['welcome.html']},
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
setup_requires=setup_requires, setup_requires=setup_requires,