Fix compatibility with pytest-run-parallel and add free-threaded CI jobs#63
Fix compatibility with pytest-run-parallel and add free-threaded CI jobs#63astrofrog wants to merge 2 commits into
Conversation
… it has no free-threaded wheel and its sdist requires libhdf5-dev which CI does not install
eeb1750 to
340e541
Compare
| - linux: py313t-test | ||
| - linux: py313t-test-parallel |
There was a problem hiding this comment.
I'd suggest going straight to 314t here:
- 3.13t was always experimental
- cibuildwheel is currently sunsetting it so it seems unlikely that
tableswill ever support it
| gen_dir = os.path.join(tmpdir, 'reference') | ||
|
|
||
| # Generate the reference file first | ||
| code = subprocess.call( |
There was a problem hiding this comment.
shouldn't this use the builtin pytester fixture instead ? https://docs.pytest.org/en/stable/reference/reference.html#std-fixture-pytester
It does require pytest>=6.2, which is very reasonable now IMO (6.2 came out in 2020)
| tmpdir = tempfile.mkdtemp() | ||
| test_file = os.path.join(tmpdir, 'test.py') | ||
| with open(test_file, 'w') as f: | ||
| f.write(TEST_PARALLEL) | ||
|
|
||
| gen_dir = os.path.join(tmpdir, 'reference') |
There was a problem hiding this comment.
I suggest using the tmp_path builtin fixture here
| tmpdir = tempfile.mkdtemp() | |
| test_file = os.path.join(tmpdir, 'test.py') | |
| with open(test_file, 'w') as f: | |
| f.write(TEST_PARALLEL) | |
| gen_dir = os.path.join(tmpdir, 'reference') | |
| test_file = tmp_path / 'test.py' | |
| test_file.write_test(TEST_PARALLEL) | |
| gen_dir = tmp_path / 'reference' |
| numpy | ||
|
|
||
| # tables limitation is until 3.9.3 is out as that supports ARM OSX. | ||
| # tables limitation is until 3.9.3 is out as that supports ARM OSX, and |
There was a problem hiding this comment.
I don't think this additional comment is particularly helpful here; it'd be much more fitting in tox.ini
| # which CI does not install. Skip the HDF5 extras on free-threaded | ||
| # envs. |
There was a problem hiding this comment.
Aligning the phrasing with the way configuration is written
| # which CI does not install. Skip the HDF5 extras on free-threaded | |
| # envs. | |
| # which CI does not install. Only run these test on GIL-enabled builds. |
| @pytest.hookimpl(hookwrapper=True) | ||
| def pytest_runtest_call(self, item): |
There was a problem hiding this comment.
isn't this implementation now exactly equivalent to the default ?
Without this fix, we can't run tests with pytest-run-parallel if those tests rely on pytest-arraydiff (which is used e.g. in reproject):
The fix here ensures we don't wrap the tests multiple times, and make sure we always pass output values through.
(Note: I pushed this to an upstream branch by mistake as this repo used to be under my user - will fix it for future)