6 Commits

Author SHA1 Message Date
Neil Girdhar
52ab8c4cc2 Fix detection of epath
Unfortunately, the old detection code doesn't guarantee that `epath` is
installed:
```
[utM] In [7]: importlib.util.find_spec("etils.epath")
Out[7]: ModuleSpec(name='etils.epath',
loader=<_frozen_importlib_external.SourceFileLoader object at
0x73b8492a7230>,
origin='/home/neil/src/cmm/.venv/lib/python3.12/site-packages/etils/epath/__init__.py',
submodule_search_locations=['/home/neil/src/cmm/.venv/lib/python3.12/site-packages/etils/epath'])

[utM] In [8]: import etils.epath
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent
call last)
Cell In[8], line 1
----> 1 import etils.epath
...
ModuleNotFoundError: No module named 'importlib_resources'
```
This happened every time I ran jax with a clean environment.
2025-03-04 11:44:27 -05:00
Sergei Lebedev
28dfe0d280 Import etils.epath lazily
This shaves off an extra 0.1-0.2s from JAX import times internally.

PiperOrigin-RevId: 662660356
2024-08-13 14:48:38 -07:00
Ayaka
6c05aa2f32 Clean up 2024-07-04 17:16:32 +04:00
jax authors
6963c77044 Reverts f18739900c615a85e8d182bcf3217f704cf7aa0d
PiperOrigin-RevId: 625541309
2024-04-16 20:28:24 -07:00
Peter Hawkins
f18739900c Import etils.epath lazily.
Reduces jax import time.

PiperOrigin-RevId: 625452204
2024-04-16 14:23:05 -07:00
Peter Hawkins
91ea57d981 Make the etils[epath] dependency of JAX optional.
If epath is installed then we will use it for file I/O. If it is not, we
will fall back to pathlib from the standard library.
2022-10-12 21:16:48 +00:00