librelist archives

« back to archive

Access to third-party modules?

Access to third-party modules?

From:
Derek
Date:
2012-01-11 @ 08:43
Apologies in advance if I missed something obvious in the manual;
please refer me to The Right Place in that case.

I can use Sphinx to generate the project documentation on my local
machine, but of course all the (dozens and dozens of) third-party
modules are installed there.

I have followed RTD docs describing how to specify these in a Mock() call.

I do have one question though, it seems that I need to specify in
detail each and every module, along with the entire parent hierarchy
for each such module imported e.g.

MOCK_MODULES = ['matplotlib',
                'matplotlib.projections',
                'matplotlib.projections.polar']

Is this actually the case, or is there a shorter way of doing it?  I
am currently in the process of specifying each-and-every
module+parents but I am wondering if this is sustainable in the light
of ongoing changes to the project code.

Thanks
Derek

Re: [readthedocs] Access to third-party modules?

From:
Javier Collado
Date:
2012-01-11 @ 13:04
Hello,

2012/1/11 Derek <gamesbook@gmail.com>:
> MOCK_MODULES = ['matplotlib',
>                'matplotlib.projections',
>                'matplotlib.projections.polar']
>
> Is this actually the case, or is there a shorter way of doing it?

If you manage to make the Mock class return types when using attribute
access, then you're done with just 'matplotlib'. Unfortunately, the
example in the documentation doesn't cover that use case.

Best regards,
     Javier