GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — TST: Use ``meson`` for testing ``f2py`` by HaoZeke · Pull Request #25111 · numpy/numpy

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 11, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Do not merge before #25073 and #25181.


Closes #25109.

Essentially:

  • Switch tests to the meson backend
  • Detect compilers correctly for tests via meson
  • Run full testsuite (blocked by the .pyf + -m interaction currently)
    • Linux
    • MacOS
    • Windows See CI, TST: have a f2py-specific CI run and properly skip f2py tests elsewhere #25134

Also reworked test_docs to run with spin.

image

Additionally (features added):

  • The compile() call will now use the meson backend as well
    • Ideally I'd like this command to go away completely..

Note: 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 has msvc or not, so conditional skipping is harder than it used to be. Conversely, GFortran and MSVC simply do not mix in the meson 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 the fortran compiler check, some of the Windows CI variants only find cl 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).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@HaoZeke HaoZeke added 05 - Testing component: numpy.f2py component: CI Meson Items related to the introduction of Meson as the new build system for NumPy labels Nov 11, 2023
@HaoZeke HaoZeke mentioned this pull request Nov 11, 2023
BUG: Disallow shadowed modulenames #25114
Closed
@HaoZeke
HaoZeke force-pushed the testf2py312 branch from e56227f to 2afaf25 Compare November 11, 2023 23:42
HaoZeke
HaoZeke commented Nov 11, 2023
View reviewed changes
Comment thread numpy/f2py/f2py2e.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@HaoZeke HaoZeke mentioned this pull request Nov 11, 2023
TST: Windows f2py tests hang indefinitely with msys gcc-fortran on PATH #9342
Open
@HaoZeke
HaoZeke force-pushed the testf2py312 branch 2 times, most recently from 508490a to ac6cc34 Compare November 12, 2023 01:28
@charris charris changed the title TST: Use meson for testing f2py TST: Use meson for testing f2py Nov 12, 2023
@HaoZeke HaoZeke mentioned this pull request Nov 12, 2023
BLD,BUG: quadmath required where available [f2py] #25073
Merged
@HaoZeke
HaoZeke force-pushed the testf2py312 branch from 8b79255 to 2ad6a26 Compare November 12, 2023 04:39
This was referenced Nov 12, 2023
RFC: Getting rid of numpy.f2py.compile() #25122
Closed
DOC: f2py CLI documentation enhancements #25124
Merged
@HaoZeke
HaoZeke force-pushed the testf2py312 branch from 2ad6a26 to bab8809 Compare November 13, 2023 14:57
@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Nov 13, 2023
@mattip

mattip commented Nov 15, 2023

Copy link
Copy Markdown
Member

Could we do the merging the other way around: get this PR to work first and then revisit #25114?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Nov 18, 2023
MAINT,BUG: Never import distutils above 3.12 [f2py] #25123
Merged
BUG: Disallow shadowed modulenames #25181
Merged
@HaoZeke
HaoZeke force-pushed the testf2py312 branch from bab8809 to ad469a4 Compare November 19, 2023 03:03
@HaoZeke

HaoZeke commented Nov 19, 2023

Copy link
Copy Markdown
Member Author

Could we do the merging the other way around: get this PR to work first and then revisit #25114?

Unfortunately not, see #25181 (comment)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@HaoZeke
HaoZeke force-pushed the testf2py312 branch from ad469a4 to 7f01e49 Compare November 19, 2023 05:58
@HaoZeke
HaoZeke marked this pull request as ready for review November 19, 2023 05:59
mattip
mattip reviewed Nov 19, 2023
View reviewed changes

@mattip mattip left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread numpy/distutils/tests/test_build_ext.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread numpy/f2py/__init__.py Outdated

args = ['-c', '-m', modulename, f.name]
args = ['-c', '--backend', 'meson', '-m',
modulename, f.name]

@mattip mattip Nov 19, 2023

Copy link
Copy Markdown
Member

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@HaoZeke HaoZeke Nov 19, 2023

Copy link
Copy Markdown
Member Author

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@HaoZeke HaoZeke Nov 19, 2023

Copy link
Copy Markdown
Member Author

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rgommers reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@HaoZeke
HaoZeke force-pushed the testf2py312 branch 2 times, most recently from c411a21 to 687d8ce Compare November 19, 2023 23:20
@HaoZeke
HaoZeke requested a review from mattip November 20, 2023 00:07
@charris charris mentioned this pull request Nov 20, 2023
BUG: Disallow shadowed modulenames #25205
Merged
@charris

