Coder Social home page Coder Social logo

Comments (4)

mhils avatar mhils commented on June 14, 2024

The above exception was the direct cause of the following exception:

Please post the full output.

from pdoc.

thierrymoudiki avatar thierrymoudiki commented on June 14, 2024

Sure. This package relies on Cython, maybe this information could be useful. Here it is (works without --output-dir mlsauce-docs):

pdoc -t docs mlsauce/* --output-dir mlsauce-docs
Traceback (most recent call last):
  File "/Users/t/Documents/Python_Packages/mlsauce/venv/lib/python3.11/site-packages/pdoc/extract.py", line 217, in load_module
    return importlib.import_module(module)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.8/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/t/Documents/Python_Packages/mlsauce/mlsauce/tests/test_adaopt.py", line 8, in <module>
    from mlsauce import mlsauce
ImportError: cannot import name 'mlsauce' from 'mlsauce' (/Users/t/Documents/Python_Packages/mlsauce/mlsauce/__init__.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/t/Documents/Python_Packages/mlsauce/venv/bin/pdoc", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/t/Documents/Python_Packages/mlsauce/venv/lib/python3.11/site-packages/pdoc/__main__.py", line 199, in cli
    pdoc.pdoc(
  File "/Users/t/Documents/Python_Packages/mlsauce/venv/lib/python3.11/site-packages/pdoc/__init__.py", line 510, in pdoc
    all_modules[module_name] = doc.Module.from_name(module_name)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/t/Documents/Python_Packages/mlsauce/venv/lib/python3.11/site-packages/pdoc/doc.py", line 403, in from_name
    return cls(extract.load_module(name))
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.8/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/t/Documents/Python_Packages/mlsauce/venv/lib/python3.11/site-packages/pdoc/extract.py", line 219, in load_module
    raise RuntimeError(f"Error importing {module}") from e
RuntimeError: Error importing mlsauce.tests.test_adaopt
make: *** [docs] Error 1

from pdoc.

mhils avatar mhils commented on June 14, 2024

This is not a pdoc bug. The mlsauce/tests/test_adaopt.py file tries to import mlsauce.mlsauce, which does not exist. This only manifests in the second invocation, because the web-server loads sub packages only on demand.

You need to either fix the test file, or exclude it from processing (https://pdoc.dev/docs/pdoc.html#exclude-submodules-from-being-documented).

from pdoc.

thierrymoudiki avatar thierrymoudiki commented on June 14, 2024

@mhils I'll try to exclude it from processing then. It's funny that by adding --output-dir mlsauce-docs, it starts checking the tests and fails. Great package btw Highly customizable when you know Jinja and HTML.

from pdoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.