Skip to content

MAINT: work around setuptools internals for 80.3 #3311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions ah_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import pkg_resources

from setuptools import Distribution
from setuptools.package_index import PackageIndex

# This is the minimum Python version required for astropy-helpers
__minimum_python_version__ = (3, 5)
Expand Down Expand Up @@ -416,12 +415,6 @@ def get_local_directory_dist(self):
'The requested path {0!r} for importing {1} does not '
'exist, or does not contain a copy of the {1} '
'package.'.format(self.path, PACKAGE_NAME))
elif self.auto_upgrade and not self.is_submodule:
# A version of astropy-helpers was found on the available path, but
# check to see if a bugfix release is available on PyPI
upgrade = self._do_upgrade(dist)
if upgrade is not None:
dist = upgrade

return dist

Expand All @@ -448,13 +441,6 @@ def get_local_file_dist(self):
'{2}'.format(PACKAGE_NAME, self.path, str(e)))
dist = None

if dist is not None and self.auto_upgrade:
# A version of astropy-helpers was found on the available path, but
# check to see if a bugfix release is available on PyPI
upgrade = self._do_upgrade(dist)
if upgrade is not None:
dist = upgrade

return dist

def get_index_dist(self):
Expand Down Expand Up @@ -588,21 +574,6 @@ def get_option_dict(self, command_name):

raise Exception(msg.format(DIST_NAME, source, repr(e)))

def _do_upgrade(self, dist):
# Build up a requirement for a higher bugfix release but a lower minor
# release (so API compatibility is guaranteed)
next_version = _next_version(dist.parsed_version)

req = pkg_resources.Requirement.parse(
'{0}>{1},<{2}'.format(DIST_NAME, dist.version, next_version))

package_index = PackageIndex(index_url=self.index_url)

upgrade = package_index.obtain(req)

if upgrade is not None:
return self._do_download(version=upgrade.version)

def _check_submodule(self):
"""
Check if the given path is a git submodule.
Expand Down
Loading