Skip to content

Conversation

@mistydemeo
Copy link
Contributor

This was flagged by ruff check - if we just want to find out if a package is available, and don't need to actually import it, we can use importlib.util.find_spec() to resolve it. This can lead to a moderate speedup too, since the import might be slow.

@mistydemeo mistydemeo force-pushed the misty/remove_unnecessary_imports branch 3 times, most recently from 267e005 to 7bed37b Compare July 18, 2025 21:26
@mistydemeo
Copy link
Contributor Author

Caught one more, so pushed that one too. The F401 checks after that ruff missing that the imports are being added to __all__.

This was flagged by ruff check - if we just want to find out if a
package is available, and don't need to actually import it, we can
use importlib.util.find_spec() to resolve it. This can lead to a
moderate speedup too, since the import might be slow.
@mistydemeo mistydemeo force-pushed the misty/remove_unnecessary_imports branch from 7bed37b to 1b19cdb Compare July 18, 2025 22:04
@mistydemeo mistydemeo merged commit 0f0ae4f into internetarchive:master Jul 18, 2025
5 checks passed
@mistydemeo mistydemeo deleted the misty/remove_unnecessary_imports branch July 23, 2025 18:19
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