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

Modern packaging + ruff + numpy 2 compat #187

Merged
merged 20 commits into from
Dec 28, 2024
Merged

Modern packaging + ruff + numpy 2 compat #187

merged 20 commits into from
Dec 28, 2024

Conversation

raphaelvallat
Copy link
Owner

@raphaelvallat raphaelvallat commented Dec 20, 2024

This PR implements the following changes:

  • Switch to modern packaging: everything is defined in the pyproject.toml. Source files are moved to the src/yasa/ folder, while tests are now in the tests folder at the root directory
  • Switch to using Ruff instead of Black + Flake8
  • Ensure compatibility with numpy >2.x

@remrama
Copy link
Collaborator

remrama commented Dec 20, 2024

Sweet! Thanks @raphaelvallat, I was planning to include this in next release as well. I'll check it on my end in the next hour with a review.

@remrama remrama self-requested a review December 20, 2024 15:33
Copy link
Collaborator

@remrama remrama left a comment

Choose a reason for hiding this comment

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

@raphaelvallat sorry I know this is still WIP and you didn't request this, but I just glossed it over and here are small/quick things to add. All comments are trivially addressable and probably would've come up anyways during your checks so I hope they speed things up for you.

As far as Ruff formatting goes I think it will only end up changing 3 files when you run it. Currently the workflow breaks but it should pass once you run the formatter.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
.github/workflows/python_tests.yml Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.

Project coverage is 77.24%. Comparing base (6e6a067) to head (5f3ce07).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/yasa/evaluation.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #187      +/-   ##
==========================================
- Coverage   83.93%   77.24%   -6.69%     
==========================================
  Files          24       13      -11     
  Lines        3536     2659     -877     
  Branches        0      324     +324     
==========================================
- Hits         2968     2054     -914     
  Misses        568      568              
- Partials        0       37      +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@raphaelvallat
Copy link
Owner Author

Note that there's a CI failure on Python 3.12 because of a depreceated import of pkg_resources in the lspopt dependency

https://github.com/hbldh/lspopt/blob/6867aa95e9ced721defc07027e8231973ecb4f26/lspopt/data/__init__.py#L11

See mu-editor/mu#2485

src/yasa/detection.py Outdated Show resolved Hide resolved
src/yasa/evaluation.py Outdated Show resolved Hide resolved
@raphaelvallat
Copy link
Owner Author

Ready for review @remrama ! There's one CI failure because of coverage that I think we can ignore

@raphaelvallat raphaelvallat self-assigned this Dec 21, 2024
@raphaelvallat raphaelvallat changed the title [WIP] Modern packaging + ruff (NPY201) Modern packaging + ruff (NPY201) Dec 21, 2024
@raphaelvallat raphaelvallat changed the title Modern packaging + ruff (NPY201) Modern packaging + ruff + numpy 2 compat Dec 21, 2024
Copy link
Collaborator

@remrama remrama left a comment

Choose a reason for hiding this comment

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

Looks great @raphaelvallat! Thanks a lot for doing this, I think it makes it easier to work on subsequent PRs.

.github/workflows/python_tests.yml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
push_pypi.md Outdated Show resolved Hide resolved
@raphaelvallat
Copy link
Owner Author

PR ready to be merged as soon as #127 is merged!

@raphaelvallat raphaelvallat linked an issue Dec 22, 2024 that may be closed by this pull request
@remrama remrama self-requested a review December 27, 2024 23:03
* Including manual conflict resolution on [test_]staging.py
@remrama remrama merged commit 4dcd72d into master Dec 28, 2024
14 checks passed
@remrama remrama deleted the modern_packaging branch December 28, 2024 01:53
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.

Switch to modern python packaging
3 participants