python-trio / trio

Trio – a friendly Python library for async concurrency and I/O
https://trio.readthedocs.io
Other
6.22k stars 342 forks source link

Only run x64 pypy #3138

Closed A5rocks closed 1 week ago

A5rocks commented 1 week ago

Fixes https://github.com/python-trio/trio/issues/3129

This is because "x86" pypy is just setup-python installing x64 pypy.

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.62%. Comparing base (8f2c08c) to head (0cdb392). Report is 3 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3138 +/- ## ======================================= Coverage 99.62% 99.62% ======================================= Files 122 122 Lines 18360 18360 Branches 1222 1222 ======================================= Hits 18291 18291 Misses 47 47 Partials 22 22 ```

🚨 Try these New Features:

graingert commented 1 week ago

@A5rocks can we get a test for this? Eg set the expected architecture somewhere and then check the architectures of sys.executable are a superset

A5rocks commented 1 week ago

@A5rocks can we get a test for this? Eg set the expected architecture somewhere and then check the architectures of sys.executable are a superset

Yeah that's a good idea. Maybe having a dictionary + indexing into that.


Actually that wouldn't work would it? It's not like we ever had an x86 pypy so the test wouldn't catch anything.

graingert commented 1 week ago

It would catch say cpython dropping x86 support or running x86 cpython on arm macos

A5rocks commented 1 week ago

It would catch say cpython dropping x86 support

I don't think it would, actually. Not if the test looks something like <executable architecture> in [<list of architectures>], and I can't think of a form that would catch that. Maybe I'm just not thinking of the same test as you.

(I guess the second would work if we did <executable architecture> in {...}[<platform>] but presumably it would fail to execute to begin with? I don't actually know what Rosetta is or whether that would kick in.)

graingert commented 1 week ago

It should be

assert any(arch == os.environ["EXPECTED_ARCH"] for arch in architectures(sys.executable))