53
53
import pkg_resources
54
54
55
55
from setuptools import Distribution
56
- from setuptools .package_index import PackageIndex
57
56
58
57
# This is the minimum Python version required for astropy-helpers
59
58
__minimum_python_version__ = (3 , 5 )
@@ -416,12 +415,6 @@ def get_local_directory_dist(self):
416
415
'The requested path {0!r} for importing {1} does not '
417
416
'exist, or does not contain a copy of the {1} '
418
417
'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
425
418
426
419
return dist
427
420
@@ -448,13 +441,6 @@ def get_local_file_dist(self):
448
441
'{2}' .format (PACKAGE_NAME , self .path , str (e )))
449
442
dist = None
450
443
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
-
458
444
return dist
459
445
460
446
def get_index_dist (self ):
@@ -588,21 +574,6 @@ def get_option_dict(self, command_name):
588
574
589
575
raise Exception (msg .format (DIST_NAME , source , repr (e )))
590
576
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
-
606
577
def _check_submodule (self ):
607
578
"""
608
579
Check if the given path is a git submodule.
0 commit comments