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 and CI modernization #370

Merged
merged 80 commits into from
Mar 25, 2024
Merged

Test and CI modernization #370

merged 80 commits into from
Mar 25, 2024

Conversation

bmcfee
Copy link
Collaborator

@bmcfee bmcfee commented Mar 13, 2024

This PR will implement a slew of updates to bring us into 2024:

  • Complete overhaul of tests to remove legacy nosetest dependencies
  • Update around upstream deprecations in numpy / scipy
  • Modernize packaging / metadata (setup.py, setup.cfg)
  • Update test environments and actions

My goal here isn't necessarily to improve any functionality. However, it's possible that the updates above in the test suite may uncover failures that need addressing.


fixes #269
fixes #331
fixes #352

@bmcfee bmcfee added the testing label Mar 13, 2024
@bmcfee
Copy link
Collaborator Author

bmcfee commented Mar 15, 2024

Note: conda env caching in CI is enabled using the bz2 requirement. This is going to create problems down the line as fewer packages are being distributed in bz2 format now (in favor of .conda). This is a known issue of the setup-miniconda action, but does not yet appear to be resolved.

@bmcfee
Copy link
Collaborator Author

bmcfee commented Mar 22, 2024

It looks like our minimum test environment is proving difficult to solve. I suspect this is because of the hard pin to scipy 1.0.0.

@craffel what do you think about bumping this to 1.2.0 to be contemporaneous with the new minimum numpy (1.14)? I expect in 2024 nobody will gripe about having to upgrade from scipy 1.0 to 1.2. If we bump to 1.4 instead, it might afford us the opportunity to update some of the bsseval code to use scipy.fft instead of the older fftpack API. (I'll leave that as a separate, totally optional issue.)

(EDIT: had my versions wrong)

@craffel
Copy link
Collaborator

craffel commented Mar 22, 2024

It looks like our minimum test environment is proving difficult to solve. I suspect this is because of the hard pin to scipy 1.0.0.

@craffel what do you think about bumping this to 1.2.0 to be contemporaneous with the new minimum numpy (1.14)? I expect in 2024 nobody will gripe about having to upgrade from scipy 1.0 to 1.2. If we bump to 1.4 instead, it might afford us the opportunity to update some of the bsseval code to use scipy.fft instead of the older fftpack API. (I'll leave that as a separate, totally optional issue.)

(EDIT: had my versions wrong)

Seems totally fine to me.

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@bmcfee
Copy link
Collaborator Author

bmcfee commented Mar 22, 2024

Ugh. I had to bump numpy to 1.15.4 (nov 2018) and matplotlib 3.3.0 (jul 2020) to get the minimal env working consistently, but I think this is fine. We were already bumping numpy to 1.14, and I doubt anyone will be left out by going to 15 instead of 14.

@bmcfee
Copy link
Collaborator Author

bmcfee commented Mar 22, 2024

Alright, we're all green finally. I think this should be good to merge.

Test coverage is generally good, excepting the cases that I explicitly skipped out.

We won't have codecov action status here until things merge into the main branch, but you can check it here: https://app.codecov.io/gh/craffel/mir_eval/tree/bmcfee%2Fmir_eval%3Amodernization/mir_eval

Alignment has some spotty coverage that could be improved with more defensive tests, but I think that's out of scope for this PR (which is already monstrous).


In terms of changes to the main code base, it's primarily spelling corrections, docstring corrections (eg wrong variable names caught by velin), and formatting via black.

The tests/ folder has been basically rewritten, but the core logic of the tests is essentially unchanged.

Everything else has to do with package metadata and github workflow configuration.

@bmcfee
Copy link
Collaborator Author

bmcfee commented Mar 23, 2024

Any objection to merging?

Copy link
Collaborator

@craffel craffel left a comment

Choose a reason for hiding this comment

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

Some minor questions - I skipped reviewing the library changes because I'm assuming they are all from black (perhaps in retrospect we should have had a separate PR which was just the result of running black, and then have this PR for introducing the modernization, but oh well).

environment-file: ${{ matrix.envfile }}
# Disabling bz2 to get more recent dependencies.
# NOTE: this breaks cache support, so CI will be slower.
use-only-tar-bz2: False # IMPORTANT: This needs to be set for caching to work properly!
Copy link
Collaborator

Choose a reason for hiding this comment

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

Important for this to be set, but it's not set... I think we can remove this comment given your above comments.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The comment comes from the starter code for the action. I think it's serving a useful purpose here to indicate that caching does not currently work, and it cannot until the setup-miniconda action gets fixed upstream. I'd prefer to leave it in as a provenance trail for why the flag is set the way it is.

@@ -60,7 +70,22 @@ jobs:
shell: bash -l {0}
run: python -c "import numpy; numpy.show_config()"

- name: Show libraries in the system on which SciPy was built
shell: bash -l {0}
run: python -c "import scipy; scipy.show_config()"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this something you were using for debugging, or do we want it always?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's good to include. Scipy configs can change out from under us as dependencies update, and these things have historically caused us trouble (eg transcription velocity recently, bsseval a few years back).

name = mir_eval
version = attr: mir_eval.__version__
description = Common metrics for common audio/music processing tasks.
author = Colin Raffel
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we just change this to "mir_eval developers" now or something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure. Should also update in the sphinx configs, but it's your copyright there so I'll leave it to you to propose a change here. 😁

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

... we can also deal with that as a separate PR when we update for the migration to an mir_eval org.

@bmcfee
Copy link
Collaborator Author

bmcfee commented Mar 25, 2024

perhaps in retrospect we should have had a separate PR which was just the result of running black, and then have this PR for introducing the modernization, but oh well)

Yeah, though I did want to add linting / spellchecking / doc checking as CI actions here, which weren't going to pass until we did this anyway. But yes, I can confirm there are no functional changes to the library code.

@craffel
Copy link
Collaborator

craffel commented Mar 25, 2024

Cool, LGTM!

@craffel craffel merged commit 7997fdf into mir-evaluation:main Mar 25, 2024
8 checks passed
@craffel
Copy link
Collaborator

craffel commented Mar 25, 2024

... and thank you for this monumental effort.

@bmcfee bmcfee deleted the modernization branch March 25, 2024 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update numpy dependency py-test test not working in version 0.6 Migrate to pytest
4 participants