charris commented Nov 21, 2023

Copy link
Copy Markdown
Member

Please squash this when it gets merged.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

HaoZeke added 7 commits November 23, 2023 18:18
@HaoZeke
TST: Skip for cygwin since meson is old [f2py]
6cdecd0
@HaoZeke
CI: Revert grabbing meson on cygwin
dd6f221
The version is too old to be of use
@HaoZeke
TST: Cleanup old distutils builder [f2py]
ef17ab5
@HaoZeke
TST: Skip cygwin better [f2py]
8d7ec08
@HaoZeke
TST: Don't touch distutils
b0f418e
@HaoZeke
MAINT: Vendor in distutils testing requirement
5bce3b4
@HaoZeke
TST: Try removing cygwin restrictions
9fc2006
@HaoZeke
HaoZeke force-pushed the testf2py312 branch from cb92252 to 9fc2006 Compare November 23, 2023 18:18
@rgommers

rgommers commented Nov 23, 2023

Copy link
Copy Markdown
Member

@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.

HaoZeke reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@HaoZeke HaoZeke mentioned this pull request Nov 23, 2023
TST: Use fixtures for f2py tests #25239
Open
HaoZeke added 3 commits November 23, 2023 21:47
@HaoZeke
MAINT: Cleanup some tests [f2py]
2ac2902
@HaoZeke
TST: Try to use concurrency for i/o bounds [f2py]
63cbffb
@HaoZeke
TST: Mark slow tests [f2py]
64f4fd2
Should finish in around a minute now
@HaoZeke
HaoZeke force-pushed the testf2py312 branch from f4d92cd to 64f4fd2 Compare November 23, 2023 22:15
@HaoZeke

HaoZeke commented Nov 23, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

The tests (after annotating with slow) will finish in less than a minute now, further speed up needs #25239, so perhaps this is ready for now @rgommers :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@HaoZeke
HaoZeke requested a review from rgommers November 23, 2023 23:28
rgommers
rgommers approved these changes Nov 24, 2023
View reviewed changes

@rgommers rgommers left a comment

Copy link
Copy Markdown
Member

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!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

HaoZeke reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@rgommers
rgommers merged commit 8ac314f into numpy:main Nov 24, 2023
@HaoZeke
HaoZeke deleted the testf2py312 branch November 24, 2023 13:39
stefanor added a commit to stefanor/numpy that referenced this pull request Dec 6, 2023
@stefanor
Restore missing asstr import
cd29a90
The user of this import was removed in the cleanup in numpy#25111, post-2.26.
@stefanor stefanor mentioned this pull request Dec 6, 2023
BUG: Restore missing asstr import #25323
Merged
charris pushed a commit to charris/numpy that referenced this pull request Dec 19, 2023
@HaoZeke @charris
TST: Use meson for testing f2py (numpy#25111)
a5e0eb0
* 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
@charris charris changed the title TST: Use meson for testing f2py TST: Use meson for testing f2py Dec 19, 2023
@charris charris mentioned this pull request Dec 19, 2023
TST: Use meson for testing f2py #25427
Closed
7 tasks done
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Dec 19, 2023
charris pushed a commit to charris/numpy that referenced this pull request Dec 23, 2023
@HaoZeke @charris
TST: Use meson for testing f2py (numpy#25111)
774e0a8
* 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
charris pushed a commit to charris/numpy that referenced this pull request Dec 24, 2023
@HaoZeke @charris
TST: Use meson for testing f2py (numpy#25111)
bc31f0a
* 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
@HaoZeke
HaoZeke restored the testf2py312 branch June 15, 2024 23:40
@mattip mattip mentioned this pull request Dec 9, 2024
Latest release of vulture (Dec 8) finds error in numpy/f2py/tests/util.py #27941
Closed
@DWesl DWesl mentioned this pull request Jul 14, 2026
ENH: Add parsing for ISO_FORTRAN_ENV to F2Py. #28574
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rgommers rgommers rgommers approved these changes
@mattip mattip Awaiting requested review from mattip

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

05 - Testing component: CI component: numpy.f2py Meson Items related to the introduction of Meson as the new build system for NumPy

Projects

None yet

Milestone

2.0.0 release

Development

Successfully merging this pull request may close these issues.

TST: Run f2py compilation tests on 3.12

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@HaoZeke @mattip @charris @rgommers
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.