-
Notifications
You must be signed in to change notification settings - Fork 14
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
[minor] remove ImportAlarm and deprecator stuff from the API #1458
Conversation
With a helpful error message if you actually try to use any of them
for more information, see https://pre-commit.ci
The failures are just the linters complaining about the unused imports -- but they're not unused, they're making sure the stuff we're redirecting people to via a string is actually where we think it is. |
Please fix the complains from |
The failures from ruff are exactly what I described above -- ruff complains that the imports are unused, but I, as a human and not a bot, know that they are not unused but rather guaranteeing that what I say in my string is valid. I'm open to an alternative formulation that uses the import in an automated way to generate the string, but, as I also mentioned (in a commit message?) I couldn't figure this out because 'deprecate' is actually just an instance of 'deprecator' and doesn't have that name associated with it in any way, it's just a variable name not an attribute property. |
|
A linter added a comma and pushed us over the edge
Because the snippets have associated code and ruff wants all the imports first
Quoted from #1455 (comment)
|
But it's "draft" only in the sense that it should not be merged into main -- or at least main should not be released with this PR merged so safest not to merge it -- it is nonetheless ready for review. |
I would consider An alternative pattern I've used before is this, but I don't think it's necessary here. Defining the objects/functions, but letting them raise exceptions at run time is the worst of both worlds imo, because it fails late. |
@pmrv this PR is also my least favourite route; the pattern you linked is definitely nicer than what I pushed here. My top choice would also be to simply remove them and bump the version sufficiently. The only thing I'd push back on in your comment is that |
That would also be my preferred choice. |
Closed in favour of #1466, which just cleanly breaks compatibility by removing these from the API. |
With a helpful error message if you actually try to use any of them.
This follows up on @jan-janssen's comment, following the path of leaving the objects importable, but raising an error redirecting the user to the new location if they try to use it.
I did my best to ensure that our redirection message will stay consistent with any upstream changes in
pyiron_snippets
.In order to seamlessly keep our downstream repositories working, it would be good to merge the following PRs to use
pyiron_snippets
before releasing these changes onpyiron_base
:For import alarm:
For deprecator stuff: