#258 L{module} and "import module" not merged properly

closed-fixed
Edward Loper
inspection (59)
5
2008-02-19
2008-02-19
Gidi_Avrahami
No

I have the following situation:

A submodule is referenced as L{mytestmod.bbb} at the top level's __init__ file

The same module is imported once in another submodule.

When running epydoc with both introspect and parse, the L{...} item is not shown as a link, but simple text. Some tracing shows that the code sees a VariableDoc which apparently has not been merged with the ModuleDoc.

The problem doesn't happen if I say --introspect-only or --parse-only.

Attached: a module tree that shows the problem, and the resulting broken HTML.

========================================

Also, there's a typo in merge_and_overwrite(), where it says:
"%r has already been hashed! Merging it "
"would cause its has value to change."
This should be 'hash value'.

Discussion

  • Gidi_Avrahami
    Gidi_Avrahami
    2008-02-19

    example module tree

     
    Attachments
  • Gidi_Avrahami
    Gidi_Avrahami
    2008-02-19

    mytestmod HTML

     
    Attachments
  • Gidi_Avrahami
    Gidi_Avrahami
    2008-02-19

    Logged In: YES
    user_id=1935074
    Originator: YES

    Adding the HTML page
    File Added: mytestmod-module.html

     
  • Edward Loper
    Edward Loper
    2008-02-19

    • labels: 469725 --> inspection
     
  • Edward Loper
    Edward Loper
    2008-02-19

    Logged In: YES
    user_id=195958
    Originator: NO

    I think the best solution here is probably to have epydoc import all modules before it starts introspecting them. Importing one module can potentially modify the contents of another module. In this case, it's a fairly trivial modification, but it still happens to trip epydoc up -- the module "mytestmod.ppp.p1" imports "mytestmod.bbb," which effectively creates a variable "bbb" in "mytestmod" -- i.e., the __dict__ for mytestmod now has an entry that it didn't before. But epydoc has already introspected mytestmod, so it never sees that variable; and gets a little confused when merging with the parsed docs (which do include that variable.)

    Anyway, if everything gets imported before anything gets introspected, then the problem should go away.

     
  • Edward Loper
    Edward Loper
    2008-02-19

    • status: open --> closed-fixed
     
  • Edward Loper
    Edward Loper
    2008-02-19

    Logged In: YES
    user_id=195958
    Originator: NO

    Fixed in svn revision 1730.