Skip to content

[3.1] Remote access when building documentation #8311

Closed

Description

@olebole

For the Debian astropy package, I also build a (separate) documentation package, python-astropy-doc with python3 setup.py build_docs.
With version 3.1, it however starts to require some internet access to do so:

m33 = SkyCoord.from_name('M33')

requires external catalog access

fits_file = get_pkg_data_filename('tutorials/FITS-Header/input_file.fits')

event_filename = get_pkg_data_filename('tutorials/FITS-tables/chandra_events.fits')

image_file = get_pkg_data_filename('tutorials/FITS-images/HorseHead.fits')

require download of a small FITS file.

The downloads in these cases seems to be not really necessary (they could be provided locally, as others already are). This would make the documentation self-contained.

Activity

  1. pllim commented on Dec 31, 2018

    @pllim
    Member

    There was a suggestion by @eteq to revamp the examples gallery over at #7242 . In the meantime, from what I see here,

    astropy/docs/conf.py

    Lines 224 to 246 in 9bffef1

    try:
    import sphinx_gallery
    extensions += ["sphinx_gallery.gen_gallery"]
    sphinx_gallery_conf = {
    'backreferences_dir': 'generated/modules', # path to store the module using example template
    'filename_pattern': '^((?!skip_).)*$', # execute all examples except those that start with "skip_"
    'examples_dirs': '..{}examples'.format(os.sep), # path to the examples scripts
    'gallery_dirs': 'generated/examples', # path to save gallery generated examples
    'reference_url': {
    'astropy': None,
    'matplotlib': 'http://matplotlib.org/',
    'numpy': 'http://docs.scipy.org/doc/numpy/',
    },
    'abort_on_example_error': True
    }
    except ImportError:
    def setup(app):
    app.warn('The sphinx_gallery extension is not installed, so the '
    'gallery will not be built. You will probably see '
    'additional warnings about undefined references due '
    'to this.')

    perhaps by uninstalling sphinx-gallery, you can "hack" the doc build to not build the "examples" directory?

  2. olebole commented on Dec 31, 2018

    @olebole
    MemberAuthor

    In the Debian build, I just removed the examples in question, so no hurry is needed. It was more to keep the docs somehow clean, not knowing about #7242.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions