Skip to content
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

fix: bin/update_pythons.py to work properly with PyPy win_amd64 #695

Merged
merged 2 commits into from
May 26, 2021
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: 13 additions & 16 deletions bin/update_pythons.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class AllVersions:
def __init__(self) -> None:
self.windows_32 = WindowsVersions("32")
self.windows_64 = WindowsVersions("64")
self.windows_pypy = PyPyVersions("32")
self.windows_pypy_64 = PyPyVersions("64")

self.macos_cpython = CPythonVersions()
self.macos_pypy = PyPyVersions("64")
Expand All @@ -243,28 +243,25 @@ def update_config(self, config: dict[str, str]) -> None:
spec = Specifier(f"=={version.major}.{version.minor}.*")
log.info(f"Reading in '{identifier}' -> {spec} @ {version}")
orig_config = copy.copy(config)
config_update: AnyConfig | None
config_update: AnyConfig | None = None

# We need to use ** in update due to MyPy (probably a bug)
if "macos" in identifier:
if identifier.startswith("pp"):
config_update = self.macos_pypy.update_version_macos(spec)
else:
if identifier.startswith("cp"):
config_update = self.macos_cpython.update_version_macos(identifier, version, spec)

assert config_update is not None, f"MacOS {spec} not found!"
config.update(**config_update)
elif identifier.startswith("pp"):
config_update = self.macos_pypy.update_version_macos(spec)
elif "win32" in identifier:
if identifier.startswith("pp"):
config.update(**self.windows_pypy.update_version_windows(spec))
else:
if identifier.startswith("cp"):
config_update = self.windows_32.update_version_windows(spec)
if config_update:
config.update(**config_update)
elif "win_amd64" in identifier:
config_update = self.windows_64.update_version_windows(spec)
if config_update:
config.update(**config_update)
if identifier.startswith("cp"):
config_update = self.windows_64.update_version_windows(spec)
elif identifier.startswith("pp"):
config_update = self.windows_pypy_64.update_version_windows(spec)

assert config_update is not None, f"{identifier} not found!"
config.update(**config_update)

if config != orig_config:
log.info(f" Updated {orig_config} to {config}")
Expand Down