goerz / better-apidoc

A version of sphinx-apidoc with support for templating
BSD 2-Clause "Simplified" License
32 stars 6 forks source link

issue with implicit-namespaces #3

Open mentaal opened 7 years ago

mentaal commented 7 years ago

I can run this without issue:

sphinx-apidoc -f --implicit-namespaces --no-toc --ext-todo --ext-intersphinx --ext-viewcode -o source/apidoc <excludes>

without issue

However when I run the same with better-apidoc like this:

better-apidoc -t './rst_template_dir' -f --implicit-namespaces --no-toc --ext-todo --ext-intersphinx --ext-viewcode -o source/apidoc <excludes>

I get the following:

Traceback (most recent call last):
  File "c:\anaconda3\envs\py352\lib\runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\anaconda3\envs\py352\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Anaconda3\envs\py352\Scripts\better-apidoc.exe\__main__.py", line 9, in <module>
  File "c:\anaconda3\envs\py352\lib\site-packages\better_apidoc.py", line 600, in main
    modules = recurse_tree(rootpath, excludes, opts)
  File "c:\anaconda3\envs\py352\lib\site-packages\better_apidoc.py", line 458, in recurse_tree
    py_files, opts, subs, is_namespace)
  File "c:\anaconda3\envs\py352\lib\site-packages\better_apidoc.py", line 318, in create_package_file
    includeprivate=opts.includeprivate)
  File "c:\anaconda3\envs\py352\lib\site-packages\better_apidoc.py", line 270, in _get_mod_ns
    mod = importlib.import_module(fullname)
  File "c:\anaconda3\envs\py352\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 981, in _gcd_import
  File "<frozen importlib._bootstrap>", line 933, in _sanity_check
ValueError: Empty module name
make: *** [rst] Error 1
> pip show better-apidoc
Name: better-apidoc
Version: 0.1.2

I don't appear to get any error when not using --implicit-namespaces: for whatever that's worth.