-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
TST: Use meson
for testing f2py
#25111
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
Conversation
508490a
to
ac6cc34
Compare
meson
for testing f2py
meson
for testing f2py
Could we do the merging the other way around: get this PR to work first and then revisit #25114? |
Unfortunately not, see #25181 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. A few nits.
numpy/f2py/__init__.py
Outdated
@@ -92,17 +92,16 @@ def compile(source, | |||
with open(fname, 'w') as f: | |||
f.write(source) | |||
|
|||
args = ['-c', '-m', modulename, f.name] | |||
args = ['-c', '--backend', 'meson', '-m', | |||
modulename, f.name] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't meson be made the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet, for python<3.12
the default (with a warning) is still distutils
. >=3.12
it automatically (and noisily) switches to meson
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, in terms of the testing infrastructure, there's no point keeping the distutils
build and test routines, so we just default to using meson
explicitly here.
c411a21
to
687d8ce
Compare
Please squash this when it gets merged. |
The version is too old to be of use
@HaoZeke and I just discussed that we plan to fix the speed issue in stages: add some slow markers in this PR, merge this PR, switch to pytest fixtures to speed up the tests after, and then deal with some CI sanitation to run compile tests less often. |
Should finish in around a minute now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Rohit, LGTM now - let's give this a go!
The user of this import was removed in the cleanup in numpy#25111, post-2.26.
* MAINT,TST: Use meson for compiler checks [f2py] * MAINT: Cache the compiler checks [f2py] * MAINT,TST: Always use meson [f2py] * TST: Rework to have a build_meson [f2py] * MAINT,TST: Simplify the meson backend [f2py] * TST: Use the build_meson function [f2py] * MAINT,TST: Minor cleanup [f2py] * TST: Ensure TestDocAdvanced runs with spin [f2py] * TST: Use cleanup meson backend [f2py] * MAINT,TST: Generalize build_meson [f2py] * TST: Use a helper for spin tests [f2py] * MAINT: Simplify meson backend [f2py] * TST: Handle unsupported compilers [f2py] * TST: Fix gibberish in [f2py] documentation test * CI: Add meson for cygwin runs * TST: Skips for 32-bit errors [f2py] * TST: Skip for cygwin since meson is old [f2py] * CI: Revert grabbing meson on cygwin The version is too old to be of use * TST: Cleanup old distutils builder [f2py] * TST: Skip cygwin better [f2py] * TST: Don't touch distutils * MAINT: Vendor in distutils testing requirement * TST: Try removing cygwin restrictions * MAINT: Cleanup some tests [f2py] * TST: Try to use concurrency for i/o bounds [f2py] * TST: Mark slow tests [f2py] Should finish in around a minute now
meson
for testing f2py
meson
for testing f2py
* MAINT,TST: Use meson for compiler checks [f2py] * MAINT: Cache the compiler checks [f2py] * MAINT,TST: Always use meson [f2py] * TST: Rework to have a build_meson [f2py] * MAINT,TST: Simplify the meson backend [f2py] * TST: Use the build_meson function [f2py] * MAINT,TST: Minor cleanup [f2py] * TST: Ensure TestDocAdvanced runs with spin [f2py] * TST: Use cleanup meson backend [f2py] * MAINT,TST: Generalize build_meson [f2py] * TST: Use a helper for spin tests [f2py] * MAINT: Simplify meson backend [f2py] * TST: Handle unsupported compilers [f2py] * TST: Fix gibberish in [f2py] documentation test * CI: Add meson for cygwin runs * TST: Skips for 32-bit errors [f2py] * TST: Skip for cygwin since meson is old [f2py] * CI: Revert grabbing meson on cygwin The version is too old to be of use * TST: Cleanup old distutils builder [f2py] * TST: Skip cygwin better [f2py] * TST: Don't touch distutils * MAINT: Vendor in distutils testing requirement * TST: Try removing cygwin restrictions * MAINT: Cleanup some tests [f2py] * TST: Try to use concurrency for i/o bounds [f2py] * TST: Mark slow tests [f2py] Should finish in around a minute now
* MAINT,TST: Use meson for compiler checks [f2py] * MAINT: Cache the compiler checks [f2py] * MAINT,TST: Always use meson [f2py] * TST: Rework to have a build_meson [f2py] * MAINT,TST: Simplify the meson backend [f2py] * TST: Use the build_meson function [f2py] * MAINT,TST: Minor cleanup [f2py] * TST: Ensure TestDocAdvanced runs with spin [f2py] * TST: Use cleanup meson backend [f2py] * MAINT,TST: Generalize build_meson [f2py] * TST: Use a helper for spin tests [f2py] * MAINT: Simplify meson backend [f2py] * TST: Handle unsupported compilers [f2py] * TST: Fix gibberish in [f2py] documentation test * CI: Add meson for cygwin runs * TST: Skips for 32-bit errors [f2py] * TST: Skip for cygwin since meson is old [f2py] * CI: Revert grabbing meson on cygwin The version is too old to be of use * TST: Cleanup old distutils builder [f2py] * TST: Skip cygwin better [f2py] * TST: Don't touch distutils * MAINT: Vendor in distutils testing requirement * TST: Try removing cygwin restrictions * MAINT: Cleanup some tests [f2py] * TST: Try to use concurrency for i/o bounds [f2py] * TST: Mark slow tests [f2py] Should finish in around a minute now
Do not merge before #25073 and #25181.
Closes #25109.
Essentially:
meson
backendmeson
(blocked by the.pyf
+-m
interaction currently)WindowsSee CI, TST: have a f2py-specific CI run and properly skip f2py tests elsewhere #25134Also reworked
test_docs
to run withspin
.Additionally (features added):
compile()
call will now use themeson
backend as wellNote: It is now the users' responsibility to ensure a compatible toolchain is present. However, this does mean that on the CI there are more failure modes e.g. without
distutils
it is hard to figure out if the CI hasmsvc
or not, so conditional skipping is harder than it used to be. Conversely, GFortran and MSVC simply do not mix in themeson
world-view. So, there is a catch-all skip for those. However, the tests are run fully on the CI as well, just not all flavors, e.g. FreeBSD fails thefortran
compiler check, some of the Windows CI variants only findcl
by default.Note II: It is worth remembering that most (compiled) Windows tests were skipped even under
distutils
since 2017 due to #9673, perhaps with the notable exception of the (non-Fortran)test_array_from_pyobj
. This is more of a status quo PR, to ensure F2PY is tested beyond its parser on Linux and MacOS (and to whatever extent Windows was tested before as well).