././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1754502973.0970001 sphinx_astropy-1.10/0000755000175100001660000000000015044713475014142 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000003000000000000010206 xustar0024 mtime=1754502973.092 sphinx_astropy-1.10/.github/0000755000175100001660000000000015044713475015502 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/.github/dependabot.yml0000644000175100001660000000111715044713462020326 0ustar00runnerdocker# To get started with Dependabot version updates, you'll need to specify which # package ecosystems to update and where the package manifests are located. # Please see the documentation for all configuration options: # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" # See documentation for possible values directory: ".github/workflows" # Location of package manifests schedule: interval: "monthly" groups: actions: patterns: - "*" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/.github/release.yml0000644000175100001660000000017715044713462017646 0ustar00runnerdockerchangelog: exclude: authors: - dependabot - dependabot[bot] - pre-commit-ci - pre-commit-ci[bot] ././@PaxHeader0000000000000000000000000000003000000000000010206 xustar0024 mtime=1754502973.093 sphinx_astropy-1.10/.github/workflows/0000755000175100001660000000000015044713475017537 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/.github/workflows/publish.yml0000644000175100001660000000304215044713462021723 0ustar00runnerdockername: Release on: pull_request: # We also want this workflow triggered if the 'Build all wheels' label is added # or present when PR is updated types: - synchronize - labeled push: tags: - '*' jobs: build-n-publish: name: Build and publish Python 🐍 distributions 📦 to PyPI runs-on: ubuntu-latest if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || contains(github.event.pull_request.labels.*.name, 'Build wheels')) steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.12" - name: Install build dependencies run: python -m pip install pip build "twine>=3.3" -U - name: Build package run: python -m build --sdist --wheel . - name: List result run: ls -l dist - name: Check long_description run: python -m twine check --strict dist/* - name: Test package run: | cd .. python -m venv testenv testenv/bin/pip install pip -U testenv/bin/pip install pytest sphinx-astropy/dist/*.whl testenv/bin/pytest sphinx-astropy/sphinx_astropy - name: Publish distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 with: user: __token__ password: ${{ secrets.pypi_password }} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/.github/workflows/python-tests.yml0000644000175100001660000000344115044713462022741 0ustar00runnerdockername: Run unit tests on: pull_request: push: branches: [ main ] tags: workflow_dispatch: schedule: # Run every Sunday at 03:53 UTC - cron: 53 2 * * 0 jobs: tests: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - os: ubuntu-latest python-version: 3.9 toxenv: py39-test-sphinx_oldest - os: windows-latest python-version: "3.10" toxenv: py310-test-sphinx53 - os: macos-latest python-version: "3.10" toxenv: py310-test-sphinx62 - os: ubuntu-latest python-version: "3.11" toxenv: py311-test-sphinx70 - os: windows-latest python-version: "3.11" toxenv: py311-test-v2deps-sphinx71 - os: macos-latest python-version: "3.11" toxenv: py311-test-sphinx72 - os: ubuntu-latest python-version: "3.12" toxenv: py312-test-v2deps-sphinx80 - os: windows-latest python-version: "3.12" toxenv: py312-test-sphinx81 - os: ubuntu-latest python-version: "3.13" toxenv: py312-test-sphinx82 - os: macos-latest python-version: "3.13" toxenv: py313-test-v2deps-sphinxdev steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.python-version }} - name: Install Tox run: python -m pip install tox - name: Run Tox run: tox -v -e ${{ matrix.toxenv }} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/.gitignore0000644000175100001660000000107315044713462016127 0ustar00runnerdocker# Compiled files *.py[cod] *.a *.o *.so *.pyd __pycache__ # Ignore .c files by default to avoid including generated code. If you want to # add a non-generated .c extension, use `git add -f filename.c`. *.c # Other generated files MANIFEST # Sphinx _build _generated # Packages/installer info *.egg *.egg-info dist build eggs parts bin var sdist develop-eggs .installed.cfg distribute-*.tar.gz # Other .cache .tox .*.swp *~ .project .pydevproject .settings .coverage cover htmlcov # Mac OSX .DS_Store # PyCharm .idea sphinx_astropy/version.py pip-wheel-metadata/ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/.mailmap0000644000175100001660000000064415044713462015563 0ustar00runnerdockerBrigitta Sipőcz Brigitta Sipőcz Dan D'Avella E. Madison Bray E. Madison Bray P. L. Lim <2090236+pllim@users.noreply.github.com> Simon Conseil Simon Conseil ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/CHANGES.rst0000644000175100001660000000440115044713462015737 0ustar00runnerdockerChanges in sphinx-astropy ========================= 1.10 (2025-08-06) ----------------- - Update minimum required version of Sphinx to 4.0.0 and Python to 3.9. [#78] 1.9.1 (2023-06-07) ------------------ - Renamed ``[v2]`` optional dependencies key to ``[confv2]`` to avoid triggering build error in Python 3.10 or earlier. [#63] 1.9 (2023-06-06) ---------------- - To switch to ``pydata-sphinx-theme``, use ``sphinx_astropy.conf.v2`` and install the ``[v2]`` optional dependencies. [#59] - Update minimum required version of Sphinx to 3.0.0. [#57] - ``check_sphinx_version`` is deprecated. [#57] 1.8 (2023-01-06) ---------------- - Update scipy intersphinx URL. [#53] - Ensure that jQuery is always installed with Sphinx 6+. [#56] 1.7 (2022-01-10) ---------------- - Removed dependency on ``distutils``. As a result, ``packaging`` is now a dependency. [#51] - Updated ``matplotlib`` URL for intersphinx. [#52] 1.6 (2021-09-22) ---------------- - Updated minimum required version of ``pytest-doctestplus`` to 0.11. [#47] 1.5 (2021-07-20) ---------------- - ``doctest`` sphinx extension has been moved to ``pytest-doctestplus`` and therefore ``pytest-doctestplus`` is now a required dependency. [#45] 1.4 (2021-06-22) ---------------- - Updated intersphinx links. [#32, #36] - Removed LaTeX preamble section redefining warnings and notes. [#34] - Added support for numpydoc intersphinx xref. [#40] - Dropped support for Python 3.6. [#42] 1.3 (2020-04-28) ---------------- - Add extension to include generated config in the docs. [#30] 1.2 (2019-11-12) ---------------- - Updated minimum required version of Sphinx to 1.7 as Numpydoc dropped support for Sphinx older than 1.6 and the inherit docstring feature is only available in Sphinx 1.7 or greater. [#19, #24] - Make sure all extensions are marked as parallel-safe. [#26] 1.1.1 (2019-02-21) ------------------ - Fix app.info() deprecation warning for Sphinx >= 1.6. [#17] 1.1 (2018-11-15) ---------------- - Added a new extension for controlling whether intersphinx is used on the command-line. - Added a new extension to give a clear warning if the _static folder is missing. 1.0 (2018-02-07) ---------------- - Initial standalone version of this package (formerly packaged as part of astropy-helpers) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/LICENSE.rst0000644000175100001660000000273015044713462015754 0ustar00runnerdockerCopyright (c) 2014-2025, Astropy Developers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Astropy Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/MANIFEST.in0000644000175100001660000000020415044713462015670 0ustar00runnerdockerinclude README.rst include CHANGES.rst include LICENSE.rst include setup.cfg include pyproject.toml exclude *.pyc *.o prune build ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1754502973.0970001 sphinx_astropy-1.10/PKG-INFO0000644000175100001660000000765115044713475015250 0ustar00runnerdockerMetadata-Version: 2.4 Name: sphinx-astropy Version: 1.10 Summary: Sphinx extensions and configuration specific to the Astropy project Home-page: https://github.com/astropy/sphinx-astropy Author: The Astropy Developers Author-email: astropy.team@gmail.com License: BSD Classifier: Intended Audience :: Developers Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Operating System :: OS Independent Classifier: License :: OSI Approved :: BSD License Requires-Python: >=3.9 Description-Content-Type: text/x-rst License-File: LICENSE.rst Requires-Dist: packaging Requires-Dist: sphinx>=4.0.0 Requires-Dist: astropy-sphinx-theme Requires-Dist: numpydoc Requires-Dist: sphinx-automodapi Requires-Dist: sphinx-gallery Requires-Dist: sphinxcontrib-jquery Requires-Dist: pillow Requires-Dist: pytest-doctestplus>=0.11 Provides-Extra: confv2 Requires-Dist: pydata-sphinx-theme; extra == "confv2" Requires-Dist: sphinx-copybutton; extra == "confv2" Provides-Extra: all Requires-Dist: astropy; extra == "all" Provides-Extra: tests Requires-Dist: pytest; extra == "tests" Dynamic: license-file About ===== .. image:: https://zenodo.org/badge/119399685.svg :target: https://zenodo.org/badge/latestdoi/119399685 :alt: Zenodo DOI .. image:: https://github.com/astropy/sphinx-astropy/actions/workflows/python-tests.yml/badge.svg :target: https://github.com/astropy/sphinx-astropy/actions/workflows/python-tests.yml :alt: CI Status This package serves two purposes: it provides a default Sphinx configuration and set of extensions specific to the Astropy project, and it acts as a meta-package by installing all required Sphinx extensions for the core Astropy package and other packages. Sphinx configuration -------------------- The default Sphinx configuration can be imported by putting: .. code-block:: python from sphinx_astropy.conf import * at the top of your ``conf.py`` file. You can then override specific settings from this default configuration, such as adding extensions or intersphinx packages. To give a clearer error messages for users, you can instead write: .. code-block:: python try: from sphinx_astropy.conf import * except ImportError: print('ERROR: the documentation requires the sphinx-astropy package to be installed') sys.exit(1) Dependencies/extensions ----------------------- Installing **sphinx-astropy** will automatically install (if not already present): * `Sphinx `_ * `astropy-sphinx-theme `_ - the default 'bootstrap' theme use by Astropy and a number of affiliated packages. This goes with `sphinx_astropy.conf.v1`. * `sphinx-automodapi `_ - an extension that makes it easy to automatically generate API documentation. * `sphinx-gallery `_ - an extension to generate example galleries * `numpydoc `_ - an extension to parse docstrings in NumpyDoc format * `pillow `_ - a package to deal with images, used by some examples in the astropy core documentation. * `pytest-doctestplus `_ - providing the 'doctestplus' extension to skip code snippets in narrative documentation. pydata-sphinx-theme (confv2) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ To use the new `pydata-sphinx-theme` with `sphinx_astropy.conf.v2`, you have to install the optional `[confv2]` dependencies:: pip install sphinx-astropy[confv2] That would pull in the following as well: * `pydata-sphinx-theme `_ - a clean, three-column, Bootstrap-based Sphinx theme by and for the `PyData community `_. * `sphinx-copybutton `_ - a small Sphinx extension to add a "copy" button to code blocks. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/README.rst0000644000175100001660000000547215044713462015635 0ustar00runnerdockerAbout ===== .. image:: https://zenodo.org/badge/119399685.svg :target: https://zenodo.org/badge/latestdoi/119399685 :alt: Zenodo DOI .. image:: https://github.com/astropy/sphinx-astropy/actions/workflows/python-tests.yml/badge.svg :target: https://github.com/astropy/sphinx-astropy/actions/workflows/python-tests.yml :alt: CI Status This package serves two purposes: it provides a default Sphinx configuration and set of extensions specific to the Astropy project, and it acts as a meta-package by installing all required Sphinx extensions for the core Astropy package and other packages. Sphinx configuration -------------------- The default Sphinx configuration can be imported by putting: .. code-block:: python from sphinx_astropy.conf import * at the top of your ``conf.py`` file. You can then override specific settings from this default configuration, such as adding extensions or intersphinx packages. To give a clearer error messages for users, you can instead write: .. code-block:: python try: from sphinx_astropy.conf import * except ImportError: print('ERROR: the documentation requires the sphinx-astropy package to be installed') sys.exit(1) Dependencies/extensions ----------------------- Installing **sphinx-astropy** will automatically install (if not already present): * `Sphinx `_ * `astropy-sphinx-theme `_ - the default 'bootstrap' theme use by Astropy and a number of affiliated packages. This goes with `sphinx_astropy.conf.v1`. * `sphinx-automodapi `_ - an extension that makes it easy to automatically generate API documentation. * `sphinx-gallery `_ - an extension to generate example galleries * `numpydoc `_ - an extension to parse docstrings in NumpyDoc format * `pillow `_ - a package to deal with images, used by some examples in the astropy core documentation. * `pytest-doctestplus `_ - providing the 'doctestplus' extension to skip code snippets in narrative documentation. pydata-sphinx-theme (confv2) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ To use the new `pydata-sphinx-theme` with `sphinx_astropy.conf.v2`, you have to install the optional `[confv2]` dependencies:: pip install sphinx-astropy[confv2] That would pull in the following as well: * `pydata-sphinx-theme `_ - a clean, three-column, Bootstrap-based Sphinx theme by and for the `PyData community `_. * `sphinx-copybutton `_ - a small Sphinx extension to add a "copy" button to code blocks. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/pyproject.toml0000644000175100001660000000032515044713462017052 0ustar00runnerdocker[build-system] requires = ["setuptools>=30.3.0", "setuptools_scm>=8.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.setuptools_scm] version_file = "sphinx_astropy/version.py" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1754502973.0970001 sphinx_astropy-1.10/setup.cfg0000644000175100001660000000166615044713475015774 0ustar00runnerdocker[metadata] name = sphinx-astropy url = https://github.com/astropy/sphinx-astropy author = The Astropy Developers author_email = astropy.team@gmail.com classifiers = Intended Audience :: Developers Programming Language :: Python Programming Language :: Python :: 3 Operating System :: OS Independent License :: OSI Approved :: BSD License license = BSD description = Sphinx extensions and configuration specific to the Astropy project long_description = file: README.rst long_description_content_type = text/x-rst [options] zip_safe = False packages = find: python_requires = >=3.9 install_requires = packaging sphinx>=4.0.0 astropy-sphinx-theme numpydoc sphinx-automodapi sphinx-gallery sphinxcontrib-jquery pillow pytest-doctestplus>=0.11 [options.extras_require] confv2 = pydata-sphinx-theme sphinx-copybutton all = astropy tests = pytest [options.package_data] sphinx_astropy = local/* [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000003000000000000010206 xustar0024 mtime=1754502973.093 sphinx_astropy-1.10/sphinx_astropy/0000755000175100001660000000000015044713475017234 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/__init__.py0000644000175100001660000000006415044713462021341 0ustar00runnerdockerfrom .version import version as __version__ # noqa ././@PaxHeader0000000000000000000000000000003000000000000010206 xustar0024 mtime=1754502973.094 sphinx_astropy-1.10/sphinx_astropy/conf/0000755000175100001660000000000015044713475020161 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/conf/__init__.py0000644000175100001660000000165615044713462022276 0ustar00runnerdocker# This directory contains the default Sphinx configuration for the core Astropy # package and other packages that want to use the same configuration. Rather # than store the configuration in a single conf.py file, we store it in v?.py # files and import the latest one into sphinx_astropy.conf so that packages can # choose to use either to do: # # from sphinx_astropy.conf import * # # or: # # from sphinx_astropy.conf.v1 import * # # with the latter being the option to use for stability. The idea is that # we can still make small changes (mainly fixing bugs) to v1.py, but if we # make any big changes in future, we can create a new version that packages # can choose to opt-in to. To create a new default configuration, create a # v2.py file (either starting from a copy of v1.py or starting from # scratch), and change the import below to 'from .v2 import *'. # TODO: Switch default to v2 from .v1 import * # noqa: F401, F403 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/conf/v1.py0000644000175100001660000003341515044713462021063 0ustar00runnerdocker# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # # Astropy shared Sphinx settings. These settings are shared between # astropy itself and affiliated packages. # # Note that not all possible configuration values are present in this file. # # All configuration values have a default; values that are commented out # serve to show the default. import os import warnings from collections import ChainMap from os import path import astropy_sphinx_theme import sphinx from packaging.version import Version try: import astropy except ImportError: ASTROPY_INSTALLED = False else: ASTROPY_INSTALLED = True from astropy.utils import minversion # -- General configuration ---------------------------------------------------- # The version check in Sphinx itself can only compare the major and # minor parts of the version number, not the micro. To do a more # specific version check, call check_sphinx_version("x.y.z.") from # your project's conf.py needs_sphinx = '3.0' SPHINX_LT_8_2 = Version(sphinx.__version__) < Version("8.2.dev") on_rtd = os.environ.get('READTHEDOCS', None) == 'True' def check_sphinx_version(expected_version): warnings.warn("check_sphinx_version is deprecated, use needs_sphinx instead", DeprecationWarning) # Configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { 'python': ('https://docs.python.org/3/', (None, 'http://data.astropy.org/intersphinx/python3.inv')), 'pythonloc': ('http://docs.python.org/', path.abspath(path.join(path.dirname(__file__), '..', 'local', 'python3_local_links.inv'))), 'numpy': ('https://numpy.org/doc/stable/', (None, 'http://data.astropy.org/intersphinx/numpy.inv')), 'scipy': ('https://docs.scipy.org/doc/scipy/', (None, 'http://data.astropy.org/intersphinx/scipy.inv')), 'matplotlib': ('https://matplotlib.org/stable/', (None, 'http://data.astropy.org/intersphinx/matplotlib.inv')), 'astropy': ('https://docs.astropy.org/en/stable/', None), 'h5py': ('https://docs.h5py.org/en/stable/', None), } # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # The reST default role (used for this markup: `text`) to use for all # documents. Set to the "smart" one. default_role = 'obj' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # This is added to the end of RST files - a good place to put substitutions to # be used globally. rst_epilog = """ .. _Astropy: https://www.astropy.org """ suppress_warnings = ['app.add_directive', ] # -- NumpyDoc X-Ref ------------------------ # Whether to create cross-references for the parameter types in the # Parameters, Other Parameters, Returns and Yields sections of the docstring. # Should be set = True in packages manually! included here as reference. # numpydoc_xref_param_type = False # Words not to cross-reference. Most likely, these are common words used in # parameter type descriptions that may be confused for classes of the same # name. This can be overwritten or modified in packages and is provided here for # convenience. numpydoc_xref_ignore = {"or", "of", "thereof", "default", "optional", "keyword-only", "instance", "type", "class", "subclass", "method"} # Mappings to fully qualified paths (or correct ReST references) for the # aliases/shortcuts used when specifying the types of parameters. # Numpy provides some defaults # https://github.com/numpy/numpydoc/blob/b352cd7635f2ea7748722f410a31f937d92545cc/numpydoc/xref.py#L62-L94 numpydoc_xref_aliases = { # Python terms "function": ":term:`python:function`", "iterator": ":term:`python:iterator`", "mapping": ":term:`python:mapping`", } # Aliases to Astropy's glossary. In packages these can be turned on with # ``numpydoc_xref_aliases.update(numpydoc_xref_aliases_astropy_glossary)`` # (if astropy is in the intersphinx mapping). numpydoc_xref_aliases_astropy_glossary = {} # works even if no Astropy if ASTROPY_INSTALLED and minversion(astropy, "4.3"): numpydoc_xref_aliases_astropy_glossary = { # general "-like": ":term:`astropy:-like`", # coordinates "angle-like": ":term:`astropy:angle-like`", "coordinate-like": ":term:`astropy:coordinate-like`", "frame-like": ":term:`astropy:frame-like`", # units "unit-like": ":term:`astropy:unit-like`", "quantity-like": ":term:`astropy:quantity-like`", # table "table-like": ":term:`astropy:table-like`", # time "time-like": ":term:`astropy:time-like`", } # Aliases to Astropy's physical types. In packages these can be turned on with # ``numpydoc_xref_aliases.update(numpydoc_xref_aliases_astropy_physical_type)`` # (if astropy is in the intersphinx mapping). numpydoc_xref_aliases_astropy_physical_type = {} # works even if no astropy if ASTROPY_INSTALLED and minversion(astropy, "4.3"): from astropy.units.physical import _name_physical_mapping for ptype in _name_physical_mapping.keys(): val = f":ref:`:ref: '{ptype}' `" # <= intersphinxed numpydoc_xref_aliases_astropy_physical_type[f"'{ptype}'"] = val del ptype, val, _name_physical_mapping # cleanup namespace # Convenient collection of all of astropy's options for numpydoc xref. # In packages all the astropy additions can be turned on with # ``numpydoc_xref_aliases.update(numpydoc_xref_astropy_aliases)`` # (if astropy is in the intersphinx mapping). numpydoc_xref_astropy_aliases = ChainMap( # important at the top numpydoc_xref_aliases_astropy_glossary, numpydoc_xref_aliases_astropy_physical_type ) # -- Project information ------------------------------------------------------ # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. #pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Settings for extensions and extension options ---------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.coverage', 'sphinx.ext.inheritance_diagram', 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', 'sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinxcontrib.jquery', 'numpydoc', 'pytest_doctestplus.sphinx.doctestplus', 'sphinx_astropy.ext.changelog_links', 'sphinx_astropy.ext.generate_config', 'sphinx_astropy.ext.intersphinx_toggle', 'sphinx_astropy.ext.missing_static', 'sphinx_automodapi.automodapi', 'sphinx_automodapi.smart_resolver', ] try: import matplotlib.sphinxext.plot_directive extensions += [matplotlib.sphinxext.plot_directive.__name__] # AttributeError is checked here in case matplotlib is installed but # Sphinx isn't. Note that this module is imported by the config file # generator, even if we're not building the docs. # We don't need to raise a warning or exception here as there are packages # that don't use the directive, and those who try to use it without mpl being # installed will get a nice "Unknown directive type" error at usage. except (ImportError, AttributeError): pass # Don't show summaries of the members in each class along with the # class' docstring numpydoc_show_class_members = False autosummary_generate = True automodapi_toctreedirnm = 'api' # Class documentation should contain *both* the class docstring and # the __init__ docstring autoclass_content = "both" # Render inheritance diagrams in SVG graphviz_output_format = "svg" graphviz_dot_args = ( '-Nfontsize=10', '-Nfontname=Helvetica Neue, Helvetica, Arial, sans-serif', '-Efontsize=10', '-Efontname=Helvetica Neue, Helvetica, Arial, sans-serif', '-Gfontsize=10', '-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif', ) if SPHINX_LT_8_2: graphviz_dot_args = list(graphviz_dot_args) # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'bootstrap-astropy' # Custom sidebar templates, maps document names to template names. html_sidebars = { '**': ['localtoc.html'], 'search': [], 'genindex': [], 'py-modindex': [], } # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # We include by default the favicon that is in the bootstrap-astropy theme. html_theme_path = astropy_sphinx_theme.get_html_theme_path() html_favicon = os.path.join(html_theme_path[0], html_theme, 'static', 'astropy_logo.ico') # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. html_last_updated_fmt = '%d %b %Y' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # -- Options for LaTeX output ------------------------------------------------ # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. latex_toplevel_sectioning = 'part' # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False latex_elements = {} # Additional stuff for the LaTeX preamble. latex_elements['preamble'] = r""" % Use a more modern-looking monospace font \usepackage{inconsolata} % The enumitem package provides unlimited nesting of lists and enums. % Sphinx may use this in the future, in which case this can be removed. % See https://bitbucket.org/birkenfeld/sphinx/issue/777/latex-output-too-deeply-nested \usepackage{enumitem} \setlistdepth{15} % In the parameters section, place a newline after the Parameters % header. (This is stolen directly from Numpy's conf.py, since it % affects Numpy-style docstrings). \usepackage{expdlist} \let\latexdescription=\description \def\description{\latexdescription{}{} \breaklabel} % Support the superscript Unicode numbers used by the "unicode" units % formatter \DeclareUnicodeCharacter{2070}{\ensuremath{^0}} \DeclareUnicodeCharacter{00B9}{\ensuremath{^1}} \DeclareUnicodeCharacter{00B2}{\ensuremath{^2}} \DeclareUnicodeCharacter{00B3}{\ensuremath{^3}} \DeclareUnicodeCharacter{2074}{\ensuremath{^4}} \DeclareUnicodeCharacter{2075}{\ensuremath{^5}} \DeclareUnicodeCharacter{2076}{\ensuremath{^6}} \DeclareUnicodeCharacter{2077}{\ensuremath{^7}} \DeclareUnicodeCharacter{2078}{\ensuremath{^8}} \DeclareUnicodeCharacter{2079}{\ensuremath{^9}} \DeclareUnicodeCharacter{207B}{\ensuremath{^-}} \DeclareUnicodeCharacter{00B0}{\ensuremath{^{\circ}}} \DeclareUnicodeCharacter{2032}{\ensuremath{^{\prime}}} \DeclareUnicodeCharacter{2033}{\ensuremath{^{\prime\prime}}} """ # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # -- Options for the linkcheck builder ---------------------------------------- # A timeout value, in seconds, for the linkcheck builder linkcheck_timeout = 60 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/conf/v2.py0000644000175100001660000003257015044713462021065 0ustar00runnerdocker# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # # Astropy shared Sphinx settings. These settings are shared between # astropy itself and affiliated packages. # # Note that not all possible configuration values are present in this file. # # All configuration values have a default; values that are commented out # serve to show the default. import os from collections import ChainMap from os import path import sphinx from packaging.version import Version try: import astropy except ImportError: ASTROPY_INSTALLED = False else: ASTROPY_INSTALLED = True from astropy.utils import minversion # -- General configuration ---------------------------------------------------- # The version check in Sphinx itself can only compare the major and # minor parts of the version number, not the micro. needs_sphinx = '4.2' SPHINX_LT_8_2 = Version(sphinx.__version__) < Version("8.2.dev") on_rtd = os.environ.get('READTHEDOCS', None) == 'True' # Configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { 'python': ('https://docs.python.org/3/', (None, 'http://data.astropy.org/intersphinx/python3.inv')), 'pythonloc': ('http://docs.python.org/', path.abspath(path.join(path.dirname(__file__), '..', 'local', 'python3_local_links.inv'))), 'numpy': ('https://numpy.org/doc/stable/', (None, 'http://data.astropy.org/intersphinx/numpy.inv')), 'scipy': ('https://docs.scipy.org/doc/scipy/', (None, 'http://data.astropy.org/intersphinx/scipy.inv')), 'matplotlib': ('https://matplotlib.org/stable/', (None, 'http://data.astropy.org/intersphinx/matplotlib.inv')), 'astropy': ('https://docs.astropy.org/en/stable/', None), 'h5py': ('https://docs.h5py.org/en/stable/', None), } # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # The reST default role (used for this markup: `text`) to use for all # documents. Set to the "smart" one. default_role = 'obj' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # This is added to the end of RST files - a good place to put substitutions to # be used globally. rst_epilog = """ .. _Astropy: https://www.astropy.org """ suppress_warnings = ['app.add_directive', ] # -- NumpyDoc X-Ref ------------------------ # Whether to create cross-references for the parameter types in the # Parameters, Other Parameters, Returns and Yields sections of the docstring. # Should be set = True in packages manually! included here as reference. # numpydoc_xref_param_type = False # Words not to cross-reference. Most likely, these are common words used in # parameter type descriptions that may be confused for classes of the same # name. This can be overwritten or modified in packages and is provided here for # convenience. numpydoc_xref_ignore = {"or", "of", "thereof", "default", "optional", "keyword-only", "instance", "type", "class", "subclass", "method"} # Mappings to fully qualified paths (or correct ReST references) for the # aliases/shortcuts used when specifying the types of parameters. # Numpy provides some defaults # https://github.com/numpy/numpydoc/blob/b352cd7635f2ea7748722f410a31f937d92545cc/numpydoc/xref.py#L62-L94 numpydoc_xref_aliases = { # Python terms "function": ":term:`python:function`", "iterator": ":term:`python:iterator`", "mapping": ":term:`python:mapping`", } # Aliases to Astropy's glossary. In packages these can be turned on with # ``numpydoc_xref_aliases.update(numpydoc_xref_aliases_astropy_glossary)`` # (if astropy is in the intersphinx mapping). numpydoc_xref_aliases_astropy_glossary = {} # works even if no Astropy if ASTROPY_INSTALLED and minversion(astropy, "4.3"): numpydoc_xref_aliases_astropy_glossary = { # general "-like": ":term:`astropy:-like`", # coordinates "angle-like": ":term:`astropy:angle-like`", "coordinate-like": ":term:`astropy:coordinate-like`", "frame-like": ":term:`astropy:frame-like`", # units "unit-like": ":term:`astropy:unit-like`", "quantity-like": ":term:`astropy:quantity-like`", # table "table-like": ":term:`astropy:table-like`", # time "time-like": ":term:`astropy:time-like`", } # Aliases to Astropy's physical types. In packages these can be turned on with # ``numpydoc_xref_aliases.update(numpydoc_xref_aliases_astropy_physical_type)`` # (if astropy is in the intersphinx mapping). numpydoc_xref_aliases_astropy_physical_type = {} # works even if no astropy if ASTROPY_INSTALLED and minversion(astropy, "4.3"): from astropy.units.physical import _name_physical_mapping for ptype in _name_physical_mapping.keys(): val = f":ref:`:ref: '{ptype}' `" # <= intersphinxed numpydoc_xref_aliases_astropy_physical_type[f"'{ptype}'"] = val del ptype, val, _name_physical_mapping # cleanup namespace # Convenient collection of all of astropy's options for numpydoc xref. # In packages all the astropy additions can be turned on with # ``numpydoc_xref_aliases.update(numpydoc_xref_astropy_aliases)`` # (if astropy is in the intersphinx mapping). numpydoc_xref_astropy_aliases = ChainMap( # important at the top numpydoc_xref_aliases_astropy_glossary, numpydoc_xref_aliases_astropy_physical_type ) # -- Project information ------------------------------------------------------ # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. #pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Settings for extensions and extension options ---------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.coverage', 'sphinx.ext.inheritance_diagram', 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', 'sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinxcontrib.jquery', 'numpydoc', 'sphinx_copybutton', 'pytest_doctestplus.sphinx.doctestplus', 'sphinx_astropy.ext.changelog_links', 'sphinx_astropy.ext.generate_config', 'sphinx_astropy.ext.intersphinx_toggle', 'sphinx_astropy.ext.missing_static', 'sphinx_automodapi.automodapi', 'sphinx_automodapi.smart_resolver', ] try: import matplotlib.sphinxext.plot_directive # noqa: F401 extensions += ['matplotlib.sphinxext.plot_directive'] # AttributeError is checked here in case matplotlib is installed but # Sphinx isn't. Note that this module is imported by the config file # generator, even if we're not building the docs. # We don't need to raise a warning or exception here as there are packages # that don't use the directive, and those who try to use it without mpl being # installed will get a nice "Unknown directive type" error at usage. except (ImportError, AttributeError): pass # Don't show summaries of the members in each class along with the # class' docstring numpydoc_show_class_members = False autosummary_generate = True automodapi_toctreedirnm = 'api' # Class documentation should contain *both* the class docstring and # the __init__ docstring autoclass_content = "both" # Render inheritance diagrams in SVG graphviz_output_format = "svg" graphviz_dot_args = ( '-Nfontsize=10', '-Nfontname=Helvetica Neue, Helvetica, Arial, sans-serif', '-Efontsize=10', '-Efontname=Helvetica Neue, Helvetica, Arial, sans-serif', '-Gfontsize=10', '-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif', ) if SPHINX_LT_8_2: graphviz_dot_args = list(graphviz_dot_args) # For sphinx-copybutton copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: " copybutton_prompt_is_regexp = True # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'pydata_sphinx_theme' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. html_last_updated_fmt = '%d %b %Y' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. html_theme_options = { "collapse_navigation": True, "icon_links": [], "navigation_depth": 2, "show_nav_level": 2, "use_edit_page_button": False } # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # -- Options for LaTeX output ------------------------------------------------ # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. latex_toplevel_sectioning = 'part' # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False latex_elements = {} # Additional stuff for the LaTeX preamble. latex_elements['preamble'] = r""" % Use a more modern-looking monospace font \usepackage{inconsolata} % The enumitem package provides unlimited nesting of lists and enums. % Sphinx may use this in the future, in which case this can be removed. % See https://bitbucket.org/birkenfeld/sphinx/issue/777/latex-output-too-deeply-nested \usepackage{enumitem} \setlistdepth{15} % In the parameters section, place a newline after the Parameters % header. (This is stolen directly from Numpy's conf.py, since it % affects Numpy-style docstrings). \usepackage{expdlist} \let\latexdescription=\description \def\description{\latexdescription{}{} \breaklabel} % Support the superscript Unicode numbers used by the "unicode" units % formatter \DeclareUnicodeCharacter{2070}{\ensuremath{^0}} \DeclareUnicodeCharacter{00B9}{\ensuremath{^1}} \DeclareUnicodeCharacter{00B2}{\ensuremath{^2}} \DeclareUnicodeCharacter{00B3}{\ensuremath{^3}} \DeclareUnicodeCharacter{2074}{\ensuremath{^4}} \DeclareUnicodeCharacter{2075}{\ensuremath{^5}} \DeclareUnicodeCharacter{2076}{\ensuremath{^6}} \DeclareUnicodeCharacter{2077}{\ensuremath{^7}} \DeclareUnicodeCharacter{2078}{\ensuremath{^8}} \DeclareUnicodeCharacter{2079}{\ensuremath{^9}} \DeclareUnicodeCharacter{207B}{\ensuremath{^-}} \DeclareUnicodeCharacter{00B0}{\ensuremath{^{\circ}}} \DeclareUnicodeCharacter{2032}{\ensuremath{^{\prime}}} \DeclareUnicodeCharacter{2033}{\ensuremath{^{\prime\prime}}} """ # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # -- Options for the linkcheck builder ---------------------------------------- # A timeout value, in seconds, for the linkcheck builder linkcheck_timeout = 60 ././@PaxHeader0000000000000000000000000000003000000000000010206 xustar0024 mtime=1754502973.095 sphinx_astropy-1.10/sphinx_astropy/ext/0000755000175100001660000000000015044713475020034 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/ext/__init__.py0000644000175100001660000000000115044713462022130 0ustar00runnerdocker ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/ext/changelog_links.py0000644000175100001660000000564015044713462023536 0ustar00runnerdocker# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This sphinx extension makes the issue numbers in the changelog into links to GitHub issues. """ import re from docutils.nodes import Text, reference BLOCK_PATTERN = re.compile(r'\[#.+\]', flags=re.DOTALL) ISSUE_PATTERN = re.compile('#[0-9]+') def process_changelog_links(app, doctree, docname): for rex in app.changelog_links_rexes: if rex.match(docname): break else: # if the doc doesn't match any of the changelog regexes, don't process return from sphinx.util import logging info = logging.getLogger(__name__).info info('[changelog_links] Adding changelog links to "{0}"'.format(docname)) for item in doctree.traverse(): if not isinstance(item, Text) or item.parent is None: continue # We build a new list of items to replace the current item. If # a link is found, we need to use a 'reference' item. children = [] # First cycle through blocks of issues (delimited by []) then # iterate inside each one to find the individual issues. prev_block_end = 0 for block in BLOCK_PATTERN.finditer(item): block_start, block_end = block.start(), block.end() children.append(Text(item[prev_block_end:block_start])) block = item[block_start:block_end] prev_end = 0 for m in ISSUE_PATTERN.finditer(block): start, end = m.start(), m.end() children.append(Text(block[prev_end:start])) issue_number = block[start:end] refuri = app.config.github_issues_url + issue_number[1:] children.append(reference(text=issue_number, name=issue_number, refuri=refuri)) prev_end = end prev_block_end = block_end # If no issues were found, this adds the whole item, # otherwise it adds the remaining text. children.append(Text(block[prev_end:block_end])) # If no blocks were found, this adds the whole item, otherwise # it adds the remaining text. children.append(Text(item[prev_block_end:])) # Replace item by the new list of items we have generated, # which may contain links. item.parent.replace(item, children) def setup_patterns_rexes(app): app.changelog_links_rexes = [re.compile(pat) for pat in app.config.changelog_links_docpattern] def setup(app): app.connect('doctree-resolved', process_changelog_links) app.connect('builder-inited', setup_patterns_rexes) app.add_config_value('github_issues_url', None, True) app.add_config_value('changelog_links_docpattern', ['.*changelog.*', 'whatsnew/.*'], True) return {'parallel_read_safe': True, 'parallel_write_safe': True} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/ext/edit_on_github.py0000644000175100001660000001346115044713462023372 0ustar00runnerdocker# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This extension makes it easy to edit documentation on github. It adds links associated with each docstring that go to the corresponding view source page on Github. From there, the user can push the "Edit" button, edit the docstring, and submit a pull request. It has the following configuration options (to be set in the project's ``conf.py``): * ``edit_on_github_project`` The name of the github project, in the form "username/projectname". * ``edit_on_github_branch`` The name of the branch to edit. If this is a released version, this should be a git tag referring to that version. For a dev version, it often makes sense for it to be "main". It may also be a git hash. * ``edit_on_github_source_root`` The location within the source tree of the root of the Python package. Defaults to "lib". * ``edit_on_github_doc_root`` The location within the source tree of the root of the documentation source. Defaults to "doc", but it may make sense to set it to "doc/source" if the project uses a separate source directory. * ``edit_on_github_docstring_message`` The phrase displayed in the links to edit a docstring. Defaults to "[edit on github]". * ``edit_on_github_page_message`` The phrase displayed in the links to edit a RST page. Defaults to "[edit this page on github]". * ``edit_on_github_help_message`` The phrase displayed as a tooltip on the edit links. Defaults to "Push the Edit button on the next page" * ``edit_on_github_skip_regex`` When the path to the .rst file matches this regular expression, no "edit this page on github" link will be added. Defaults to ``"_.*"``. """ import inspect import os import re import sys from docutils import nodes from sphinx import addnodes def import_object(modname, name): """ Import the object given by *modname* and *name* and return it. If not found, or the import fails, returns None. """ try: __import__(modname) mod = sys.modules[modname] obj = mod for part in name.split('.'): obj = getattr(obj, part) return obj except: return None def get_url_base(app): return 'https://github.com/%s/tree/%s/' % ( app.config.edit_on_github_project, app.config.edit_on_github_branch) def doctree_read(app, doctree): # Get the configuration parameters if app.config.edit_on_github_project == 'REQUIRED': raise ValueError( "The edit_on_github_project configuration variable must be " "provided in the conf.py") source_root = app.config.edit_on_github_source_root url = get_url_base(app) docstring_message = app.config.edit_on_github_docstring_message # Handle the docstring-editing links for objnode in doctree.traverse(addnodes.desc): if objnode.get('domain') != 'py': continue names = set() for signode in objnode: if not isinstance(signode, addnodes.desc_signature): continue modname = signode.get('module') if not modname: continue fullname = signode.get('fullname') if fullname in names: # only one link per name, please continue names.add(fullname) obj = import_object(modname, fullname) anchor = None if obj is not None: try: lines, lineno = inspect.getsourcelines(obj) except: pass else: anchor = '#L%d' % lineno if anchor: real_modname = inspect.getmodule(obj).__name__ path = '%s%s%s.py%s' % ( url, source_root, real_modname.replace('.', '/'), anchor) onlynode = addnodes.only(expr='html') onlynode += nodes.reference( reftitle=app.config.edit_on_github_help_message, refuri=path) onlynode[0] += nodes.inline( '', '', nodes.raw('', ' ', format='html'), nodes.Text(docstring_message), classes=['edit-on-github', 'viewcode-link']) signode += onlynode def html_page_context(app, pagename, templatename, context, doctree): if (templatename == 'page.html' and not re.match(app.config.edit_on_github_skip_regex, pagename)): doc_root = app.config.edit_on_github_doc_root if doc_root != '' and not doc_root.endswith('/'): doc_root += '/' doc_path = os.path.relpath(doctree.get('source'), app.builder.srcdir) url = get_url_base(app) page_message = app.config.edit_on_github_page_message context['edit_on_github'] = url + doc_root + doc_path context['edit_on_github_page_message'] = page_message def setup(app): app.add_config_value('edit_on_github_project', 'REQUIRED', True) app.add_config_value('edit_on_github_branch', 'main', True) app.add_config_value('edit_on_github_source_root', 'lib', True) app.add_config_value('edit_on_github_doc_root', 'doc', True) app.add_config_value('edit_on_github_docstring_message', '[edit on github]', True) app.add_config_value('edit_on_github_page_message', 'Edit This Page on Github', True) app.add_config_value('edit_on_github_help_message', 'Push the Edit button on the next page', True) app.add_config_value('edit_on_github_skip_regex', '_.*', True) app.connect('doctree-read', doctree_read) app.connect('html-page-context', html_page_context) return {'parallel_read_safe': True, 'parallel_write_safe': True} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/ext/generate_config.py0000644000175100001660000000160215044713462023520 0ustar00runnerdockerimport io from docutils import nodes from docutils.parsers.rst import Directive class GenerateConfig(Directive): """ Directive to generate the configuration file for a package and include it in the documentation as a literal code block. This relies on the ``generate_config`` function, added in Astropy 4.1. Example:: .. generate_config:: astropy """ has_content = False required_arguments = 1 def run(self): from astropy.config import generate_config buf = io.StringIO() generate_config(pkgname=self.arguments[0], filename=buf) text = buf.getvalue() node = nodes.literal_block(text, text) return [node] def setup(app): app.add_directive("generate_config", GenerateConfig) return { 'version': '0.1', 'parallel_read_safe': True, 'parallel_write_safe': True, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/ext/intersphinx_toggle.py0000644000175100001660000000157215044713462024323 0ustar00runnerdocker# Licensed under a 3-clause BSD style license - see LICENSE.rst """ The purpose of this extension is to provide a configuration value that can be used to disable intersphinx on the command-line without editing conf.py. To use, you can build documentation with:: sphinx-build ... -D disable_intersphinx=1 This is used e.g. by astropy-helpers when using the build_docs command. """ from sphinx.util.console import bold from sphinx.util import logging def disable_intersphinx(app, config=None): info = logging.getLogger(__name__).info if app.config.disable_intersphinx: info(bold('disabling intersphinx...')) app.config.intersphinx_mapping.clear() def setup(app): app.connect('config-inited', disable_intersphinx) app.add_config_value('disable_intersphinx', 0, True) return {'parallel_read_safe': True, 'parallel_write_safe': True} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/ext/missing_static.py0000644000175100001660000000170715044713462023427 0ustar00runnerdocker# Licensed under a 3-clause BSD style license - see LICENSE.rst """ The purpose of this extension is to give a clear warning if sphinx is expecting a static directory to be present but it isn't. """ import os from sphinx.util import logging WARNING_TEMPLATE = """ Note: The static directory '{0}' was not found. This is often because it is empty and you are using git. If so, you don't need it, so make sure it isn't included in the html_static_path setting in your conf.py file, otherwise Sphinx may fail the build if you are turning warnings into errors. """ def static_warning(app, config=None): info = logging.getLogger(__name__).info for directory in app.config.html_static_path: if not os.path.exists(directory): info(WARNING_TEMPLATE.format(directory)) def setup(app): app.connect('build-finished', static_warning) return {'parallel_read_safe': True, 'parallel_write_safe': True} ././@PaxHeader0000000000000000000000000000003000000000000010206 xustar0024 mtime=1754502973.095 sphinx_astropy-1.10/sphinx_astropy/local/0000755000175100001660000000000015044713475020326 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/local/python3_local_links.inv0000644000175100001660000000122215044713462025013 0ustar00runnerdocker# Sphinx inventory version 2 # Project: Python # Version: 3.5 # The remainder of this file should be compressed using zlib. x0{b$.!YTUa*!Qq{h\;ٯgɁlv VA#jolGN dk~#k40Zv]'`Z*H? %Z_H{\aj% Gব,:j'/xU2(j%PR\7(j֥5J?,Cf/բO4FZsz ouЏO l;4`6yDMA-}Jwq!dj!#T" h2oS߈~` t8RwjnKcRxr?%+\Ob 3s˻`Vһv@>2b;!I,=Wh_'l!Q%^B#Ô }inuD#e³\:{tu;/wxy. !nX{0BzoH /LxA&UXS{⮸5ߣ\RBiJF?././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/local/python3_local_links.txt0000644000175100001660000000540415044713462025044 0ustar00runnerdocker# Sphinx inventory version 2 # Project: Python # Version: 2.7 and 3.5 # The remainder of this file should be compressed using zlib. # python2 only links cPickle py:module -1 2/library/pickle.html#module-cPickle - unicode py:function -1 2/library/functions.html#unicode - bsddb py:module -1 2/library/bsddb.html#module-bsddb - dict.has_key py:method -1 2/library/stdtypes.html#dict.has_key - dict.iteritems py:method -1 2/library/stdtypes.html#dict.iteritems - dict.iterkeys py:method -1 2/library/stdtypes.html#dict.iterkeys - dict.itervalues py:method -1 2/library/stdtypes.html#dict.itervalues - urllib2.urlopen py:function -1 2/library/urllib2.html#urllib2.urlopen - # python3 print() py:function -1 3/library/functions.html#print - # python3 collections.abc collections.Container py:class -1 3/library/collections.abc.html#collections.abc.Container - collections.Hashable py:class -1 3/library/collections.abc.html#collections.abc.Hashable - collections.Sized py:class -1 3/library/collections.abc.html#collections.abc.Sized - collections.Callable py:class -1 3/library/collections.abc.html#collections.abc.Callable - collections.Iterable py:class -1 3/library/collections.abc.html#collections.abc.Iterable - collections.Iterator py:class -1 3/library/collections.abc.html#collections.abc.Iterator - collections.Generator py:class -1 3/library/collections.abc.html#collections.abc.Generator - collections.Sequence py:class -1 3/library/collections.abc.html#collections.abc.Sequence - collections.MutableSequence py:class -1 3/library/collections.abc.html#collections.abc.MutableSequence - collections.ByteString py:class -1 3/library/collections.abc.html#collections.abc.ByteString - collections.Set py:class -1 3/library/collections.abc.html#collections.abc.Set - collections.MutableSet py:class -1 3/library/collections.abc.html#collections.abc.MutableSet - collections.Mapping py:class -1 3/library/collections.abc.html#collections.abc.Mapping - collections.MutableMapping py:class -1 3/library/collections.abc.html#collections.abc.MutableMapping - collections.MappingView py:class -1 3/library/collections.abc.html#collections.abc.MappingView - collections.ItemsView py:class -1 3/library/collections.abc.html#collections.abc.ItemsView - collections.KeysView py:class -1 3/library/collections.abc.html#collections.abc.KeysView - collections.ValuesView py:class -1 3/library/collections.abc.html#collections.abc.ValuesView - collections.Awaitable py:class -1 3/library/collections.abc.html#collections.abc.Awaitable - collections.Coroutine py:class -1 3/library/collections.abc.html#collections.abc.Coroutine - collections.AsyncIterable py:class -1 3/library/collections.abc.html#collections.abc.AsyncIterable - collections.AsyncIterator py:class -1 3/library/collections.abc.html#collections.abc.AsyncIterator - ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1754502973.0960002 sphinx_astropy-1.10/sphinx_astropy/tests/0000755000175100001660000000000015044713475020376 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/tests/__init__.py0000644000175100001660000000000015044713462022471 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/tests/test_conf_v1.py0000644000175100001660000000226715044713462023345 0ustar00runnerdockerfrom sphinx.cmd.build import build_main BASIC_CONF = """ from sphinx_astropy.conf import * suppress_warnings = ['app.add_directive', 'app.add_node', 'app.add_role'] """ BASIC_INDEX = """ Title ===== Just a test """ def generate_files(tmpdir): with open(tmpdir.join('conf.py').strpath, 'w') as f: f.write(BASIC_CONF) with open(tmpdir.join('index.rst').strpath, 'w') as f: f.write(BASIC_INDEX) def test_conf(tmpdir): # Just make sure the docs build with the default sphinx-astropy configuration generate_files(tmpdir) src_dir = tmpdir.strpath html_dir = tmpdir.mkdir('html').strpath status = build_main(argv=['-W', '-b', 'html', src_dir, html_dir]) assert status == 0 def test_intersphinx_toggle(tmpdir, capsys): # Test the sphinx_astropy.ext.intersphinx_toggle extension generate_files(tmpdir) src_dir = tmpdir.strpath html_dir = tmpdir.mkdir('html').strpath status = build_main(argv=['-W', '-b', 'html', src_dir, html_dir, '-D', 'disable_intersphinx=1']) assert status == 0 captured = capsys.readouterr() assert 'disabling intersphinx' in captured.out assert 'loading intersphinx' not in captured.out ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/sphinx_astropy/tests/test_conf_v2.py0000644000175100001660000000234015044713462023336 0ustar00runnerdockerimport pytest pytest.importorskip("pydata_sphinx_theme") from sphinx.cmd.build import build_main # noqa: E402 BASIC_CONF = """ from sphinx_astropy.conf.v2 import * suppress_warnings = ['app.add_directive', 'app.add_node', 'app.add_role'] """ BASIC_INDEX = """ Title ===== Just a test """ def generate_files(tmp_path): f1 = tmp_path / "conf.py" f1.write_text(BASIC_CONF) f2 = tmp_path / "index.rst" f2.write_text(BASIC_INDEX) def test_conf(tmp_path): # Make sure the docs build with the v2 sphinx-astropy configuration generate_files(tmp_path) src_dir = str(tmp_path) html_dir = str(tmp_path / "html") status = build_main(argv=['-W', '-b', 'html', src_dir, html_dir]) assert status == 0 def test_intersphinx_toggle(tmp_path, capsys): # Test the sphinx_astropy.ext.intersphinx_toggle extension generate_files(tmp_path) src_dir = str(tmp_path) html_dir = str(tmp_path / "html") status = build_main(argv=['-W', '-b', 'html', src_dir, html_dir, '-D', 'disable_intersphinx=1']) assert status == 0 captured = capsys.readouterr() assert 'disabling intersphinx' in captured.out assert 'loading intersphinx' not in captured.out ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502973.0 sphinx_astropy-1.10/sphinx_astropy/version.py0000644000175100001660000000077415044713475021303 0ustar00runnerdocker# file generated by setuptools-scm # don't change, don't track in version control __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"] TYPE_CHECKING = False if TYPE_CHECKING: from typing import Tuple from typing import Union VERSION_TUPLE = Tuple[Union[int, str], ...] else: VERSION_TUPLE = object version: str __version__: str __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE __version__ = version = '1.10' __version_tuple__ = version_tuple = (1, 10) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1754502973.0960002 sphinx_astropy-1.10/sphinx_astropy.egg-info/0000755000175100001660000000000015044713475020726 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502973.0 sphinx_astropy-1.10/sphinx_astropy.egg-info/PKG-INFO0000644000175100001660000000765115044713475022034 0ustar00runnerdockerMetadata-Version: 2.4 Name: sphinx-astropy Version: 1.10 Summary: Sphinx extensions and configuration specific to the Astropy project Home-page: https://github.com/astropy/sphinx-astropy Author: The Astropy Developers Author-email: astropy.team@gmail.com License: BSD Classifier: Intended Audience :: Developers Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Operating System :: OS Independent Classifier: License :: OSI Approved :: BSD License Requires-Python: >=3.9 Description-Content-Type: text/x-rst License-File: LICENSE.rst Requires-Dist: packaging Requires-Dist: sphinx>=4.0.0 Requires-Dist: astropy-sphinx-theme Requires-Dist: numpydoc Requires-Dist: sphinx-automodapi Requires-Dist: sphinx-gallery Requires-Dist: sphinxcontrib-jquery Requires-Dist: pillow Requires-Dist: pytest-doctestplus>=0.11 Provides-Extra: confv2 Requires-Dist: pydata-sphinx-theme; extra == "confv2" Requires-Dist: sphinx-copybutton; extra == "confv2" Provides-Extra: all Requires-Dist: astropy; extra == "all" Provides-Extra: tests Requires-Dist: pytest; extra == "tests" Dynamic: license-file About ===== .. image:: https://zenodo.org/badge/119399685.svg :target: https://zenodo.org/badge/latestdoi/119399685 :alt: Zenodo DOI .. image:: https://github.com/astropy/sphinx-astropy/actions/workflows/python-tests.yml/badge.svg :target: https://github.com/astropy/sphinx-astropy/actions/workflows/python-tests.yml :alt: CI Status This package serves two purposes: it provides a default Sphinx configuration and set of extensions specific to the Astropy project, and it acts as a meta-package by installing all required Sphinx extensions for the core Astropy package and other packages. Sphinx configuration -------------------- The default Sphinx configuration can be imported by putting: .. code-block:: python from sphinx_astropy.conf import * at the top of your ``conf.py`` file. You can then override specific settings from this default configuration, such as adding extensions or intersphinx packages. To give a clearer error messages for users, you can instead write: .. code-block:: python try: from sphinx_astropy.conf import * except ImportError: print('ERROR: the documentation requires the sphinx-astropy package to be installed') sys.exit(1) Dependencies/extensions ----------------------- Installing **sphinx-astropy** will automatically install (if not already present): * `Sphinx `_ * `astropy-sphinx-theme `_ - the default 'bootstrap' theme use by Astropy and a number of affiliated packages. This goes with `sphinx_astropy.conf.v1`. * `sphinx-automodapi `_ - an extension that makes it easy to automatically generate API documentation. * `sphinx-gallery `_ - an extension to generate example galleries * `numpydoc `_ - an extension to parse docstrings in NumpyDoc format * `pillow `_ - a package to deal with images, used by some examples in the astropy core documentation. * `pytest-doctestplus `_ - providing the 'doctestplus' extension to skip code snippets in narrative documentation. pydata-sphinx-theme (confv2) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ To use the new `pydata-sphinx-theme` with `sphinx_astropy.conf.v2`, you have to install the optional `[confv2]` dependencies:: pip install sphinx-astropy[confv2] That would pull in the following as well: * `pydata-sphinx-theme `_ - a clean, three-column, Bootstrap-based Sphinx theme by and for the `PyData community `_. * `sphinx-copybutton `_ - a small Sphinx extension to add a "copy" button to code blocks. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502973.0 sphinx_astropy-1.10/sphinx_astropy.egg-info/SOURCES.txt0000644000175100001660000000173515044713475022620 0ustar00runnerdocker.gitignore .mailmap CHANGES.rst LICENSE.rst MANIFEST.in README.rst pyproject.toml setup.cfg tox.ini .github/dependabot.yml .github/release.yml .github/workflows/publish.yml .github/workflows/python-tests.yml sphinx_astropy/__init__.py sphinx_astropy/version.py sphinx_astropy.egg-info/PKG-INFO sphinx_astropy.egg-info/SOURCES.txt sphinx_astropy.egg-info/dependency_links.txt sphinx_astropy.egg-info/not-zip-safe sphinx_astropy.egg-info/requires.txt sphinx_astropy.egg-info/top_level.txt sphinx_astropy/conf/__init__.py sphinx_astropy/conf/v1.py sphinx_astropy/conf/v2.py sphinx_astropy/ext/__init__.py sphinx_astropy/ext/changelog_links.py sphinx_astropy/ext/edit_on_github.py sphinx_astropy/ext/generate_config.py sphinx_astropy/ext/intersphinx_toggle.py sphinx_astropy/ext/missing_static.py sphinx_astropy/local/python3_local_links.inv sphinx_astropy/local/python3_local_links.txt sphinx_astropy/tests/__init__.py sphinx_astropy/tests/test_conf_v1.py sphinx_astropy/tests/test_conf_v2.py././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502973.0 sphinx_astropy-1.10/sphinx_astropy.egg-info/dependency_links.txt0000644000175100001660000000000115044713475024774 0ustar00runnerdocker ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502972.0 sphinx_astropy-1.10/sphinx_astropy.egg-info/not-zip-safe0000644000175100001660000000000115044713474023153 0ustar00runnerdocker ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502973.0 sphinx_astropy-1.10/sphinx_astropy.egg-info/requires.txt0000644000175100001660000000033315044713475023325 0ustar00runnerdockerpackaging sphinx>=4.0.0 astropy-sphinx-theme numpydoc sphinx-automodapi sphinx-gallery sphinxcontrib-jquery pillow pytest-doctestplus>=0.11 [all] astropy [confv2] pydata-sphinx-theme sphinx-copybutton [tests] pytest ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502973.0 sphinx_astropy-1.10/sphinx_astropy.egg-info/top_level.txt0000644000175100001660000000001715044713475023456 0ustar00runnerdockersphinx_astropy ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1754502962.0 sphinx_astropy-1.10/tox.ini0000644000175100001660000000141215044713462015447 0ustar00runnerdocker[tox] envlist = py{39,310,311,312,313}-test{-v2deps}-sphinx{_oldest,53,62,70,71,72,80,81,82,dev} codestyle [testenv] changedir = .tmp/{envname} description = run tests extras = tests v2deps: confv2 deps = sphinx_oldest: sphinx==4.0.0 sphinx53: sphinx==5.3.* sphinx62: sphinx==6.2.* sphinx70: sphinx==7.0.* sphinx71: sphinx==7.1.* sphinx72: sphinx==7.2.* sphinx80: sphinx==8.0.* sphinx81: sphinx==8.1.* sphinx82: sphinx==8.2.* sphinxdev: git+https://github.com/sphinx-doc/sphinx#egg=sphinx commands = pip freeze pytest {toxinidir}/sphinx_astropy {posargs} [testenv:codestyle] changedir = skip_install = true description = check code style, e.g. with flake8 deps = flake8 commands = flake8 sphinx_astropy --count