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

Nested lib_path values break module -> notebook sync #1393

Open
scwe opened this issue Dec 29, 2023 · 0 comments
Open

Nested lib_path values break module -> notebook sync #1393

scwe opened this issue Dec 29, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@scwe
Copy link

scwe commented Dec 29, 2023

When running nbdev_update on a project that uses a nested lib_path setting (i.e. path/to/file) the update will fail

Minimal reproduceable example is available here. The exact error I get here is

Traceback (most recent call last):
  File "/home/scott/.local/bin/nbdev_update", line 8, in <module>
    sys.exit(nbdev_update())
  File "/home/scott/.local/lib/python3.10/site-packages/fastcore/script.py", line 119, in _f
    return tfunc(**merge(args, args_from_prog(func, xtra)))
  File "/home/scott/.local/lib/python3.10/site-packages/nbdev/sync.py", line 79, in nbdev_update
    files = files.filter(lambda x: str(Path(x).absolute().relative_to(lib_dir) in _mod_files()))
  File "/home/scott/.local/lib/python3.10/site-packages/fastcore/foundation.py", line 162, in filter
    return self._new(filter_ex(self, f=f, negate=negate, gen=False, **kwargs))
  File "/home/scott/.local/lib/python3.10/site-packages/fastcore/basics.py", line 642, in filter_ex
    return list(res)
  File "/home/scott/.local/lib/python3.10/site-packages/nbdev/sync.py", line 79, in <lambda>
    files = files.filter(lambda x: str(Path(x).absolute().relative_to(lib_dir) in _mod_files()))
  File "/home/scott/.local/lib/python3.10/site-packages/nbdev/sync.py", line 38, in _mod_files
    midx = import_module(f'{get_config().lib_path.name}._modidx')
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'nested'
@scwe scwe added the bug Something isn't working label Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant