Coder Social home page Coder Social logo

Comments (7)

hammad93 avatar hammad93 commented on May 20, 2024 5

Would you be able to write a flag that simply ignores all import errors?

from pdoc.

BurntSushi avatar BurntSushi commented on May 20, 2024

pdoc generates documentation by importing the module it is trying to document. This means that it must be a valid Python file that is importable in the current environment.

There are no plans to change this. (It would require parsing the Python AST manually.)

from pdoc.

ryneeverett avatar ryneeverett commented on May 20, 2024

There are no plans to change this. (It would require parsing the Python AST manually.)

Perhaps that would be prohibitively difficult but it seems like the tool would be a lot more robust if you didn't have to worry about import side-effects. For instance any django project would currently have to write a wrapper script to handle DJANGO_SETTINGS_MODULE.

from pdoc.

BurntSushi avatar BurntSushi commented on May 20, 2024

@ryneeverett No, really, it's a non-starter. I totally agree that what you're describing would be awesome, but it would literally require a ground up rewrite. This means pdoc is not the project for that. It should be a new project.

from pdoc.

BurntSushi avatar BurntSushi commented on May 20, 2024

@ryneeverett It's also probably one or two orders of magnitude harder to do.

from pdoc.

BurntSushi avatar BurntSushi commented on May 20, 2024

@ryneeverett On top of all of that, it's really hard (for me personally) to justify that kind of effort to work around non-idiomatic Python code (which shouldn't have nasty import side effects).

from pdoc.

TheCherry avatar TheCherry commented on May 20, 2024

Have at the moment the same problem.
Did write a large application, that application use the vbox api.
There is at the moment no way to document my software, course he tell me every time:
Exception ImportError: 'No module named xpcom' in <bound method VirtualBoxManager.__del__ of <vboxapi.VirtualBoxManager object at 0x7fd3266d1b10>> ignored
I see noway to ignore that import and create a documentation, that is required for our customer.
Pydoc have exactly the same problem ...

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.