5353import pkg_resources
5454
5555from setuptools import Distribution
56- from setuptools.package_index import PackageIndex
5756
5857# This is the minimum Python version required for astropy-helpers
5958__minimum_python_version__ = (3, 5)
@@ -416,12 +415,6 @@ def get_local_directory_dist(self):
416415 'The requested path {0!r} for importing {1} does not '
417416 'exist, or does not contain a copy of the {1} '
418417 'package.'.format(self.path, PACKAGE_NAME))
419- elif self.auto_upgrade and not self.is_submodule:
420- # A version of astropy-helpers was found on the available path, but
421- # check to see if a bugfix release is available on PyPI
422- upgrade = self._do_upgrade(dist)
423- if upgrade is not None:
424- dist = upgrade
425418
426419 return dist
427420
@@ -448,13 +441,6 @@ def get_local_file_dist(self):
448441 '{2}'.format(PACKAGE_NAME, self.path, str(e)))
449442 dist = None
450443
451- if dist is not None and self.auto_upgrade:
452- # A version of astropy-helpers was found on the available path, but
453- # check to see if a bugfix release is available on PyPI
454- upgrade = self._do_upgrade(dist)
455- if upgrade is not None:
456- dist = upgrade
457-
458444 return dist
459445
460446 def get_index_dist(self):
@@ -588,21 +574,6 @@ def get_option_dict(self, command_name):
588574
589575 raise Exception(msg.format(DIST_NAME, source, repr(e)))
590576
591- def _do_upgrade(self, dist):
592- # Build up a requirement for a higher bugfix release but a lower minor
593- # release (so API compatibility is guaranteed)
594- next_version = _next_version(dist.parsed_version)
595-
596- req = pkg_resources.Requirement.parse(
597- '{0}>{1},<{2}'.format(DIST_NAME, dist.version, next_version))
598-
599- package_index = PackageIndex(index_url=self.index_url)
600-
601- upgrade = package_index.obtain(req)
602-
603- if upgrade is not None:
604- return self._do_download(version=upgrade.version)
605-
606577 def _check_submodule(self):
607578 """
608579 Check if the given path is a git submodule.
0 commit comments