-
Notifications
You must be signed in to change notification settings - Fork 590
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
Update constants imports with module level access #1172 #2469
Update constants imports with module level access #1172 #2469
Conversation
Hey @Wauplin, the required changes were done in this PR. Though for Because:
|
Hi @WizKnight, thanks for the details. I just pushed 603d6d8 that should fix it in a more future-proof way:
It is not a problem to update the tests like this when it's only to modify something in the test tooling (i.e. we are not changing an actual test behavior). So now let's wait for the CI to get green and we should be good to merge :) |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
tests/test_hf_api.py
Outdated
REPO_TYPE_DATASET, # noqa: F401 # kept for backward compatibility | ||
REPO_TYPE_MODEL, # noqa: F401 # kept for backward compatibility | ||
REPO_TYPE_SPACE, # noqa: F401 # kept for backward compatibility | ||
SPACES_SDK_TYPES, # noqa: F401 # kept for backward compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to keep backward compatibility in tests since tests are never imported from another library
And... merged! Thanks @WizKnight for the work and sorry again for the back and forth! Next PRs should be easier now :) |
It's alright, I got to learn a lot. Thanks for this opportunity @Wauplin :) So, should I open a new PR and update all the instances of constants throughout the repository or Would you like to assign me another task?? |
Now that you've already worked on this task, I think that yes it makes sense for you to update all the instances of constants throughout the codebase. Thanks! |
Alright then, I'm on it!! |
This PR addresses issue #1172 by updating how constants are imported and used in the Hugging Face Hub codebase. It introduces module-level imports for better organization while maintaining backward compatibility.
Key changes:
from . import constants
for improved code organization and maintainability.# noqa: F401
comments for backward compatibility.