# HG changeset patch # User Vinay Sajip # Date 1553340094 0 # Node ID 2fb549fbb77cb9db4cf7a1bbfa451a978023778d # Parent e6b77d5c7fd6fca23b11bc979e946cd3ac94e125 Fixed #120: Updated default PyPI URL to the pypi.org domain. diff --git a/README.rst b/README.rst --- a/README.rst +++ b/README.rst @@ -67,8 +67,8 @@ The project has reached a mature status in its development: there is a test suite and it has been exercised on Windows, Ubuntu and Mac OS X. The project is -used by well-known projects such as `pip `_ and -`caniusepython3 `_. +used by well-known projects such as `pip `_ and +`caniusepython3 `_. Code of Conduct --------------- diff --git a/distlib/index.py b/distlib/index.py --- a/distlib/index.py +++ b/distlib/index.py @@ -22,7 +22,7 @@ logger = logging.getLogger(__name__) -DEFAULT_INDEX = 'https://pypi.python.org/pypi' +DEFAULT_INDEX = 'https://pypi.org/pypi' DEFAULT_REALM = 'pypi' class PackageIndex(object): diff --git a/distlib/locators.py b/distlib/locators.py --- a/distlib/locators.py +++ b/distlib/locators.py @@ -36,7 +36,7 @@ HASHER_HASH = re.compile(r'^(\w+)=([a-f0-9]+)') CHARSET = re.compile(r';\s*charset\s*=\s*(.*)\s*$', re.I) HTML_CONTENT_TYPE = re.compile('text/html|application/x(ht)?ml') -DEFAULT_INDEX = 'https://pypi.python.org/pypi' +DEFAULT_INDEX = 'https://pypi.org/pypi' def get_all_distribution_names(url=None): """ @@ -197,7 +197,7 @@ is_downloadable = basename.endswith(self.downloadable_extensions) if is_wheel: compatible = is_compatible(Wheel(basename), self.wheel_tags) - return (t.scheme == 'https', 'pypi.python.org' in t.netloc, + return (t.scheme == 'https', 'pypi.org' in t.netloc, is_downloadable, is_wheel, compatible, basename) def prefer_url(self, url1, url2): @@ -1049,7 +1049,7 @@ # versions which don't conform to PEP 426 / PEP 440. default_locator = AggregatingLocator( JSONLocator(), - SimpleScrapingLocator('https://pypi.python.org/simple/', + SimpleScrapingLocator('https://pypi.org/simple/', timeout=3.0), scheme='legacy') diff --git a/tests/SETUPTOOLS-PKG-INFO b/tests/SETUPTOOLS-PKG-INFO --- a/tests/SETUPTOOLS-PKG-INFO +++ b/tests/SETUPTOOLS-PKG-INFO @@ -2,7 +2,7 @@ Name: setuptools Version: 0.6c9 Summary: Download, build, install, upgrade, and uninstall Python packages -- easily! -Home-page: http://pypi.python.org/pypi/setuptools +Home-page: http://pypi.org/pypi/setuptools Author: Phillip J. Eby Author-email: distutils-sig@python.org License: PSF or ZPL @@ -98,7 +98,7 @@ All setuptools downloads can be found at `the project's home page in the Python Package Index`_. Scroll to the very bottom of the page to find the links. - .. _the project's home page in the Python Package Index: http://pypi.python.org/pypi/setuptools + .. _the project's home page in the Python Package Index: http://pypi.org/pypi/setuptools In addition to the PyPI downloads, the development version of ``setuptools`` is available from the `Python SVN sandbox`_, and in-development versions of the diff --git a/tests/SETUPTOOLS-PKG-INFO2 b/tests/SETUPTOOLS-PKG-INFO2 --- a/tests/SETUPTOOLS-PKG-INFO2 +++ b/tests/SETUPTOOLS-PKG-INFO2 @@ -98,7 +98,7 @@ All setuptools downloads can be found at `the project's home page in the Python Package Index`_. Scroll to the very bottom of the page to find the links. - .. _the project's home page in the Python Package Index: http://pypi.python.org/pypi/setuptools + .. _the project's home page in the Python Package Index: http://pypi.org/pypi/setuptools In addition to the PyPI downloads, the development version of ``setuptools`` is available from the `Python SVN sandbox`_, and in-development versions of the diff --git a/tests/test_locators.py b/tests/test_locators.py --- a/tests/test_locators.py +++ b/tests/test_locators.py @@ -29,7 +29,7 @@ PYPI_RPC_HOST = 'http://python.org/pypi' -PYPI_WEB_HOST = os.environ.get('PYPI_WEB_HOST', 'https://pypi.python.org/simple/') +PYPI_WEB_HOST = os.environ.get('PYPI_WEB_HOST', 'https://pypi.org/simple/') class LocatorTestCase(unittest.TestCase): @@ -46,9 +46,9 @@ dist = result['0.1'] self.assertEqual(dist.name, 'sarge') self.assertEqual(dist.version, '0.1') - possible = ('https://pypi.python.org/packages/source/s/sarge/' + possible = ('https://pypi.org/packages/source/s/sarge/' 'sarge-0.1.tar.gz', - 'http://pypi.python.org/packages/source/s/sarge/' + 'http://pypi.org/packages/source/s/sarge/' 'sarge-0.1.tar.gz') self.assertIn(dist.source_url, possible) self.assertEqual(dist.digest, @@ -84,7 +84,7 @@ @unittest.skipIf('SKIP_ONLINE' in os.environ, 'Skipping online test') @unittest.skipUnless(ssl, 'SSL required for this test.') def test_scraper(self): - locator = SimpleScrapingLocator('https://pypi.python.org/simple/') + locator = SimpleScrapingLocator('https://pypi.org/simple/') for name in ('sarge', 'Sarge'): result = locator.get_project(name) self.assertIn('0.1', result) @@ -120,11 +120,11 @@ def test_unicode_project_name(self): # Just checking to see that no exceptions are raised. NAME = '\u2603' - locator = SimpleScrapingLocator('https://pypi.python.org/simple/') + locator = SimpleScrapingLocator('https://pypi.org/simple/') result = locator.get_project(NAME) expected = {'urls': {}, 'digests': {}} self.assertEqual(result, expected) - locator = PyPIJSONLocator('https://pypi.python.org/pypi/') + locator = PyPIJSONLocator('https://pypi.org/pypi/') result = locator.get_project(NAME) self.assertEqual(result, expected) @@ -199,7 +199,7 @@ def test_aggregation(self): d = os.path.join(HERE, 'fake_archives') loc1 = DirectoryLocator(d) - loc2 = SimpleScrapingLocator('https://pypi.python.org/simple/', + loc2 = SimpleScrapingLocator('https://pypi.org/simple/', timeout=5.0) locator = AggregatingLocator(loc1, loc2) exp1 = os.path.join(HERE, 'fake_archives', 'subdir', @@ -236,7 +236,7 @@ def test_dependency_finder(self): locator = AggregatingLocator( JSONLocator(), - SimpleScrapingLocator('https://pypi.python.org/simple/', + SimpleScrapingLocator('https://pypi.org/simple/', timeout=3.0), scheme='legacy') finder = DependencyFinder(locator) @@ -334,7 +334,7 @@ def test_url_preference(self): cases = (('https://netloc/path', 'http://netloc/path'), - ('http://pypi.python.org/path', 'http://netloc/path'), + ('http://pypi.org/path', 'http://netloc/path'), ('http://netloc/B', 'http://netloc/A')) for url1, url2 in cases: self.assertEqual(default_locator.prefer_url(url1, url2), url1) @@ -344,7 +344,7 @@ def test_prereleases(self): locator = AggregatingLocator( JSONLocator(), - SimpleScrapingLocator('https://pypi.python.org/simple/', + SimpleScrapingLocator('https://pypi.org/simple/', timeout=3.0), scheme='legacy') REQT = 'SQLAlchemy (>0.5.8, < 0.6)' diff --git a/tests/test_metadata.py b/tests/test_metadata.py --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -196,7 +196,7 @@ def test_check_version(self): metadata = LegacyMetadata() metadata['Name'] = 'vimpdb' - metadata['Home-page'] = 'http://pypi.python.org' + metadata['Home-page'] = 'http://pypi.org' metadata['Author'] = 'Monty Python' missing, warnings = metadata.check() self.assertEqual(missing, ['Version']) @@ -204,14 +204,14 @@ def test_check_version_strict(self): metadata = LegacyMetadata() metadata['Name'] = 'vimpdb' - metadata['Home-page'] = 'http://pypi.python.org' + metadata['Home-page'] = 'http://pypi.org' metadata['Author'] = 'Monty Python' self.assertRaises(MetadataMissingError, metadata.check, strict=True) def test_check_name(self): metadata = LegacyMetadata() metadata['Version'] = '1.0' - metadata['Home-page'] = 'http://pypi.python.org' + metadata['Home-page'] = 'http://pypi.org' metadata['Author'] = 'Monty Python' missing, warnings = metadata.check() self.assertEqual(missing, ['Name']) @@ -219,7 +219,7 @@ def test_check_name_strict(self): metadata = LegacyMetadata() metadata['Version'] = '1.0' - metadata['Home-page'] = 'http://pypi.python.org' + metadata['Home-page'] = 'http://pypi.org' metadata['Author'] = 'Monty Python' self.assertRaises(MetadataMissingError, metadata.check, strict=True) @@ -227,7 +227,7 @@ metadata = LegacyMetadata() metadata['Version'] = '1.0' metadata['Name'] = 'vimpdb' - metadata['Home-page'] = 'http://pypi.python.org' + metadata['Home-page'] = 'http://pypi.org' missing, warnings = metadata.check() self.assertEqual(missing, ['Author']) @@ -243,7 +243,7 @@ metadata = LegacyMetadata() metadata['Version'] = 'rr' metadata['Name'] = 'vimpdb' - metadata['Home-page'] = 'http://pypi.python.org' + metadata['Home-page'] = 'http://pypi.org' metadata['Author'] = 'Monty Python' metadata['Requires-dist'] = ['Foo (a)'] metadata['Obsoletes-dist'] = ['Foo (a)'] diff --git a/tests/test_testdist-0.1/PKG-INFO b/tests/test_testdist-0.1/PKG-INFO --- a/tests/test_testdist-0.1/PKG-INFO +++ b/tests/test_testdist-0.1/PKG-INFO @@ -4,7 +4,7 @@ Summary: A test project for distlib Description: This distribution is a test for distlib. Keywords: -Home-page: http://pypi.python.org/pypi/test_testdist/ +Home-page: http://pypi.org/pypi/test_testdist/ Author: Test User Author-email: test.user@testusers.org Maintainer: Test User diff --git a/tests/test_testdist-0.1/package.json b/tests/test_testdist-0.1/package.json --- a/tests/test_testdist-0.1/package.json +++ b/tests/test_testdist-0.1/package.json @@ -21,7 +21,7 @@ "role": "author" } ], "project_urls": { - "Home": "http://pypi.python.org/pypi/test_testdist/" + "Home": "http://pypi.org/pypi/test_testdist/" } } } diff --git a/tests/test_wheel.py b/tests/test_wheel.py --- a/tests/test_wheel.py +++ b/tests/test_wheel.py @@ -68,7 +68,7 @@ scripts = pfx + '--install-scripts=%s/scripts' % workdir data = pfx + '--install-data=%s/data' % workdir cmd = ['pip', 'install', - '--index-url', 'https://pypi.python.org/simple/', + '--index-url', 'https://pypi.org/simple/', '--timeout', '3', '--default-timeout', '3', purelib, platlib, headers, scripts, data, distname] result = { diff --git a/tests/testdist-0.1/PKG-INFO b/tests/testdist-0.1/PKG-INFO --- a/tests/testdist-0.1/PKG-INFO +++ b/tests/testdist-0.1/PKG-INFO @@ -4,7 +4,7 @@ Summary: A test project for distlib Description: This distribution is a test for distlib. Keywords: -Home-page: http://pypi.python.org/pypi/{username}_testdist/ +Home-page: http://pypi.org/pypi/{username}_testdist/ Author: Test User Author-email: test.user@testusers.org Maintainer: Test User diff --git a/tests/testdist-0.1/package.json b/tests/testdist-0.1/package.json --- a/tests/testdist-0.1/package.json +++ b/tests/testdist-0.1/package.json @@ -10,7 +10,7 @@ "name": "{username}_testdist", "license": "Copyright (C) 2013 by Test User.", "author": "Test User", - "home-page": "http://pypi.python.org/pypi/{username}_testdist/", + "home-page": "http://pypi.org/pypi/{username}_testdist/", "summary": "A test project for distlib", "version": "0.1", "maintainer-email": "test.user@testusers.org",