From c791d1229245fead161585e636debca18af9ce4f Mon Sep 17 00:00:00 2001
From: Matthew Planchard
Date: Mon, 11 Jun 2018 20:27:09 -0500
Subject: [PATCH] FIX: Fallback URL, remove calls to pip.main
Resolves #205 - pypi.python.org shutting down
* Updated the default fallback URL to `pypi.org/simple` rather than
`pypi.python.org/simple`
* Scrubbed references and links to `pypi.python.org`
* Fixed tests breaking due to the removal of `pip.main()` in pip 10.0 -
see pypa/pip#5080 for more info
---
.gitignore | 3 +++
CHANGES.rst | 9 +++++++++
README.rst | 34 +++++++++++++++++-----------------
bin/gen-standalone.sh | 2 +-
pypiserver/__main__.py | 4 ++--
pypiserver/core.py | 2 +-
pypiserver/manage.py | 4 ++--
pypiserver/welcome.html | 2 +-
tests/test_app.py | 17 ++++++++---------
tests/test_main.py | 3 +--
tests/test_server.py | 20 ++++++++++++--------
11 files changed, 57 insertions(+), 43 deletions(-)
diff --git a/.gitignore b/.gitignore
index 87cb765..97c2d22 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,7 @@
.*.swo
.*.swn
.~
+.envrc
.DS_Store
.ropeproject
ID
@@ -23,6 +24,7 @@ __pycache__/
/pypi-server-standalone.py
/.project
/.pydevproject
+/.pytest_cache
/.tox/
/*.egg-info/
/.standalone
@@ -38,6 +40,7 @@ __pycache__/
# IDE stuff
.idea/
+.vscode/
# Venvs
.venv/
diff --git a/CHANGES.rst b/CHANGES.rst
index 0c463fa..e61a92a 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,6 +1,15 @@
Changelog
=========
+1.2.2 (2018-06-xx)
+------------------
+
+- FIX: update fallback URL to https://pypi.org/simple since pypi.python.org
+ has shut down
+- FIX: updated tests to use ``Popen`` rather than ``pip.main()`` given its
+ removal in pip version 10.0
+- DOC: scrubbed docs of links to pypi.python.org
+
1.2.1 (2017-11-29)
------------------
diff --git a/README.rst b/README.rst
index 98d8ba9..ce8a433 100644
--- a/README.rst
+++ b/README.rst
@@ -13,7 +13,7 @@ pypiserver - minimal PyPI server for use with pip/easy_install
:Version: 1.2.2dev0
:Date: 2017-11-29 11:49:30
:Source: https://github.com/pypiserver/pypiserver
-:PyPI: https://pypi.python.org/pypi/pypiserver
+:PyPI: https://pypi.org/project/pypiserver/
:Travis: https://travis-ci.org/pypiserver/pypiserver
:Maintainers: Kostis Anagnostopoulos ,
Matthew Planchard
@@ -114,7 +114,7 @@ For legacy python versions, use ``pypiserver-1.1.x`` series.
--fallback-url FALLBACK_URL
for packages not found in the local index, this URL will be used to
- redirect to (default: https://pypi.python.org/simple)
+ redirect to (default: https://pypi.org/simple)
--server METHOD
use METHOD to run the server. Valid values include paste,
@@ -170,7 +170,7 @@ For legacy python versions, use ``pypiserver-1.1.x`` series.
pypi-server -U [OPTIONS] [PACKAGES_DIRECTORY...]
update packages in PACKAGES_DIRECTORY. This command searches
- pypi.python.org for updates and shows a pip command line which
+ pypi.org for updates and shows a pip command line which
updates the package.
The following additional options can be specified with -U:
@@ -194,7 +194,7 @@ Client-side Configurations
==========================
Always specifying the the pypi url on the command line is a bit
cumbersome. Since *pypiserver* redirects ``pip/easy_install`` to the
-``pypi.python.org`` index if it doesn't have a requested package, it's a
+``pypi.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.
Configuring *pip*
@@ -397,7 +397,7 @@ Managing the package directory
------------------------------
The ``pypi-server`` command has the ``-U`` option that searches for updates of
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.org for updates. Without further
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
looks like::
@@ -412,10 +412,10 @@ looks like::
no releases found on pypi for PyXML, Pymacs, mercurial, setuptools
# update raven from 1.4.3 to 1.4.4
- pip -q install --no-deps --extra-index-url https://pypi.python.org/simple -d /home/ralf/packages/mirror raven==1.4.4
+ pip -q install --no-deps --extra-index-url https://pypi.org/simple -d /home/ralf/packages/mirror raven==1.4.4
# update greenlet from 0.3.3 to 0.3.4
- pip -q install --no-deps --extra-index-url https://pypi.python.org/simple -d /home/ralf/packages/mirror greenlet==0.3.4
+ pip -q install --no-deps --extra-index-url https://pypi.org/simple -d /home/ralf/packages/mirror greenlet==0.3.4
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'``
@@ -777,10 +777,10 @@ There are lots of other projects, which allow you to run your own
PyPI server. If *pypiserver* doesn't work for you, the following are
among the most popular alternatives:
-- `devpi-server `_:
- a reliable fast pypi.python.org caching server, part of
+- `devpi-server `_:
+ a reliable fast pypi.org caching server, part of
the comprehensive `github-style pypi index server and packaging meta tool
- `_.
+ `_.
(version: 2.1.4, access date: 8/3/2015)
- `pip2pi `_
@@ -811,25 +811,25 @@ See the ``LICENSE.txt`` file.
.. _bottle: http://bottlepy.org
-.. _PyPI: https://pypi.python.org
-.. _twine: https://pypi.python.org/pypi/twine
-.. _pypi-uploader: https://pypi.python.org/pypi/pypi-uploader
-.. _python-pam: https://pypi.python.org/pypi/python-pam/
+.. _PyPI: https://pypi.org
+.. _twine: https://pypi.org/project/twine/
+.. _pypi-uploader: https://pypi.org/project/pypi-uploader/
+.. _python-pam: https://pypi.org/project/python-pam/
.. |travis-status| image:: https://travis-ci.org/pypiserver/pypiserver.svg
:alt: Travis build status
:scale: 100%
:target: https://travis-ci.org/pypiserver/pypiserver
.. |pypi-ver| image:: https://img.shields.io/pypi/v/pypiserver.svg
- :target: https://pypi.python.org/pypi/pypiserver/
+ :target: https://pypi.org/project/pypiserver/
:alt: Latest Version in PyPI
.. |python-ver| image:: https://img.shields.io/pypi/pyversions/pypiserver.svg
- :target: https://pypi.python.org/pypi/pypiserver/
+ :target: https://pypi.org/project/pypiserver/
:alt: Supported Python versions
.. |downloads-count| image:: https://img.shields.io/pypi/dm/pypiserver.svg?period=week
- :target: https://pypi.python.org/pypi/pypiserver/
+ :target: https://pypi.org/project/pypiserver/
:alt: Downloads
.. |proj-license| image:: https://img.shields.io/badge/license-BSD%2Bzlib%2Flibpng-blue.svg
diff --git a/bin/gen-standalone.sh b/bin/gen-standalone.sh
index d490391..d4223e2 100755
--- a/bin/gen-standalone.sh
+++ b/bin/gen-standalone.sh
@@ -26,7 +26,7 @@ sudo update-ca-certificates || echo "Failed updating certs (run on travis contai
unzip -jo $wheel pypiserver/__main__.py -d ./dist
zip -d $wheel pypiserver/__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 \
+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)
diff --git a/pypiserver/__main__.py b/pypiserver/__main__.py
index fd07ef9..26c64d3 100644
--- a/pypiserver/__main__.py
+++ b/pypiserver/__main__.py
@@ -129,7 +129,7 @@ def usage():
pypi-server -U [OPTIONS] [PACKAGES_DIRECTORY...]
update packages in PACKAGES_DIRECTORY. This command searches
- pypi.python.org for updates and shows a pip command line which
+ pypi.org for updates and shows a pip command line which
updates the package.
The following additional options can be specified with -U:
@@ -145,7 +145,7 @@ def usage():
-u
allow updating to unstable version (alpha, beta, rc, dev versions)
- Visit https://pypi.python.org/pypi/pypiserver for more information.
+ Visit https://pypi.org/project/pypiserver/ for more information.
""")
diff --git a/pypiserver/core.py b/pypiserver/core.py
index 6d919e0..114dc38 100644
--- a/pypiserver/core.py
+++ b/pypiserver/core.py
@@ -68,7 +68,7 @@ def configure(**kwds):
"Could not load welcome-file(%s)!", c.welcome_file, exc_info=1)
if c.fallback_url is None:
- c.fallback_url = "https://pypi.python.org/simple"
+ c.fallback_url = "https://pypi.org/simple"
if c.hash_algo:
try:
diff --git a/pypiserver/manage.py b/pypiserver/manage.py
index f788fd8..70d04b5 100644
--- a/pypiserver/manage.py
+++ b/pypiserver/manage.py
@@ -104,7 +104,7 @@ def find_updates(pkgset, stable_only=True):
"checking %s packages for newer version\n" % len(latest_pkgs),)
need_update = set()
- pypi = make_pypi_client("https://pypi.python.org/pypi/")
+ pypi = make_pypi_client("https://pypi.org/pypi/")
for count, pkg in enumerate(latest_pkgs):
if count % 40 == 0:
@@ -140,7 +140,7 @@ def update(pkgset, destdir=None, dry_run=False, stable_only=True):
sys.stdout.write("# update %s from %s to %s\n" %
(pkg.pkgname, pkg.replaces.version, pkg.version))
- cmd = ["pip", "-q", "install", "--no-deps", "-i", "https://pypi.python.org/simple",
+ cmd = ["pip", "-q", "install", "--no-deps", "-i", "https://pypi.org/simple",
"-d", destdir or os.path.dirname(pkg.replaces.fn),
"%s==%s" % (pkg.pkgname, pkg.version)]
diff --git a/pypiserver/welcome.html b/pypiserver/welcome.html
index c509b18..a7fcc67 100644
--- a/pypiserver/welcome.html
+++ b/pypiserver/welcome.html
@@ -16,5 +16,5 @@ easy_install -i {{URL}}simple/ PACKAGE
or via the simple index.
This instance is running version {{VERSION}} of the
- pypiserver software.
+ pypiserver software.