Skip to content
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

Drop unused dependencies cached_property and importlib_resources #361

Closed
Zac-HD opened this issue Jun 20, 2023 · 3 comments
Closed

Drop unused dependencies cached_property and importlib_resources #361

Zac-HD opened this issue Jun 20, 2023 · 3 comments

Comments

@Zac-HD
Copy link

Zac-HD commented Jun 20, 2023

I recently noticed that orbax-checkpoint depends on the cached-property package and importlib-resources backport, and wanted to suggest using the standard library instead (respectively @functools.cached_property in Python 3.8+ and the importlib.resources module in Python 3.7+; and note that Python 3.7 is end-of-life next week).

But then when I did a quick search to check how much work this would be... it looks like orbax-checkpoint literally doesn't use these packages at all. So dropping them should be quite trivial, and allow for somewhat smaller virtual environments 😁

@cpgaffney1
Copy link
Collaborator

Thanks for pointing this out! importlib_resources is needed by our etils import - for some reason it doesn't get included automatically. The cached_property dependency does seem unneeded though.

@Zac-HD
Copy link
Author

Zac-HD commented Jun 21, 2023

Looking at https://github.com/google/etils/blob/4a042b574ddcb6be0e0787539962f874535fb508/pyproject.toml, etils only has optional dependencies, so orbax-checkpoint should depend on etils[epath,epy] rather than plain etils + importlib_resources.

That way we'll automatically stop depending on the backport when etils drops it or makes it version-specific 🙂

@cpgaffney1
Copy link
Collaborator

Ah ok thanks, that works! Sending a change now.

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

No branches or pull requests

2 participants