doc build problem with axes_grid

I wanted to make a small fix to the contour docstring, and test it before committing, so I tried building the docs from scratch. It fails with the last part of the traceback being:

   File "/usr/local/lib/python2.6/dist-packages/matplotlib/sphinxext/plot_directive.py", line 414, in plot_directive
     options, state_machine)
   File "/usr/local/lib/python2.6/dist-packages/matplotlib/sphinxext/plot_directive.py", line 337, in _plot_directive
     shutil.copyfile(plot_path, os.path.join(destdir, fname))
   File "/usr/lib/python2.6/shutil.py", line 52, in copyfile
     fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: u'/home/efiring/programs/py/mpl/mpl_trunk/doc/mpl_examples/axes_grid/demo_fixed_size_axes.py'
> /usr/lib/python2.6/shutil.py(52)copyfile()
-> fsrc = open(src, 'rb')

I suspect the problem is that doc/examples/axes_grid has many .rst files for .py scripts that are no longer present, at least on my svn checkout. I have a demo_fixed_size_axes.pyc sitting around, but no corresponding .py, again indicating that the .py was removed from svn.

Is there some step I am missing, or is there a need to remove from the svn tree those .rst files that lack corresponding .py?

Eric

The error happens because of the *.rst files under doc/examples that
are not in sync with examples/*.py.
Removing that directory (doc/examples) will solve the problem (the
directory will be repopulated when you run make.py again). Here is a
related link.

http://old.nabble.com/python-make.py-html-failure-tt26894350.html

Maybe we need something like "python make.py clean"?

Regards,

-JJ

···

On Fri, Jan 1, 2010 at 11:09 PM, Eric Firing <efiring@...229...> wrote:

I wanted to make a small fix to the contour docstring, and test it
before committing, so I tried building the docs from scratch. It fails
with the last part of the traceback being:

File
"/usr/local/lib/python2.6/dist-packages/matplotlib/sphinxext/plot_directive.py",
line 414, in plot_directive
options, state_machine)
File
"/usr/local/lib/python2.6/dist-packages/matplotlib/sphinxext/plot_directive.py",
line 337, in _plot_directive
shutil.copyfile(plot_path, os.path.join(destdir, fname))
File "/usr/lib/python2.6/shutil.py", line 52, in copyfile
fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory:
u'/home/efiring/programs/py/mpl/mpl_trunk/doc/mpl_examples/axes_grid/demo_fixed_size_axes.py'
> /usr/lib/python2.6/shutil.py(52)copyfile()
-> fsrc = open(src, 'rb')

I suspect the problem is that doc/examples/axes_grid has many .rst files
for .py scripts that are no longer present, at least on my svn checkout.
I have a demo_fixed_size_axes.pyc sitting around, but no corresponding
.py, again indicating that the .py was removed from svn.

Is there some step I am missing, or is there a need to remove from the
svn tree those .rst files that lack corresponding .py?

Eric

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
matplotlib-devel List Signup and Options

Jae-Joon Lee wrote:

The error happens because of the *.rst files under doc/examples that
are not in sync with examples/*.py.
Removing that directory (doc/examples) will solve the problem (the
directory will be repopulated when you run make.py again). Here is a
related link.

http://old.nabble.com/python-make.py-html-failure-tt26894350.html

Thank you for the quick response. That was it, exactly. There are still some example script failures, but nothing that stops the build in its tracks.

Maybe we need something like "python make.py clean"?

Yes, if the generated files can't all land in the "build" directory (as would seem preferable), then the next-best thing would be to have make.py able to do a thorough cleaning.

Eric

···

Regards,

-JJ

On Fri, Jan 1, 2010 at 11:09 PM, Eric Firing <efiring@...229...> wrote:

I wanted to make a small fix to the contour docstring, and test it
before committing, so I tried building the docs from scratch. It fails
with the last part of the traceback being:

  File
"/usr/local/lib/python2.6/dist-packages/matplotlib/sphinxext/plot_directive.py",
line 414, in plot_directive
    options, state_machine)
  File
"/usr/local/lib/python2.6/dist-packages/matplotlib/sphinxext/plot_directive.py",
line 337, in _plot_directive
    shutil.copyfile(plot_path, os.path.join(destdir, fname))
  File "/usr/lib/python2.6/shutil.py", line 52, in copyfile
    fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory:
u'/home/efiring/programs/py/mpl/mpl_trunk/doc/mpl_examples/axes_grid/demo_fixed_size_axes.py'
> /usr/lib/python2.6/shutil.py(52)copyfile()
-> fsrc = open(src, 'rb')

I suspect the problem is that doc/examples/axes_grid has many .rst files
for .py scripts that are no longer present, at least on my svn checkout.
I have a demo_fixed_size_axes.pyc sitting around, but no corresponding
.py, again indicating that the .py was removed from svn.

Is there some step I am missing, or is there a need to remove from the
svn tree those .rst files that lack corresponding .py?

Eric

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
matplotlib-devel List Signup and Options

I just do svn-clean whenever I have a problem

http://svn.collab.net/repos/svn/trunk/contrib/client-side/svn-clean

JDH

···

On Sat, Jan 2, 2010 at 12:34 AM, Eric Firing <efiring@...229...> wrote:

Jae-Joon Lee wrote:

The error happens because of the *.rst files under doc/examples that
are not in sync with examples/*.py.
Removing that directory (doc/examples) will solve the problem (the
directory will be repopulated when you run make.py again). Here is a
related link.

http://old.nabble.com/python-make.py-html-failure-tt26894350.html

Thank you for the quick response. That was it, exactly. There are
still some example script failures, but nothing that stops the build in
its tracks.

Maybe we need something like "python make.py clean"?

Yes, if the generated files can't all land in the "build" directory (as
would seem preferable), then the next-best thing would be to have
make.py able to do a thorough cleaning.

John Hunter wrote:

Jae-Joon Lee wrote:

The error happens because of the *.rst files under doc/examples that
are not in sync with examples/*.py.
Removing that directory (doc/examples) will solve the problem (the
directory will be repopulated when you run make.py again). Here is a
related link.

http://old.nabble.com/python-make.py-html-failure-tt26894350.html

Thank you for the quick response. That was it, exactly. There are
still some example script failures, but nothing that stops the build in
its tracks.

Maybe we need something like "python make.py clean"?

Yes, if the generated files can't all land in the "build" directory (as
would seem preferable), then the next-best thing would be to have
make.py able to do a thorough cleaning.

I just do svn-clean whenever I have a problem

http://svn.collab.net/repos/svn/trunk/contrib/client-side/svn-clean

I didn't know about that. It seems strange that svn has no such command built in. Mercurial has "hg purge", so I was expecting to find something similar in svn. It seems like a pretty basic operation.

Do you know why the plot directive (I assume that is the cause of the problem) cannot put all generated output in build? Or is this a more general Sphinx wart?

Eric

···

On Sat, Jan 2, 2010 at 12:34 AM, Eric Firing <efiring@...229...> wrote:

Eric Firing wrote:

John Hunter wrote:
  

Jae-Joon Lee wrote:
      

Maybe we need something like "python make.py clean"?
        

It already does have "clean", but from the looks of it, it is currently broken (I just fixed this in SVN). It used to call out to svn-clean, but it was pointed out that only works if you're building from SVN, not from a tarball (which is a problem for the Linux distros). So there is explicit code in make.py to delete all of the generated files.

Do you know why the plot directive (I assume that is the cause of the problem) cannot put all generated output in build? Or is this a more general Sphinx wart?
  

The problem is not in the plot_directive (though I suppose it could be more helpful when the file isn't found) -- it does in fact put everything under build. The problem is in gen_rst.py, which generates pages for all of the examples, and puts them in doc/examples. At the time, it wasn't clear how to generate these pages under the build tree and then have Sphinx pick them up. That may have predated all of the "hooks" that Sphinx now has, however, and it may now be possible to solve that problem.

Mike

···

On Sat, Jan 2, 2010 at 12:34 AM, Eric Firing <efiring@...229...> wrote:

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA