Opened 9 years ago

Closed 9 years ago

#15324 closed defect (fixed)

Docbuilder issue with LinearMatroid

Reported by: Jeroen Demeyer Owned by:
Priority: blocker Milestone: sage-5.13
Component: matroid theory Keywords:
Cc: Stefan, Volker Braun Merged in: sage-5.13.beta2
Authors: Stefan van Zwam Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Stefan)

Sometimes, make doc yields

Traceback (most recent call last):
  File "/scratch/release/merger/sage-5.13.beta2/devel/sage/doc/common/builder.py", line 1452, in <module>
    getattr(get_builder(name), type)()
  File "/scratch/release/merger/sage-5.13.beta2/devel/sage/doc/common/builder.py", line 269, in _wrapper
    getattr(get_builder(document), 'inventory')(*args, **kwds)
  File "/scratch/release/merger/sage-5.13.beta2/devel/sage/doc/common/builder.py", line 472, in _wrapper
    pool.map_async(build_ref_doc, L, 1).get(99999)
  File "/scratch/release/merger/sage-5.13.beta2/local/lib/python/multiprocessing/pool.py", line 554, in get
    raise self._value
AttributeError: 'module' object has no attribute 'LinearMatroid'
make: *** [doc-html] Error 1

apply trac_15324_remove_circular_imports.patch

Attachments (1)

trac_15324_remove_circular_imports.patch (6.6 KB) - added by Stefan 9 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 9 years ago by Stefan

I *think* I know what causes this (an import in sage.matroids.utilities), but I'll do a thorough review of the imports in sage.matroids so this is the last ticket of its kind.

For the record, we started seeing these things when we moved to lazy_import in sage.matroids.all. Before, everything would be imported in a "safe" order at startup. Now it's possible to import things in a different order, and these circular imports are coming to light. It's probably a good thing, I guess.

comment:2 Changed 9 years ago by Stefan

To reproduce, we can use Volker's trick from the last ticket:

sage: from sage.matroids.linear_matroid import LinearMatroid

Changed 9 years ago by Stefan

comment:3 Changed 9 years ago by Stefan

Authors: Stefan van Zwam
Description: modified (diff)
Status: newneeds_review

Ok, this should fix it. There are no more circular imports in sage.matroids (all the ones that used to be there are now imported at method level). Doctests pass.

comment:4 Changed 9 years ago by Jeroen Demeyer

Merged in: sage-5.13.beta2
Resolution: fixed
Reviewers: Jeroen Demeyer
Status: needs_reviewclosed

The patch looks sensible to me.

Note: See TracTickets for help on using tickets.