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

Test against Pyodide / Emscripten in CI #3870

Merged
merged 3 commits into from
Feb 3, 2024

Conversation

Zac-HD
Copy link
Member

@Zac-HD Zac-HD commented Feb 2, 2024

Fixes #3437, after a fair bit of hacking.

I'm particularly pleased about automatically updating the pinned versions; doing so from our weekly cronjob will go a long way towards avoiding compatibility bitrot as upstream changes. (which I think is why https://zhd.dev/ghostwriter/ stopped working 😿)

@Zac-HD Zac-HD added the tests/build/CI about testing or deployment *of* Hypothesis label Feb 2, 2024
@Zac-HD Zac-HD force-pushed the pyodide-in-ci branch 6 times, most recently from b0648e2 to c981939 Compare February 3, 2024 10:24
@Zac-HD Zac-HD changed the title EXPERIMENTAL pyodide CI run Test against Pyodide / Emscripten in CI Feb 3, 2024
@Zac-HD Zac-HD requested a review from jobh February 3, 2024 10:56
@jobh
Copy link
Contributor

jobh commented Feb 3, 2024

I'm amazed this works at all. Will review later.

pyodide_version = re.findall(
f"pyodide_build-{vers_re}-py3-none-any.whl",
requests.get("https://pypi.org/simple/pyodide-build/").text,
)[-1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure it's always sorted? Anyways: https://pypi.org/pypi/pyodide-build/json provides the .info.version field

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That gives us the most recent release, but we want the largest non-prerelease version which means we can't use the json endpoint. We use the regex to exclude pre-releases, but I've also switched from indexing to max() so we won't pick up a newer release of e.g. a patch backported to an older minor version - which hasn't happened yet and seems unlikely at zerover, but it's easy to handle 😁

Copy link
Contributor

@jobh jobh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! And of course the proof is in the pudding: it works.

I'd suggest changing the PyPI URL and parsing, but otherwise good to go.

tooling/src/hypothesistooling/__main__.py Show resolved Hide resolved
@jobh jobh self-requested a review February 3, 2024 16:09
Copy link
Contributor

@jobh jobh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Zac-HD Zac-HD merged commit 8f209ce into HypothesisWorks:master Feb 3, 2024
48 checks passed
@Zac-HD Zac-HD deleted the pyodide-in-ci branch February 3, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests/build/CI about testing or deployment *of* Hypothesis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test against Pyodide in CI
2 participants