Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bluenote10
Copy link
Contributor

@bluenote10 bluenote10 commented Jan 18, 2025

I noticed that the ruff version was a bit outdated, and that there where quite a lot of spurious/dead # noqa lingering around.

This PR bumps ruff to the latest version, which has lead to a minor re-formatting of some code (mainly around fusing string literals).

I've also enabled a few ruff rules that have helped me to identify dead or malformed (# noqa <code> instead of the needed # noqa: <code> patter) noqa rules.

Regarding F401: Here we should stick to the library interface conventions from the official specs. Otherwise type checkers will not understand the symbols exported in these modules, which is a frequent paint point on user side, when libraries suppress F401. There are basically two options:

  • Maintaining an __all__ list manually.
  • Using the X as X pattern to mark these symbols as explicitly public (and to differentiate them from actual unused imports).

I felt that the latter fits better to how Aim maintains its library interface.

My plan is to fully fix all F401 in a follow-up, because the broken library interface is biting us.

@bluenote10
Copy link
Contributor Author

Would it be possible to move forward with this? Is there anything I can do to help speeding things up / simplifying the review?

Copy link
Contributor

@mihran113 mihran113 left a comment

Choose a reason for hiding this comment

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

Hey @bluenote10!
Thanks for opening the PR and sorry for delayed response.
Thanks for the detailed description for the PR as well, the second option with using X as X pattern is definitely much more preferred.
Everything looks great, I've just left a comment with regards to the conflicts with main branch. I'll run the PR checks after the branch is up to date with main.

@bluenote10
Copy link
Contributor Author

Everything looks great, I've just left a comment with regards to the conflicts with main branch. I'll run the PR checks after the branch is up to date with main.

@mihran113 Perfect, I've quickly resolved the tiny conflict, so this should be mergable again.

@mihran113
Copy link
Contributor

Thanks a lot for the changes @bluenote10! I'm going to merge the PR, there's a failure in unit-tests, but that's not related to your changes, I'm going to fix it separately.

@mihran113 mihran113 merged commit 1766020 into aimhubio:main Feb 13, 2025
2 of 3 checks passed
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