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

add support for Python3.12 #221

Merged
merged 10 commits into from
Jan 15, 2025
Merged

add support for Python3.12 #221

merged 10 commits into from
Jan 15, 2025

Conversation

stefansjs
Copy link
Contributor

Adds support for python 3.12 by upgrading pytest to v8 and by pulling in changes that fix deprecated uses of pkg_resources.

This should unblock #217

pytest 4.* is incompatible with python 3.12 because of importlib
There's 2 reasons for this change:
1) pytest has deprecated xfail on parametrize'd values
2) xfail means that a test is _allowed_ to fail, whereas pytest.raises
   means that a test _passes_ when the exception is raised. Throwing an
   exception is not the same thing as failing a test.
@stefansjs
Copy link
Contributor Author

This is a huge text change, but the short version is that xfail is both unsupported in decorators, and doesn't mean what we were using it to mean.

There is still a problem with jams.sonify, which I feel confident was not caused by these changes. I haven't attempted to fix them because they may imply a bigger problem with dependencies, and we should pin dependency versions correctly if that's the case. It seems as if some tests are expecting a different return type and test comparisons are failing.

I hope somebody with more knowledge of the codebase than me can take a look and see if we need to pin a dependency version.

@stefansjs
Copy link
Contributor Author

Here's an example of the failures I'm still seeing https://github.com/stefansjs/jams/actions/runs/12251723660/job/34176899089#step:5:2797

=========================== short test summary info ============================
FAILED tests/test_sonify.py::test_duration[None-8000-chord] - TypeError: object of type 'numpy.float64' has no len()
FAILED tests/test_sonify.py::test_duration[None-11025-chord] - TypeError: object of type 'numpy.float64' has no len()
FAILED tests/test_sonify.py::test_duration[5.0-8000-chord] - TypeError: object of type 'numpy.float64' has no len()
FAILED tests/test_sonify.py::test_duration[5.0-11025-chord] - TypeError: object of type 'numpy.float64' has no len()
FAILED tests/test_sonify.py::test_duration[1.0-8000-chord] - TypeError: object of type 'numpy.float64' has no len()
FAILED tests/test_sonify.py::test_duration[1.0-11025-chord] - TypeError: object of type 'numpy.float64' has no len()
FAILED tests/test_sonify.py::test_note_hz - TypeError: object of type 'numpy.float64' has no len()
FAILED tests/test_sonify.py::test_note_hz_nolength - TypeError: object of type 'numpy.float64' has no len()
FAILED tests/test_sonify.py::test_note_midi - TypeError: object of type 'numpy.float64' has no len()
FAILED tests/test_sonify.py::test_chord[C:maj/5-2.0-8000-chord] - TypeError: object of type 'numpy.float64' has no len()
FAILED tests/test_sonify.py::test_chord[C:maj/5-2.0-8000-chord_harte] - TypeError: object of type 'numpy.float64' has no len()
================ 11 failed, 686 passed, 1815 warnings in 8.44s =================

@bmcfee
Copy link
Contributor

bmcfee commented Jan 15, 2025

Thanks so much @stefansjs !

I've run this locally and can confirm the sonification failures. These need to be fixed upstream, so not much we can do here for now. I'm happy to merge this now so we can get CI back on its feet and then make some progress.

@bmcfee bmcfee merged commit 58a24d5 into marl:master Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants