Skip to content

Commit

Permalink
Clarify version fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Feb 3, 2024
1 parent 3217401 commit 47d0b9b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tooling/src/hypothesistooling/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,14 @@ def update_python_versions():

def update_pyodide_versions():
vers_re = r"(\d+\.\d+\.\d+)"
pyodide_version = re.findall(
f"pyodide_build-{vers_re}-py3-none-any.whl",
requests.get("https://pypi.org/simple/pyodide-build/").text,
)[-1]
pyodide_version = max(
# Don't just pick the most recent version; find the highest stable version.
re.findall(
f"pyodide_build-{vers_re}-py3-none-any.whl", # excludes pre-releases
requests.get("https://pypi.org/simple/pyodide-build/").text,
),
key=lambda version: tuple(int(x) for x in version.split(".")),
)
makefile_url = f"https://raw.githubusercontent.com/pyodide/pyodide/{pyodide_version}/Makefile.envs"
python_version, emscripten_version = re.search(
rf"export PYVERSION \?= {vers_re}\nexport PYODIDE_EMSCRIPTEN_VERSION \?= {vers_re}\n",
Expand Down Expand Up @@ -340,7 +344,8 @@ def update_vendored_files():
if fname.read_bytes().splitlines()[1:] != new.splitlines()[1:]:
fname.write_bytes(new)

# Always require the latest version of the tzdata package
# Always require the most recent version of tzdata - we don't need to worry about
# pre-releases because tzdata is a 'latest data' package (unlike pyodide-build).
tz_url = "https://pypi.org/pypi/tzdata/json"
tzdata_version = requests.get(tz_url).json()["info"]["version"]
setup = pathlib.Path(hp.BASE_DIR, "setup.py")
Expand Down

0 comments on commit 47d0b9b

Please sign in to comment.