From 4ab210c82b37e480d18c50d6f2b96fa44e135255 Mon Sep 17 00:00:00 2001 From: Matthew Planchard Date: Sat, 3 Oct 2020 22:25:14 -0500 Subject: [PATCH] MAINT: drop standalone, drop py 2.7 and 3.5 (#338) --- .travis.yml | 4 ---- CHANGES.rst | 3 +++ README.rst | 30 +++++---------------------- bin/README.rst | 7 +------ bin/commit-standalone.sh | 41 ------------------------------------ bin/gen-standalone.sh | 45 ---------------------------------------- bin/test_standalone.sh | 18 ---------------- pypiserver/__main__.py | 7 ++----- pypiserver/core.py | 4 +--- tox.ini | 2 +- 10 files changed, 13 insertions(+), 148 deletions(-) delete mode 100755 bin/commit-standalone.sh delete mode 100755 bin/gen-standalone.sh delete mode 100755 bin/test_standalone.sh diff --git a/.travis.yml b/.travis.yml index caa2a1c..3e790ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,9 @@ language: python services: docker python: - - 2.7 - - 3.5 - 3.6 - 3.7 - 3.8 - - pypy - pypy3 install: @@ -16,7 +13,6 @@ install: script: - ./bin/test-docker.sh - - ./bin/test_standalone.sh - tox - ./bin/check_readme.sh diff --git a/CHANGES.rst b/CHANGES.rst index 18c6a30..43071c6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,9 @@ Changelog ========= +v2.0.0 (tbd) +------------ + 1.4.0 (2020-10-03) ------------------ diff --git a/README.rst b/README.rst index 611af48..94c76f8 100644 --- a/README.rst +++ b/README.rst @@ -46,9 +46,12 @@ with ``scp``. Quickstart: Installation and Usage ================================== -``pypiserver`` > 1.2.x works with Python 2.7 and 3.5+ or PyPy. +``pypiserver`` works with Python 3.6+ and PyPy3. + Older Python versions may still work, but they are not tested. -For legacy Python versions, use ``pypiserver-1.1.x`` series. + +For legacy Python versions, use ``pypiserver-1.x`` series. Note that these are +not officially supported, and will not receive bugfixes or new features. .. Tip:: The commands below work on a unix-like operating system with a posix shell. @@ -410,29 +413,6 @@ following command, assuming you have *git* installed on your ``PATH``:: pip install git+git://github.com/pypiserver/pypiserver.git -Installing It As Standalone Script ----------------------------------- - -The git repository contains a ``pypi-server-standalone.py`` script, -which is a single python file that can be executed without any other -dependencies. - -Run the following commands to download the script with ``wget``:: - - wget https://raw.github.com/pypiserver/pypiserver/standalone/pypi-server-standalone.py - chmod +x pypi-server-standalone.py - -or with ``curl``:: - - curl -O https://raw.github.com/pypiserver/pypiserver/standalone/pypi-server-standalone.py - chmod +x pypi-server-standalone.py - -You can then start-up the server with:: - - ./pypi-server-standalone.py - -Feel free to rename the script and move it into your ``$PATH``. - Running on Heroku/Dotcloud -------------------------- diff --git a/bin/README.rst b/bin/README.rst index f829d12..267ce42 100644 --- a/bin/README.rst +++ b/bin/README.rst @@ -8,9 +8,6 @@ Files: - ``bumpver.py`` : Bump, commit and tag new project versions - ``check_readme.sh`` : Check that README has no RsT-syntactic errors. -- ``commit-standalone.sh`` : Create an executable file and add it into `standalone` branch. -- ``gen-standalone.sh`` : Invoked by `commit-standalone.sh`. -- ``git-new-workdir`` : Invoked by `gen-standalone.sh`. - ``package.sh`` : Build deployable artifact (wheel) in ``/dist/`` folder. - ``README.rst`` : This file. @@ -30,9 +27,7 @@ Release check-list: 5. Generate package *wheel* with ``/bin/package.sh``. -6. Upload to PyPi with ``twine upload -s -i dist/*``: - -7. Run ``bin/commit-standalone.sh``. +6. Upload to PyPi with ``twine upload -s -i dist/*`` 7. Ensure that the new tag is built on hub.docker.com as ``latest`` and as a direct tag reference. diff --git a/bin/commit-standalone.sh b/bin/commit-standalone.sh deleted file mode 100755 index 87b09b3..0000000 --- a/bin/commit-standalone.sh +++ /dev/null @@ -1,41 +0,0 @@ -#! /bin/sh -# -## Create an executable file and add it into `standalone` branch -# -# Invoke it directly on the commmit "tagged" for a release. -# Invoke it with any arg to avoid committing into `standalone` branch. - -set -x - -my_dir="$(dirname "$0")" -cd $my_dir/.. - -git_wdir="./bin/git-new-workdir" -git_wdir_url="https://raw.githubusercontent.com/git/git/master/contrib/workdir/git-new-workdir" - -if [ ! -x "$git_wdir" ]; then - wget "$git_wdir_url" -O "$git_wdir" - chmod a+x "$git_wdir" -fi - -## Ensure `standalone` branch exists (fails in travis). -git fetch pypiserver standalone:pypiserver/standalone -f && \ - git branch --track standalone pypiserver/standalone - -set -o errexit - -gitversion=$(git describe --tags) -rm -rf .standalone -if nwd_dump=$( "$git_wdir" . .standalone standalone 2>&1 ); then - ./bin/gen-standalone.sh - mkdir -p .standalone - cp -p pypi-server-standalone.py .standalone - cd .standalone - if [ $# -lt 1 ]; then - git add . - git commit -m "Add pypi-server-standalone $gitversion" - fi -else - echo "git-new-workdir: failed due to: $nwd_dump" - exit 1 -fi diff --git a/bin/gen-standalone.sh b/bin/gen-standalone.sh deleted file mode 100755 index d4223e2..0000000 --- a/bin/gen-standalone.sh +++ /dev/null @@ -1,45 +0,0 @@ -#! /bin/sh -# -## Create an executable zip file. -# Invoked by `commit-standalone.sh`. - -set -x - -set -o errexit - -exec_zip="./pypi-server-standalone.py" - -my_dir="$(dirname "$0")" -cd $my_dir/.. - -rm -rf ./build/* ./dist/* -python setup.py bdist_wheel -wheel="./dist/pypiserver-*.whl" - - -## Modify `wheel` archive with `__main__.py` at root, -# add dependencies, and -# prepend it with a python-flashbang + some header-comments >= 10-lines -# so that ``head pypiserver*.py``behaves politely. -# -sudo update-ca-certificates || echo "Failed updating certs (run on travis container?)" -unzip -jo $wheel pypiserver/__main__.py -d ./dist -zip -d $wheel pypiserver/__main__.py -zip -mj $wheel ./dist/__main__.py -wget https://files.pythonhosted.org/packages/2d/a7/1a3363e5d531d438267a79d43d4b8d224655adef489e98fc96678fe16ed1/passlib-1.6.5-py2.py3-none-any.whl \ - -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 -#!/usr/bin/env python -## -## Standalone pypiserver-$gitversion $(date -R) -## -## Execute it like that: -## $exec_zip -## To get more help, type: -## $exec_zip --help -## -## BINARY CONTENT FOLLOWS -EOF -chmod a+xr "$exec_zip" diff --git a/bin/test_standalone.sh b/bin/test_standalone.sh deleted file mode 100755 index 5fb7507..0000000 --- a/bin/test_standalone.sh +++ /dev/null @@ -1,18 +0,0 @@ -#! /bin/sh -## Test standalone generation & execution. -## - -set -x - -my_dir="$(dirname "$0")" -cd $my_dir/.. - -git fetch origin standalone:origin/standalone -git branch --track standalone origin/standalone -./bin/commit-standalone.sh no_commit - -./pypi-server-standalone.py . & -server_pid=$! -sleep 2 - -kill $server_pid && echo "Server killed nicely." # Kill fails if server failed. diff --git a/pypiserver/__main__.py b/pypiserver/__main__.py index 3f3d106..5d02d7e 100644 --- a/pypiserver/__main__.py +++ b/pypiserver/__main__.py @@ -1,9 +1,6 @@ #! /usr/bin/env python -""" -.. NOTE:: To the developer: - This module is moved to the root of the standalone zip-archive, - to be used as its entry-point. Therefore DO NOT import relative. -""" +"""Entrypoint for pypiserver.""" + from __future__ import print_function import getopt diff --git a/pypiserver/core.py b/pypiserver/core.py index b8ee8b7..9b0ce04 100644 --- a/pypiserver/core.py +++ b/pypiserver/core.py @@ -56,9 +56,7 @@ def configure(**kwds): c.password_file = htPsswdFile = None c.auther = functools.partial(auth_by_htpasswd_file, htPsswdFile) - # Read welcome-msg from external file, - # or failback to the embedded-msg (ie. in standalone mode). - # + # Read welcome-msg from external file or failback to the embedded-msg try: if not c.welcome_file: c.welcome_file = "welcome.html" diff --git a/tox.ini b/tox.ini index c5d342b..3aa338c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py35,py36,py37,py38,pypy,pypy3 +envlist = py36,py37,py38,pypy3 [testenv] deps=-r{toxinidir}/requirements/dev.pip