Skip to content

infra: add griffe to public-symbols check CI #4633

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

emdneto
Copy link
Member

@emdneto emdneto commented Jun 12, 2025

Close #4619

@emdneto emdneto requested a review from a team as a code owner June 12, 2025 00:12
@emdneto emdneto added build & infra Issues related to build & infrastructure. Skip Changelog PRs that do not require a CHANGELOG.md entry labels Jun 12, 2025
commands =
; griffe check before to fail fast if there are any issues
{toxinidir}/scripts/griffe_check.sh
python {toxinidir}/scripts/public_symbols_checker.py
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this catch anything than griffe won't?

Copy link
Member Author

@emdneto emdneto Jun 12, 2025

Choose a reason for hiding this comment

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

I don't know, to be honest. I left it here to keep what we have now 😅

Copy link
Contributor

@xrmx xrmx Jun 12, 2025

Choose a reason for hiding this comment

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

Yeah, we can run both for a release and then drop the custom one if it doesn't raise anything.

Copy link
Member Author

Choose a reason for hiding this comment

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

@xrmx I think the main difference is that the public_symbols_checker.py script will check for additions. Griffe will be checking for removed/moved symbols

Copy link
Member

Choose a reason for hiding this comment

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

I think griffe check misses a few other important cases we have related to modifying base classes

Copy link
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

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

Approving because we can always roll back. I don't want to bikeshed on the bash script because I think we will eventually need to write a python script possibly using the lower level API to configure skipping certain rules and package patterns

local package_name
local search_path=""

if [[ "$package_spec" == *"/"* ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

sorry my bash isn't that great. when tox calls with no arguments, will it check all directories? This might get annoying for test directories.

Copy link
Member Author

@emdneto emdneto Jun 12, 2025

Choose a reason for hiding this comment

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

Yes, tests will also be checked 😓. I agree it will be annoying. Let me see if we can exclude them.

Copy link
Member Author

@emdneto emdneto Jun 12, 2025

Choose a reason for hiding this comment

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

thanks for the approval, but I'll put it in draft to write the check using griffe Python API. It will be easier to maintain.

@emdneto emdneto marked this pull request as draft June 12, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build & infra Issues related to build & infrastructure. Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Griffe in CI to detect breaking changes
3 participants