Skip to content

Commit ee2e4c3

Browse files
committed
Move downloads to YAML
1 parent dfc282c commit ee2e4c3

File tree

7 files changed

+565
-497
lines changed

7 files changed

+565
-497
lines changed

cpython-unix/build-main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@
1111
import subprocess
1212
import sys
1313

14-
from pythonbuild.downloads import DOWNLOADS
1514
from pythonbuild.utils import (
1615
compress_python_archive,
16+
get_downloads,
1717
get_target_settings,
1818
release_tag_from_git,
1919
supported_targets,
2020
)
2121

2222
ROOT = pathlib.Path(os.path.abspath(__file__)).parent.parent
23+
DOWNLOADS_FILE = ROOT / "downloads.yml"
2324
BUILD = ROOT / "build"
2425
DIST = ROOT / "dist"
2526
SUPPORT = ROOT / "cpython-unix"
@@ -114,6 +115,8 @@ def main():
114115

115116
settings = get_target_settings(TARGETS_CONFIG, target_triple)
116117

118+
downloads = get_downloads(DOWNLOADS_FILE)
119+
117120
supported_pythons = {"cpython-%s" % p for p in settings["pythons_supported"]}
118121

119122
if args.python not in supported_pythons:
@@ -145,7 +148,7 @@ def main():
145148
env["PYBUILD_NO_DOCKER"] = "1"
146149

147150
if not args.python_source:
148-
entry = DOWNLOADS[args.python]
151+
entry = downloads[args.python]
149152
env["PYBUILD_PYTHON_VERSION"] = cpython_version = entry["version"]
150153
else:
151154
# TODO consider parsing version from source checkout. Or defining version

0 commit comments

Comments
 (0)