sphinx-automodapi-0.12/0000755000077000000240000000000013525230465015030 5ustar tomstaff00000000000000sphinx-automodapi-0.12/.coveragerc0000644000077000000240000000030213523222665017145 0ustar tomstaff00000000000000[run] source = sphinx_automodapi omit = */tests/* [paths] source = sphinx_automodapi/ */site-packages/sphinx_automodapi *\site-packages\sphinx_automodapi [report] omit = */tests/* sphinx-automodapi-0.12/.gitignore0000644000077000000240000000101413233635533017015 0ustar tomstaff00000000000000# 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-automodapi-0.12/CHANGES.rst0000644000077000000240000000474113525230154016633 0ustar tomstaff00000000000000Changes in sphinx-automodapi ============================ 0.12 (2019-08-15) ----------------- - Fixed compatibility with Sphinx 2.0 and later. [#86] - Updated required version of Sphinx to 1.7 and later. [#88] 0.11 (2019-05-29) ----------------- - Added a global configuration option ``automodapi_inheritance_diagram`` to control whether inheritance diagrams are shown by default. [#75] - Fix bug with smart_resolver when intersphinx inventory doesn't include any py:class entries. [#76] - Fixed compatibility with Sphinx 2.0 and later. [#79] 0.10 (2019-01-09) ----------------- - Fixed compatibility with latest developer version of Sphinx. [#61] 0.9 (2018-11-07) ---------------- - Fix issue with ABC-derived classes (``abc`` and ``collections.abc`` modules) having their members ignored in Python 3. This was only an issue when ``:inherited-members:`` was not in effect. [#53] 0.8 (2018-10-18) ---------------- - Fixed compatibility with Sphinx 1.8.x. [#51] - Make all extensions parallel-friendly. [#44] 0.7 (2018-01-18) ---------------- - Fix compatibility with Sphinx 1.7.x. [#43] 0.6 (2017-07-05) ---------------- - Fix encoding issues on platforms that default to e.g. ASCII encoding. [#33] 0.5 (2017-05-29) ---------------- - Fix a bug that caused the :inherited-members: option to apply to all subsequent automodapi directives. [#25] 0.4 (2017-05-24) ---------------- - Fix compatibility with Sphinx 1.6 and 1.7. [#22, #23] - Introduce a new ``:include-all-objects:`` option to ``automodapi`` that will include not just functions and classes in a module, but also all other objects. To help this, introduce a new ``:variables-only:`` option for ``automodsumm``. [#24] 0.3 (2017-02-20) ---------------- - Fixed installation on Python 3.4. [#21] 0.2 (2016-12-28) ---------------- - Suppress warning about re-defining autoattribute in recent versions of Sphinx. [#8] - Avoid hard-coding sphinx_automodapi module name in case this extension is bundled into another package. [#12] - Fix use of automodapi when source files are inside a source directory. [#16] - Make sure generated rst is tidy and doesn't include extraneous whitespace. [#18] 0.1 (2016-12-12) ---------------- - Fixed a bug that caused the automodapi directive to not work properly when the main module docstring was not included. [#3] - Fixed a bug that caused skipped classes in automodapi directives to still be included in inheritance diagrams. [#3] - Original code taken out of astropy-helpers sphinx-automodapi-0.12/LICENSE.rst0000644000077000000240000000273013233635533016647 0ustar tomstaff00000000000000Copyright (c) 2014-2016, 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. sphinx-automodapi-0.12/MANIFEST.in0000644000077000000240000000013213233635533016563 0ustar tomstaff00000000000000include README.rst include CHANGES.rst include LICENSE.rst exclude *.pyc *.o prune build sphinx-automodapi-0.12/PKG-INFO0000644000077000000240000000371713525230465016135 0ustar tomstaff00000000000000Metadata-Version: 2.1 Name: sphinx-automodapi Version: 0.12 Summary: Sphinx extension for auto-generating API documentation for entire modules Home-page: http://astropy.org Author: The Astropy Developers Author-email: astropy.team@gmail.com License: BSD 3-Clause License Description: |Azure Status| |Coverage Status| |PyPI| About ===== This is a Sphinx extension to automatically generate API pages for whole modules. It was originally developed for the Astropy project but is now available as a standalone package since it can be used for any other package. The documentation can be found on `ReadTheDocs `_. Running tests ------------- To run the tests, you can either do:: pytest sphinx_automodapi or if you have `tox `_ installed:: tox -e test .. |Azure Status| image:: https://dev.azure.com/astropy-project/sphinx-automodapi/_apis/build/status/astropy.sphinx-automodapi?branchName=master :target: https://dev.azure.com/astropy-project/sphinx-automodapi/_build/latest?definitionId=2&branchName=master .. |Coverage Status| image:: https://codecov.io/gh/astropy/sphinx-automodapi/branch/master/graph/badge.svg :target: https://codecov.io/gh/astropy/sphinx-automodapi .. |PyPI| image:: https://img.shields.io/pypi/v/sphinx-automodapi.svg :target: https://pypi.python.org/pypi/sphinx-automodapi Platform: UNKNOWN Classifier: Development Status :: 3 - Alpha Classifier: Intended Audience :: Developers Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 3 Classifier: Operating System :: OS Independent Classifier: License :: OSI Approved :: BSD License Provides-Extra: test sphinx-automodapi-0.12/README.rst0000644000077000000240000000214613525230047016516 0ustar tomstaff00000000000000|Azure Status| |Coverage Status| |PyPI| About ===== This is a Sphinx extension to automatically generate API pages for whole modules. It was originally developed for the Astropy project but is now available as a standalone package since it can be used for any other package. The documentation can be found on `ReadTheDocs `_. Running tests ------------- To run the tests, you can either do:: pytest sphinx_automodapi or if you have `tox `_ installed:: tox -e test .. |Azure Status| image:: https://dev.azure.com/astropy-project/sphinx-automodapi/_apis/build/status/astropy.sphinx-automodapi?branchName=master :target: https://dev.azure.com/astropy-project/sphinx-automodapi/_build/latest?definitionId=2&branchName=master .. |Coverage Status| image:: https://codecov.io/gh/astropy/sphinx-automodapi/branch/master/graph/badge.svg :target: https://codecov.io/gh/astropy/sphinx-automodapi .. |PyPI| image:: https://img.shields.io/pypi/v/sphinx-automodapi.svg :target: https://pypi.python.org/pypi/sphinx-automodapi sphinx-automodapi-0.12/azure-pipelines.yml0000644000077000000240000000054513523507262020673 0ustar tomstaff00000000000000schedules: - cron: '0 8 1 * *' displayName: 'Monthly cron' branches: include: - master always: 'true' jobs: - template: azure-template.yml parameters: name: Linux os: linux - template: azure-template.yml parameters: name: MacOSX os: macosx - template: azure-template.yml parameters: name: Windows os: windows sphinx-automodapi-0.12/azure-template.yml0000644000077000000240000000332113523222665020512 0ustar tomstaff00000000000000jobs: - job: ${{ format(parameters.name) }} pool: ${{ if eq(parameters.os, 'macosx') }}: vmImage: macOS 10.13 ${{ if eq(parameters.os, 'linux') }}: vmImage: Ubuntu 16.04 ${{ if eq(parameters.os, 'windows') }}: vmImage: vs2017-win2016 steps: - ${{ if eq(parameters.os, 'macosx') }}: - script: brew install graphviz displayName: Installing graphviz - ${{ if eq(parameters.os, 'linux') }}: - script: sudo apt-get install -y graphviz displayName: Installing graphviz - ${{ if eq(parameters.os, 'windows') }}: - script: choco install graphviz vcpython27 curl codecov --no-progress displayName: Installing graphviz, vcpython27, curl, and codecov - task: UsePythonVersion@0 inputs: versionSpec: '2.7' architecture: 'x64' - task: UsePythonVersion@0 inputs: versionSpec: '3.5' architecture: 'x64' - task: UsePythonVersion@0 inputs: versionSpec: '3.6' architecture: 'x64' - task: UsePythonVersion@0 inputs: versionSpec: '3.7' architecture: 'x64' - script: pip install tox coverage displayName: Installing tox and coverage - script: tox displayName: Running tests with tox - bash: coverage combine .tmp/*/.coverage displayName: Combining coverage results - bash: coverage report displayName: Show coverage # As described in https://github.com/codecov/codecov-bash/issues/189, the # official bash script doesn't use the correct variable names for pull # requests, so we use a fork of the bash script for now. - bash: bash <(curl https://raw.githubusercontent.com/astrofrog/codecov-bash/fixed-azure/codecov) -t $(codecov.token) displayName: Uploading results to codecov sphinx-automodapi-0.12/docs/0000755000077000000240000000000013525230464015757 5ustar tomstaff00000000000000sphinx-automodapi-0.12/docs/Makefile0000644000077000000240000001674213233635533017433 0ustar tomstaff00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " applehelp to make an Apple Help Book" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " epub3 to make an epub3" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " coverage to run coverage check of the documentation (if enabled)" @echo " dummy to check syntax errors of document sources" .PHONY: clean clean: rm -rf $(BUILDDIR)/* .PHONY: html html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." .PHONY: dirhtml dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." .PHONY: singlehtml singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." .PHONY: pickle pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." .PHONY: json json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." .PHONY: htmlhelp htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." .PHONY: qthelp qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/sphinx-automodapi.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/sphinx-automodapi.qhc" .PHONY: applehelp applehelp: $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp @echo @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." @echo "N.B. You won't be able to view it unless you put it in" \ "~/Library/Documentation/Help or install it in your application" \ "bundle." .PHONY: devhelp devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/sphinx-automodapi" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/sphinx-automodapi" @echo "# devhelp" .PHONY: epub epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." .PHONY: epub3 epub3: $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 @echo @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." .PHONY: latex latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." .PHONY: latexpdf latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: latexpdfja latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: text text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." .PHONY: man man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." .PHONY: texinfo texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." .PHONY: info info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." .PHONY: gettext gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." .PHONY: changes changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." .PHONY: linkcheck linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." .PHONY: doctest doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." .PHONY: coverage coverage: $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage @echo "Testing of coverage in the sources finished, look at the " \ "results in $(BUILDDIR)/coverage/python.txt." .PHONY: xml xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." .PHONY: pseudoxml pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." .PHONY: dummy dummy: $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy @echo @echo "Build finished. Dummy builder generates no files." sphinx-automodapi-0.12/docs/automodapi.rst0000644000077000000240000000177413233635533020666 0ustar tomstaff00000000000000Automatically generating module documentation with automodapi ============================================================= .. _automodapi: Overview -------- The main Sphinx directive provided by the sphinx-automodapi package is the ``automodapi`` directive. As described in the :ref:`quickstart` guide, before you use the directive, you will need to make sure the following extension is included in the ``extensions`` entry of your documentation's ``conf.py`` file:: extensions = ['sphinx_automodapi.automodapi'] You can then add an ``automodapi`` block anywhere that you want to generate documentation for a module:: .. automodapi:: mypackage.mymodule This will add a section with the docstring of the module, followed by a list of functions, and by a list of classes. For each function and class, a full API page will be generated. The automodapi directive and allowed options are described in more detail below. In detail --------- .. automodule:: sphinx_automodapi.automodapi sphinx-automodapi-0.12/docs/automodsumm.rst0000644000077000000240000000154413233635533021071 0ustar tomstaff00000000000000Generating tables of module objects with automodsumm ==================================================== .. _automodsumm: Overview -------- The ``automodsumm`` directive takes all objects in a module and generates a table of these objects and associated API pages. The :ref:`automodapi ` directive then calls ``automodsumm`` once for functions and once for classes, and adds the module docstring - but effectively, the bulk of the work in creating the API tables and pages is done by ``automodsumm``. Nevertheless, in most cases, users should not need to call ``automodsumm`` directly, except if finer control is desired. The syntax of the directive is:: .. automodsumm:: mypackage.mymodule The automodsumm directive is described in more detail below. In detail --------- .. automodule:: sphinx_automodapi.automodsumm sphinx-automodapi-0.12/docs/conf.py0000644000077000000240000000365013525230216017255 0ustar tomstaff00000000000000#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # -- General configuration ------------------------------------------------ # 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.autosummary'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = 'sphinx-automodapi' copyright = '2016, The Astropy Developers' author = 'The Astropy Developers' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0.12' # The full version, including alpha/beta/rc tags. release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # -- 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 = 'sphinx_rtd_theme' # Output file base name for HTML help builder. htmlhelp_basename = 'sphinx-automodapidoc' nitpicky = True sphinx-automodapi-0.12/docs/index.rst0000644000077000000240000000540113525230047017615 0ustar tomstaff00000000000000Documentation for sphinx-automodapi =================================== The sphinx-automodapi package provides Sphinx directives that help faciliate the automatic generation of API documentation pages for Python package modules. It was originally developped for the Astropy project, but is now developed as a standalone package that can be used for any project. Installation ------------ This extension requires Sphinx 1.7 or later, and can be installed with:: pip install sphinx-automodapi The extension is also available through conda package management system. It can be installed with:: conda install -c astropy sphinx-automodapi .. _quickstart: Quick start ----------- To use this extension, you will need to add the following entry to the ``extensions`` list in your Sphinx ``conf.py`` file:: extensions = ['sphinx_automodapi.automodapi'] numpydoc_show_class_members = False You can then add an ``automodapi`` block anywhere that you want to generate documentation for a module:: .. automodapi:: mypackage.mymodule This will add a section with the docstring of the module, followed by a list of functions, and by a list of classes. For each function and class, a full API page will be generated. The ``numpydoc_show_class_members=False`` option is needed to avoid having methods and attributes of classes being shown multiple times. By default, sphinx_automodapi will try and make a diagram showing an inheritance graph of all the classes in the module. This requires graphviz to be installed. To disable the inheritance diagram, you can do:: .. automodapi:: mypackage.mymodule :no-inheritance-diagram: The ``automodapi`` directive takes other options that are described in more detail in the `User guide`_ below. If you are documenting a module which imports classes from other files, and you want to include an inheritance diagram for the classes, you may run into Sphinx warnings, because the class may be documented as e.g. ``astropy.table.Table`` but the class really lives at ``astropy.table.core.Table``. To fix this you can make use of the ``'sphinx_automodapi.smart_resolver'`` Sphinx extension, which will automatically try and resolve such differences. In this, case, be sure to include:: extensions = ['sphinx_automodapi.automodapi', 'sphinx_automodapi.smart_resolver'] in your ``conf.py`` file. User guide ---------- .. toctree:: :maxdepth: 1 automodapi.rst automodsumm.rst Dependency Version Guidelines ----------------------------- As a general guideline, automodapi dependencies (at the time of writing, just Sphinx) aim to maintain compatibility with versions <= 2 years old. Dependencies may be newer, however, if specific features become important to help automodapi work better or be more maintainable. sphinx-automodapi-0.12/setup.cfg0000644000077000000240000000165613525230465016661 0ustar tomstaff00000000000000[metadata] name = sphinx-automodapi version = attr:sphinx_automodapi.__version__ description = Sphinx extension for auto-generating API documentation for entire modules long_description = file:README.rst author = The Astropy Developers author_email = astropy.team@gmail.com license = BSD 3-Clause License url = http://astropy.org classifiers = Development Status :: 3 - Alpha Intended Audience :: Developers Programming Language :: Python Programming Language :: Python :: 2 Programming Language :: Python :: 3 Operating System :: OS Independent License :: OSI Approved :: BSD License [options] zip_safe = False packages = find: install_requires = sphinx>=1.7 [options.extras_require] test = pytest pytest-cov cython codecov coverage [options.package_data] sphinx_automodapi = templates/*/*.rst sphinx_automodapi.tests = cases/*/*.*, cases/*/*/*.*, cases/*/*/*/*.*, cases/*/*/*/*/*.* [egg_info] tag_build = tag_date = 0 sphinx-automodapi-0.12/setup.py0000644000077000000240000000067013433476531016551 0ustar tomstaff00000000000000#!/usr/bin/env python import sys import setuptools from distutils.version import LooseVersion from setuptools import setup # Setuptools 30.3.0 or later is needed for setup.cfg options to be used if LooseVersion(setuptools.__version__) < LooseVersion('30.3.0'): sys.stderr.write("ERROR: sphinx-automodapi requires setuptools 30.3.0 or " "later (found {0})".format(setuptools.__version__)) sys.exit(1) setup() sphinx-automodapi-0.12/sphinx_automodapi/0000755000077000000240000000000013525230464020562 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/__init__.py0000644000077000000240000000002513525230223022661 0ustar tomstaff00000000000000__version__ = '0.12' sphinx-automodapi-0.12/sphinx_automodapi/autodoc_enhancements.py0000644000077000000240000000554013525230047025323 0ustar tomstaff00000000000000""" Miscellaneous enhancements to help autodoc along. """ import inspect import sys import types from sphinx.ext.autodoc import AttributeDocumenter, ModuleDocumenter from sphinx.util.inspect import isdescriptor __all__ = [] if sys.version_info[0] == 3: class_types = (type,) else: class_types = (type, types.ClassType) MethodDescriptorType = type(type.__subclasses__) # See # https://github.com/astropy/astropy-helpers/issues/116#issuecomment-71254836 # for further background on this. def type_object_attrgetter(obj, attr, *defargs): """ This implements an improved attrgetter for type objects (i.e. classes) that can handle class attributes that are implemented as properties on a metaclass. Normally `getattr` on a class with a `property` (say, "foo"), would return the `property` object itself. However, if the class has a metaclass which *also* defines a `property` named "foo", ``getattr(cls, 'foo')`` will find the "foo" property on the metaclass and resolve it. For the purposes of autodoc we just want to document the "foo" property defined on the class, not on the metaclass. For example:: >>> class Meta(type): ... @property ... def foo(cls): ... return 'foo' ... >>> class MyClass(metaclass=Meta): ... @property ... def foo(self): ... \"\"\"Docstring for MyClass.foo property.\"\"\" ... return 'myfoo' ... >>> getattr(MyClass, 'foo') 'foo' >>> type_object_attrgetter(MyClass, 'foo') >>> type_object_attrgetter(MyClass, 'foo').__doc__ 'Docstring for MyClass.foo property.' The last line of the example shows the desired behavior for the purposes of autodoc. """ for base in obj.__mro__: if attr in base.__dict__: if isinstance(base.__dict__[attr], property): # Note, this should only be used for properties--for any other # type of descriptor (classmethod, for example) this can mess # up existing expectations of what getattr(cls, ...) returns return base.__dict__[attr] break return getattr(obj, attr, *defargs) def setup(app): # Must have the autodoc extension set up first so we can override it app.setup_extension('sphinx.ext.autodoc') app.add_autodoc_attrgetter(type, type_object_attrgetter) suppress_warnings_orig = app.config.suppress_warnings[:] if 'app.add_directive' not in app.config.suppress_warnings: app.config.suppress_warnings.append('app.add_directive') try: app.add_autodocumenter(AttributeDocumenter) finally: app.config.suppress_warnings = suppress_warnings_orig return {'parallel_read_safe': True, 'parallel_write_safe': True} sphinx-automodapi-0.12/sphinx_automodapi/automodapi.py0000644000077000000240000004036213525230047023300 0ustar tomstaff00000000000000# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This directive takes a single argument that must be a module or package. It will produce a block of documentation that includes the docstring for the package, an :ref:`automodsumm` directive, and an :ref:`automod-diagram` if there are any classes in the module. If only the main docstring of the module/package is desired in the documentation, use `automodule`_ instead of `automodapi`_. It accepts the following options: * ``:include-all-objects:`` If present, include not just functions and classes, but all objects. This includes variables, for which a possible docstring after the variable definition will be shown. * ``:inheritance-diagram:`` / ``:no-inheritance-diagram:`` Specify whether or not to show the inheritance diagram for classes. This overrides the default global configuration set in ``automodapi_inheritance_diagram``. * ``:skip: str`` This option results in the specified object being skipped, that is the object will *not* be included in the generated documentation. This option may appear any number of times to skip multiple objects. * ``:no-main-docstr:`` If present, the docstring for the module/package will not be generated. The function and class tables will still be used, however. * ``:headings: str`` Specifies the characters (in one string) used as the heading levels used for the generated section. This must have at least 2 characters (any after 2 will be ignored). This also *must* match the rest of the documentation on this page for sphinx to be happy. Defaults to "-^", which matches the convention used for Python's documentation, assuming the automodapi call is inside a top-level section (which usually uses '='). * ``:no-heading:`` If specified do not create a top level heading for the section. That is, do not create a title heading with text like "packagename Package". The actual docstring for the package/module will still be shown, though, unless ``:no-main-docstr:`` is given. * ``:allowed-package-names: str`` Specifies the packages that functions/classes documented here are allowed to be from, as comma-separated list of package names. If not given, only objects that are actually in a subpackage of the package currently being documented are included. * ``:inherited-members:`` / ``:no-inherited-members:`` The global sphinx configuration option ``automodsumm_inherited_members`` decides if members that a class inherits from a base class are included in the generated documentation. The option ``:inherited-members:`` or ``:no-inherited-members:`` allows the user to overrride the global setting. This extension also adds four sphinx configuration options: * ``automodapi_inheritance_diagram`` Should be a boolean that indicates whether to show inheritance diagrams by default. This can be overriden on a case by case basis with ``:inheritance-diagram:`` and ``:no-inheritance-diagram:``. Defaults to ``True``. * ``automodapi_toctreedirnm`` This must be a string that specifies the name of the directory the automodsumm generated documentation ends up in. This directory path should be relative to the documentation root (e.g., same place as ``index.rst``). Defaults to ``'api'``. * ``automodapi_writereprocessed`` Should be a bool, and if `True`, will cause `automodapi`_ to write files with any `automodapi`_ sections replaced with the content Sphinx processes after `automodapi`_ has run. The output files are not actually used by sphinx, so this option is only for figuring out the cause of sphinx warnings or other debugging. Defaults to `False`. * ``automodsumm_inherited_members`` Should be a bool and if ``True`` members that a class inherits from a base class are included in the generated documentation. Defaults to ``False``. .. _automodule: http://sphinx-doc.org/latest/ext/autodoc.html?highlight=automodule#directive-automodule """ # Implementation note: # The 'automodapi' directive is not actually implemented as a docutils # directive. Instead, this extension searches for the 'automodapi' text in # all sphinx documents, and replaces it where necessary from a template built # into this extension. This is necessary because automodsumm (and autosummary) # use the "builder-inited" event, which comes before the directives are # actually built. import inspect import io import os import re import sys from sphinx.util import logging from .utils import find_mod_objs __all__ = [] if sys.version_info[0] == 3: text_type = str else: text_type = unicode # noqa automod_templ_modheader = """ {modname} {pkgormod} {modhds}{pkgormodhds} {automoduleline} """ automod_templ_classes = """ Classes {clshds} .. automodsumm:: {modname} :classes-only: {clsfuncoptions} """ automod_templ_funcs = """ Functions {funchds} .. automodsumm:: {modname} :functions-only: {clsfuncoptions} """ automod_templ_vars = """ Variables {otherhds} .. automodsumm:: {modname} :variables-only: {clsfuncoptions} """ automod_templ_inh = """ Class Inheritance Diagram {clsinhsechds} .. automod-diagram:: {modname} :private-bases: :parts: 1 {allowedpkgnms} {skip} """ _automodapirex = re.compile(r'^(?:\.\.\s+automodapi::\s*)([A-Za-z0-9_.]+)' r'\s*$((?:\n\s+:[a-zA-Z_\-]+:.*$)*)', flags=re.MULTILINE) # the last group of the above regex is intended to go into finall with the below _automodapiargsrex = re.compile(r':([a-zA-Z_\-]+):(.*)$', flags=re.MULTILINE) def automodapi_replace(sourcestr, app, dotoctree=True, docname=None, warnings=True): """ Replaces `sourcestr`'s entries of ".. automdapi::" with the automodapi template form based on provided options. This is used with the sphinx event 'source-read' to replace `automodapi`_ entries before sphinx actually processes them, as automodsumm needs the code to be present to generate stub documentation. Parameters ---------- sourcestr : str The string with sphinx source to be checked for automodapi replacement. app : `sphinx.application.Application` The sphinx application. dotoctree : bool If `True`, a ":toctree:" option will be added in the ".. automodsumm::" sections of the template, pointing to the appropriate "generated" directory based on the Astropy convention (e.g. in ``docs/api``) docname : str The name of the file for this `sourcestr` (if known - if not, it can be `None`). If not provided and `dotoctree` is `True`, the generated files may end up in the wrong place. warnings : bool If `False`, all warnings that would normally be issued are silenced. Returns ------- newstr :str The string with automodapi entries replaced with the correct sphinx markup. """ logger = logging.getLogger(__name__) spl = _automodapirex.split(sourcestr) if len(spl) > 1: # automodsumm is in this document # Use app.srcdir because api folder should be inside source folder not # at folder where sphinx is run. if dotoctree: toctreestr = ':toctree: ' api_dir = os.path.join(app.srcdir, app.config.automodapi_toctreedirnm) if docname is None: doc_path = app.srcdir else: doc_path = os.path.dirname(os.path.join(app.srcdir, docname)) toctreestr += os.path.relpath(api_dir, doc_path).replace(os.sep, '/') else: toctreestr = '' newstrs = [spl[0]] for grp in range(len(spl) // 3): modnm = spl[grp * 3 + 1] # find where this is in the document for warnings if docname is None: location = None else: location = (docname, spl[0].count('\n')) # initialize default options toskip = [] inhdiag = app.config.automodapi_inheritance_diagram maindocstr = True top_head = True hds = '-^' allowedpkgnms = [] allowothers = False # look for actual options unknownops = [] inherited_members = None for opname, args in _automodapiargsrex.findall(spl[grp * 3 + 2]): if opname == 'skip': toskip.append(args.strip()) elif opname == 'inheritance-diagram': inhdiag = True elif opname == 'no-inheritance-diagram': inhdiag = False elif opname == 'no-main-docstr': maindocstr = False elif opname == 'headings': hds = args elif opname == 'no-heading': top_head = False elif opname == 'allowed-package-names': allowedpkgnms.append(args.strip()) elif opname == 'inherited-members': inherited_members = True elif opname == 'no-inherited-members': inherited_members = False elif opname == 'include-all-objects': allowothers = True else: unknownops.append(opname) # join all the allowedpkgnms if len(allowedpkgnms) == 0: allowedpkgnms = '' onlylocals = True else: allowedpkgnms = ':allowed-package-names: ' + ','.join(allowedpkgnms) onlylocals = allowedpkgnms # get the two heading chars hds = hds.strip() if len(hds) < 2: msg = 'Not enough headings (got {0}, need 2), using default -^' if warnings: logger.warning(msg.format(len(hds)), location) hds = '-^' h1, h2 = hds[:2] # tell sphinx that the remaining args are invalid. if len(unknownops) > 0 and app is not None: opsstrs = ','.join(unknownops) msg = 'Found additional options ' + opsstrs + ' in automodapi.' if warnings: logger.warning(msg, location) ispkg, hascls, hasfuncs, hasother = _mod_info( modnm, toskip, onlylocals=onlylocals) # add automodule directive only if no-main-docstr isn't present if maindocstr: automodline = '.. automodule:: {modname}'.format(modname=modnm) else: automodline = '' if top_head: newstrs.append(automod_templ_modheader.format( modname=modnm, modhds=h1 * len(modnm), pkgormod='Package' if ispkg else 'Module', pkgormodhds=h1 * (8 if ispkg else 7), automoduleline=automodline)) # noqa else: newstrs.append(automod_templ_modheader.format( modname='', modhds='', pkgormod='', pkgormodhds='', automoduleline=automodline)) # construct the options for the class/function sections # start out indented at 4 spaces, but need to keep the indentation. clsfuncoptions = [] if toctreestr: clsfuncoptions.append(toctreestr) if toskip: clsfuncoptions.append(':skip: ' + ','.join(toskip)) if allowedpkgnms: clsfuncoptions.append(allowedpkgnms) if hascls: # This makes no sense unless there are classes. if inherited_members is True: clsfuncoptions.append(':inherited-members:') if inherited_members is False: clsfuncoptions.append(':no-inherited-members:') clsfuncoptionstr = '\n '.join(clsfuncoptions) if hasfuncs: newstrs.append(automod_templ_funcs.format( modname=modnm, funchds=h2 * 9, clsfuncoptions=clsfuncoptionstr)) if hascls: newstrs.append(automod_templ_classes.format( modname=modnm, clshds=h2 * 7, clsfuncoptions=clsfuncoptionstr)) if allowothers and hasother: newstrs.append(automod_templ_vars.format( modname=modnm, otherhds=h2 * 9, clsfuncoptions=clsfuncoptionstr)) if inhdiag and hascls: # add inheritance diagram if any classes are in the module if toskip: clsskip = ':skip: ' + ','.join(toskip) else: clsskip = '' diagram_entry = automod_templ_inh.format( modname=modnm, clsinhsechds=h2 * 25, allowedpkgnms=allowedpkgnms, skip=clsskip) diagram_entry = diagram_entry.replace(' \n', '') newstrs.append(diagram_entry) newstrs.append(spl[grp * 3 + 3]) newsourcestr = ''.join(newstrs) if app.config.automodapi_writereprocessed: # sometimes they are unicode, sometimes not, depending on how # sphinx has processed things if isinstance(newsourcestr, text_type): ustr = newsourcestr else: ustr = newsourcestr.decode(app.config.source_encoding) if docname is None: with io.open(os.path.join(app.srcdir, 'unknown.automodapi'), 'a', encoding='utf8') as f: f.write(u'\n**NEW DOC**\n\n') f.write(ustr) else: env = app.builder.env # Determine the filename associated with this doc (specifically # the extension) filename = docname + os.path.splitext(env.doc2path(docname))[1] filename += '.automodapi' with io.open(os.path.join(app.srcdir, filename), 'w', encoding='utf8') as f: f.write(ustr) return newsourcestr else: return sourcestr def _mod_info(modname, toskip=[], onlylocals=True): """ Determines if a module is a module or a package and whether or not it has classes or functions. """ hascls = hasfunc = hasother = False for localnm, fqnm, obj in zip(*find_mod_objs(modname, onlylocals=onlylocals)): if localnm not in toskip: hascls = hascls or inspect.isclass(obj) hasfunc = hasfunc or inspect.isroutine(obj) hasother = hasother or (not inspect.isclass(obj) and not inspect.isroutine(obj)) if hascls and hasfunc and hasother: break # find_mod_objs has already imported modname # TODO: There is probably a cleaner way to do this, though this is pretty # reliable for all Python versions for most cases that we care about. pkg = sys.modules[modname] ispkg = (hasattr(pkg, '__file__') and isinstance(pkg.__file__, str) and os.path.split(pkg.__file__)[1].startswith('__init__.py')) return ispkg, hascls, hasfunc, hasother def process_automodapi(app, docname, source): source[0] = automodapi_replace(source[0], app, True, docname) def setup(app): app.setup_extension('sphinx.ext.autosummary') # Note: we use __name__ here instead of just writing the module name in # case this extension is bundled into another package from . import automodsumm app.setup_extension(automodsumm.__name__) app.connect('source-read', process_automodapi) app.add_config_value('automodapi_inheritance_diagram', True, True) app.add_config_value('automodapi_toctreedirnm', 'api', True) app.add_config_value('automodapi_writereprocessed', False, True) return {'parallel_read_safe': True, 'parallel_write_safe': True} sphinx-automodapi-0.12/sphinx_automodapi/automodsumm.py0000644000077000000240000006447713525230047023525 0ustar tomstaff00000000000000# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This directive will produce an "autosummary"-style table for public attributes of a specified module. See the `sphinx.ext.autosummary`_ extension for details on this process. The main difference from the `autosummary`_ directive is that `autosummary`_ requires manually inputting all attributes that appear in the table, while this captures the entries automatically. This directive requires a single argument that must be a module or package. It also accepts any options supported by the `autosummary`_ directive- see `sphinx.ext.autosummary`_ for details. It also accepts some additional options: * ``:classes-only:`` If present, the autosummary table will only contain entries for classes. This cannot be used at the same time with ``:functions-only:`` or ``:variables-only:``. * ``:functions-only:`` If present, the autosummary table will only contain entries for functions. This cannot be used at the same time with ``:classes-only:`` or ``:variables-only:``. * ``:variables-only:`` If present, the autosummary table will only contain entries for variables (everything except functions and classes). This cannot be used at the same time with ``:classes-only:`` or ``:functions-only:``. * ``:skip: obj1, [obj2, obj3, ...]`` If present, specifies that the listed objects should be skipped and not have their documentation generated, nor be included in the summary table. * ``:allowed-package-names: pkgormod1, [pkgormod2, pkgormod3, ...]`` Specifies the packages that functions/classes documented here are allowed to be from, as comma-separated list of package names. If not given, only objects that are actually in a subpackage of the package currently being documented are included. * ``:inherited-members:`` or ``:no-inherited-members:`` The global sphinx configuration option ``automodsumm_inherited_members`` decides if members that a class inherits from a base class are included in the generated documentation. The flags ``:inherited-members:`` or ``:no-inherited-members:`` allows overrriding this global setting. This extension also adds two sphinx configuration options: * ``automodsumm_writereprocessed`` Should be a bool, and if ``True``, will cause `automodsumm`_ to write files with any ``automodsumm`` sections replaced with the content Sphinx processes after ``automodsumm`` has run. The output files are not actually used by sphinx, so this option is only for figuring out the cause of sphinx warnings or other debugging. Defaults to ``False``. * ``automodsumm_inherited_members`` Should be a bool and if ``True``, will cause `automodsumm`_ to document class members that are inherited from a base class. This value can be overriden for any particular automodsumm directive by including the ``:inherited-members:`` or ``:no-inherited-members:`` options. Defaults to ``False``. .. _sphinx.ext.autosummary: http://sphinx-doc.org/latest/ext/autosummary.html .. _autosummary: http://sphinx-doc.org/latest/ext/autosummary.html#directive-autosummary .. _automod-diagram: automod-diagram directive ========================= This directive will produce an inheritance diagram like that of the `sphinx.ext.inheritance_diagram`_ extension. This directive requires a single argument that must be a module or package. It accepts no options. .. note:: Like 'inheritance-diagram', 'automod-diagram' requires `graphviz `_ to generate the inheritance diagram. .. _sphinx.ext.inheritance_diagram: http://sphinx-doc.org/latest/ext/inheritance.html """ import abc import inspect import os import re import io from sphinx.util import logging from sphinx.ext.autosummary import Autosummary from sphinx.ext.inheritance_diagram import InheritanceDiagram from docutils.parsers.rst.directives import flag from .utils import find_mod_objs, cleanup_whitespace __all__ = ['Automoddiagram', 'Automodsumm', 'automodsumm_to_autosummary_lines', 'generate_automodsumm_docs', 'process_automodsumm_generation'] def _str_list_converter(argument): """ A directive option conversion function that converts the option into a list of strings. Used for 'skip' option. """ if argument is None: return [] else: return [s.strip() for s in argument.split(',')] class Automodsumm(Autosummary): required_arguments = 1 optional_arguments = 0 final_argument_whitespace = False has_content = False option_spec = dict(Autosummary.option_spec) option_spec['functions-only'] = flag option_spec['classes-only'] = flag option_spec['variables-only'] = flag option_spec['skip'] = _str_list_converter option_spec['allowed-package-names'] = _str_list_converter option_spec['inherited-members'] = flag option_spec['no-inherited-members'] = flag def run(self): env = self.state.document.settings.env modname = self.arguments[0] nodelist = [] try: localnames, fqns, objs = find_mod_objs(modname) except ImportError: self.warn("Couldn't import module " + modname) return [] try: # set self.content to trick the autosummary internals. # Be sure to respect functions-only and classes-only. funconly = 'functions-only' in self.options clsonly = 'classes-only' in self.options varonly = 'variables-only' in self.options if [clsonly, funconly, varonly].count(True) > 1: self.warn('more than one of "functions-only", "classes-only", ' 'or "variables-only" defined. Ignoring.') clsonly = funconly = varonly = False skipnames = [] if 'skip' in self.options: option_skipnames = set(self.options['skip']) for lnm in localnames: if lnm in option_skipnames: option_skipnames.remove(lnm) skipnames.append(lnm) if len(option_skipnames) > 0: self.warn('Tried to skip objects {objs} in module {mod}, ' 'but they were not present. Ignoring.' .format(objs=option_skipnames, mod=modname)) if funconly: cont = [] for nm, obj in zip(localnames, objs): if nm not in skipnames and inspect.isroutine(obj): cont.append(nm) elif clsonly: cont = [] for nm, obj in zip(localnames, objs): if nm not in skipnames and inspect.isclass(obj): cont.append(nm) elif varonly: cont = [] for nm, obj in zip(localnames, objs): if nm not in skipnames and not (inspect.isclass(obj) or inspect.isroutine(obj)): cont.append(nm) else: cont = [nm for nm in localnames if nm not in skipnames] self.content = cont # for some reason, even though ``currentmodule`` is substituted in, # sphinx doesn't necessarily recognize this fact. So we just force # it internally, and that seems to fix things env.temp_data['py:module'] = modname env.ref_context['py:module'] = modname # can't use super because Sphinx/docutils has trouble return # super(Autosummary,self).run() nodelist.extend(Autosummary.run(self)) return nodelist finally: # has_content = False for the Automodsumm self.content = [] def get_items(self, names): try: self.bridge.genopt['imported-members'] = True except AttributeError: # Sphinx < 4.0 self.genopt['imported-members'] = True return Autosummary.get_items(self, names) # <-------------------automod-diagram stuff-----------------------------------> class Automoddiagram(InheritanceDiagram): option_spec = dict(InheritanceDiagram.option_spec) option_spec['allowed-package-names'] = _str_list_converter option_spec['skip'] = _str_list_converter def run(self): try: ols = self.options.get('allowed-package-names', []) ols = True if len(ols) == 0 else ols # if none are given, assume only local nms, objs = find_mod_objs(self.arguments[0], onlylocals=ols)[1:] except ImportError: self.warn("Couldn't import module " + self.arguments[0]) return [] # Check if some classes should be skipped skip = self.options.get('skip', []) clsnms = [] for n, o in zip(nms, objs): if n.split('.')[-1] in skip: continue if inspect.isclass(o): clsnms.append(n) oldargs = self.arguments try: if len(clsnms) > 0: self.arguments = [' '.join(clsnms)] return InheritanceDiagram.run(self) finally: self.arguments = oldargs # <---------------------automodsumm generation stuff--------------------------> def process_automodsumm_generation(app): env = app.builder.env filestosearch = [] for docname in env.found_docs: filename = env.doc2path(docname) if os.path.isfile(filename): filestosearch.append(docname + os.path.splitext(filename)[1]) liness = [] for sfn in filestosearch: lines = automodsumm_to_autosummary_lines(sfn, app) liness.append(lines) if app.config.automodsumm_writereprocessed: if lines: # empty list means no automodsumm entry is in the file outfn = os.path.join(app.srcdir, sfn) + '.automodsumm' with open(outfn, 'w') as f: for l in lines: f.write(l) f.write('\n') for sfn, lines in zip(filestosearch, liness): suffix = os.path.splitext(sfn)[1] if len(lines) > 0: generate_automodsumm_docs( lines, sfn, app=app, builder=app.builder, suffix=suffix, base_path=app.srcdir, inherited_members=app.config.automodsumm_inherited_members) # _automodsummrex = re.compile(r'^(\s*)\.\. automodsumm::\s*([A-Za-z0-9_.]+)\s*' # r'\n\1(\s*)(\S|$)', re.MULTILINE) _lineendrex = r'(?:\n|$)' _hdrex = r'^\n?(\s*)\.\. automodsumm::\s*(\S+)\s*' + _lineendrex _oprex1 = r'(?:\1(\s+)\S.*' + _lineendrex + ')' _oprex2 = r'(?:\1\4\S.*' + _lineendrex + ')' _automodsummrex = re.compile(_hdrex + '(' + _oprex1 + '?' + _oprex2 + '*)', re.MULTILINE) def automodsumm_to_autosummary_lines(fn, app): """ Generates lines from a file with an "automodsumm" entry suitable for feeding into "autosummary". Searches the provided file for `automodsumm` directives and returns a list of lines specifying the `autosummary` commands for the modules requested. This does *not* return the whole file contents - just an autosummary section in place of any :automodsumm: entries. Note that any options given for `automodsumm` are also included in the generated `autosummary` section. Parameters ---------- fn : str The name of the file to search for `automodsumm` entries. app : sphinx.application.Application The sphinx Application object Returns ------- lines : list of str Lines for all `automodsumm` entries with the entries replaced by `autosummary` and the module's members added. """ logger = logging.getLogger(__name__) fullfn = os.path.join(app.builder.env.srcdir, fn) with io.open(fullfn, encoding='utf8') as fr: # Note: we use __name__ here instead of just writing the module name in # case this extension is bundled into another package from . import automodapi try: extensions = app.extensions except AttributeError: # Sphinx <1.6 extensions = app._extensions if automodapi.__name__ in extensions: # Must do the automodapi on the source to get the automodsumm # that might be in there docname = os.path.splitext(fn)[0] filestr = automodapi.automodapi_replace(fr.read(), app, True, docname, False) else: filestr = fr.read() spl = _automodsummrex.split(filestr) # 0th entry is the stuff before the first automodsumm line indent1s = spl[1::5] mods = spl[2::5] opssecs = spl[3::5] indent2s = spl[4::5] remainders = spl[5::5] # only grab automodsumm sections and convert them to autosummary with the # entries for all the public objects newlines = [] # loop over all automodsumms in this document for i, (i1, i2, modnm, ops, rem) in enumerate(zip(indent1s, indent2s, mods, opssecs, remainders)): allindent = i1 + (' ' if i2 is None else i2) # filter out functions-only, classes-only, and ariables-only # options if present. oplines = ops.split('\n') toskip = [] allowedpkgnms = [] funcsonly = clssonly = varsonly = False for i, ln in reversed(list(enumerate(oplines))): if ':functions-only:' in ln: funcsonly = True del oplines[i] if ':classes-only:' in ln: clssonly = True del oplines[i] if ':variables-only:' in ln: varsonly = True del oplines[i] if ':skip:' in ln: toskip.extend(_str_list_converter(ln.replace(':skip:', ''))) del oplines[i] if ':allowed-package-names:' in ln: allowedpkgnms.extend(_str_list_converter(ln.replace(':allowed-package-names:', ''))) del oplines[i] if [funcsonly, clssonly, varsonly].count(True) > 1: msg = ('Defined more than one of functions-only, classes-only, ' 'and variables-only. Skipping this directive.') lnnum = sum([spl[j].count('\n') for j in range(i * 5 + 1)]) logger.warning('[automodsumm] ' + msg, (fn, lnnum)) continue # Use the currentmodule directive so we can just put the local names # in the autosummary table. Note that this doesn't always seem to # actually "take" in Sphinx's eyes, so in `Automodsumm.run`, we have to # force it internally, as well. newlines.extend([i1 + '.. currentmodule:: ' + modnm, '', '.. autosummary::']) newlines.extend(oplines) ols = True if len(allowedpkgnms) == 0 else allowedpkgnms for nm, fqn, obj in zip(*find_mod_objs(modnm, onlylocals=ols)): if nm in toskip: continue if funcsonly and not inspect.isroutine(obj): continue if clssonly and not inspect.isclass(obj): continue if varsonly and (inspect.isclass(obj) or inspect.isroutine(obj)): continue newlines.append(allindent + nm) # add one newline at the end of the autosummary block newlines.append('') return newlines def generate_automodsumm_docs(lines, srcfn, app=None, suffix='.rst', base_path=None, builder=None, template_dir=None, inherited_members=False): """ This function is adapted from `sphinx.ext.autosummary.generate.generate_autosummmary_docs` to generate source for the automodsumm directives that should be autosummarized. Unlike generate_autosummary_docs, this function is called one file at a time. """ from sphinx.jinja2glue import BuiltinTemplateLoader from sphinx.ext.autosummary import import_by_name, get_documenter from sphinx.util.osutil import ensuredir from sphinx.util.inspect import safe_getattr from jinja2 import FileSystemLoader, TemplateNotFound from jinja2.sandbox import SandboxedEnvironment from .utils import find_autosummary_in_lines_for_automodsumm as find_autosummary_in_lines logger = logging.getLogger(__name__) # Create our own templating environment - here we use Astropy's # templates rather than the default autosummary templates, in order to # allow docstrings to be shown for methods. template_dirs = [os.path.join(os.path.dirname(__file__), 'templates'), os.path.join(base_path, '_templates')] if builder is not None: # allow the user to override the templates template_loader = BuiltinTemplateLoader() template_loader.init(builder, dirs=template_dirs) else: if template_dir: template_dirs.insert(0, template_dir) template_loader = FileSystemLoader(template_dirs) template_env = SandboxedEnvironment(loader=template_loader) # read # items = find_autosummary_in_files(sources) items = find_autosummary_in_lines(lines, filename=srcfn) if len(items) > 0: msg = '[automodsumm] {1}: found {0} automodsumm entries to generate' logger.info(msg.format(len(items), srcfn)) # gennms = [item[0] for item in items] # if len(gennms) > 20: # gennms = gennms[:10] + ['...'] + gennms[-10:] # logger.info('[automodsumm] generating autosummary for: ' + ', '.join(gennms)) # remove possible duplicates items = list(set(items)) # keep track of new files new_files = [] # write for name, path, template_name, inherited_mem in sorted(items): if path is None: # The corresponding autosummary:: directive did not have # a :toctree: option continue path = os.path.abspath(os.path.join(base_path, path)) ensuredir(path) try: import_by_name_values = import_by_name(name) except ImportError as e: logger.warning('[automodsumm] failed to import %r: %s' % (name, e)) continue # if block to accommodate Sphinx's v1.2.2 and v1.2.3 respectively if len(import_by_name_values) == 3: name, obj, parent = import_by_name_values elif len(import_by_name_values) == 4: name, obj, parent, module_name = import_by_name_values fn = os.path.join(path, name + suffix) # skip it if it exists if os.path.isfile(fn): continue new_files.append(fn) f = open(fn, 'w') try: doc = get_documenter(app, obj, parent) if template_name is not None: template = template_env.get_template(template_name) else: tmplstr = 'autosummary_core/%s.rst' try: template = template_env.get_template(tmplstr % doc.objtype) except TemplateNotFound: template = template_env.get_template(tmplstr % 'base') def get_members_mod(obj, typ, include_public=[]): """ typ = None -> all """ items = [] for name in dir(obj): try: documenter = get_documenter(app, safe_getattr(obj, name), obj) except AttributeError: continue if typ is None or documenter.objtype == typ: items.append(name) public = [x for x in items if x in include_public or not x.startswith('_')] return public, items def get_members_class(obj, typ, include_public=[], include_base=False): """ typ = None -> all include_base -> include attrs that are from a base class """ items = [] # using dir gets all of the attributes, including the elements # from the base class, otherwise use __slots__ or __dict__ if include_base: names = dir(obj) else: # Classes deriving from an ABC using the `abc` module will # have an empty `__slots__` attribute in Python 3, unless # other slots were declared along the inheritance chain. If # the ABC-derived class has empty slots, we'll use the # class `__dict__` instead. declares_slots = ( hasattr(obj, '__slots__') and not (type(obj) is abc.ABCMeta and len(obj.__slots__) == 0) ) if declares_slots: names = tuple(getattr(obj, '__slots__')) else: names = getattr(obj, '__dict__').keys() for name in names: try: documenter = get_documenter(app, safe_getattr(obj, name), obj) except AttributeError: continue if typ is None or documenter.objtype == typ: items.append(name) elif typ == 'attribute' and documenter.objtype == 'property': # In Sphinx 2.0 and above, properties have a separate # objtype, but we treat them the same here. items.append(name) public = [x for x in items if x in include_public or not x.startswith('_')] return public, items ns = {} if doc.objtype == 'module': ns['members'] = get_members_mod(obj, None) ns['functions'], ns['all_functions'] = \ get_members_mod(obj, 'function') ns['classes'], ns['all_classes'] = \ get_members_mod(obj, 'class') ns['exceptions'], ns['all_exceptions'] = \ get_members_mod(obj, 'exception') elif doc.objtype == 'class': if inherited_mem is not None: # option set in this specifc directive include_base = inherited_mem else: # use default value include_base = inherited_members api_class_methods = ['__init__', '__call__'] ns['members'] = get_members_class(obj, None, include_base=include_base) ns['methods'], ns['all_methods'] = \ get_members_class(obj, 'method', api_class_methods, include_base=include_base) ns['attributes'], ns['all_attributes'] = \ get_members_class(obj, 'attribute', include_base=include_base) ns['methods'].sort() ns['attributes'].sort() parts = name.split('.') if doc.objtype in ('method', 'attribute'): mod_name = '.'.join(parts[:-2]) cls_name = parts[-2] obj_name = '.'.join(parts[-2:]) ns['class'] = cls_name else: mod_name, obj_name = '.'.join(parts[:-1]), parts[-1] ns['fullname'] = name ns['module'] = mod_name ns['objname'] = obj_name ns['name'] = parts[-1] ns['objtype'] = doc.objtype ns['underline'] = len(obj_name) * '=' # We now check whether a file for reference footnotes exists for # the module being documented. We first check if the # current module is a file or a directory, as this will give a # different path for the reference file. For example, if # documenting astropy.wcs then the reference file is at # ../wcs/references.txt, while if we are documenting # astropy.config.logging_helper (which is at # astropy/config/logging_helper.py) then the reference file is set # to ../config/references.txt if '.' in mod_name: mod_name_dir = mod_name.split('.', 1)[1].replace('.', os.sep) else: mod_name_dir = mod_name if (not os.path.isdir(os.path.join(base_path, mod_name_dir)) and os.path.isdir(os.path.join(base_path, mod_name_dir.rsplit(os.sep, 1)[0]))): mod_name_dir = mod_name_dir.rsplit(os.sep, 1)[0] # We then have to check whether it exists, and if so, we pass it # to the template. if os.path.exists(os.path.join(base_path, mod_name_dir, 'references.txt')): # An important subtlety here is that the path we pass in has # to be relative to the file being generated, so we have to # figure out the right number of '..'s ndirsback = path.replace(base_path, '').count(os.sep) ref_file_rel_segments = ['..'] * ndirsback ref_file_rel_segments.append(mod_name_dir) ref_file_rel_segments.append('references.txt') ns['referencefile'] = os.path.join(*ref_file_rel_segments).replace(os.sep, '/') rendered = template.render(**ns) f.write(cleanup_whitespace(rendered)) finally: f.close() def setup(app): # need autodoc fixes # Note: we use __name__ here instead of just writing the module name in # case this extension is bundled into another package from . import autodoc_enhancements app.setup_extension(autodoc_enhancements.__name__) # need inheritance-diagram for automod-diagram app.setup_extension('sphinx.ext.inheritance_diagram') app.add_directive('automod-diagram', Automoddiagram) app.add_directive('automodsumm', Automodsumm) app.connect('builder-inited', process_automodsumm_generation) app.add_config_value('automodsumm_writereprocessed', False, True) app.add_config_value('automodsumm_inherited_members', False, 'env') return {'parallel_read_safe': True, 'parallel_write_safe': True} sphinx-automodapi-0.12/sphinx_automodapi/smart_resolver.py0000644000077000000240000001006413523222665024206 0ustar tomstaff00000000000000# Licensed under a 3-clause BSD style license - see LICENSE.rst """ The classes in the astropy docs are documented by their API location, which is not necessarily where they are defined in the source. This causes a problem when certain automated features of the doc build, such as the inheritance diagrams or the `Bases` list of a class reference a class by its canonical location rather than its "user" location. In the `autodoc-process-docstring` event, a mapping from the actual name to the API name is maintained. Later, in the `missing-reference` event, unresolved references are looked up in this dictionary and corrected if possible. """ from docutils.nodes import literal, reference def process_docstring(app, what, name, obj, options, lines): if isinstance(obj, type): env = app.env if not hasattr(env, 'class_name_mapping'): env.class_name_mapping = {} mapping = env.class_name_mapping mapping[obj.__module__ + '.' + obj.__name__] = name def merge_mapping(app, env, docnames, env_other): if not hasattr(env_other, 'class_name_mapping'): return if not hasattr(env, 'class_name_mapping'): env.class_name_mapping = {} env.class_name_mapping.update(env_other.class_name_mapping) def missing_reference_handler(app, env, node, contnode): if not hasattr(env, 'class_name_mapping'): env.class_name_mapping = {} mapping = env.class_name_mapping reftype = node['reftype'] reftarget = node['reftarget'] if reftype in ('obj', 'class', 'exc', 'meth'): reftarget = node['reftarget'] suffix = '' if reftarget not in mapping: if '.' in reftarget: front, suffix = reftarget.rsplit('.', 1) else: suffix = reftarget if suffix.startswith('_') and not suffix.startswith('__'): # If this is a reference to a hidden class or method, # we can't link to it, but we don't want to have a # nitpick warning. return node[0].deepcopy() if reftype in ('obj', 'meth') and '.' in reftarget: if front in mapping: reftarget = front suffix = '.' + suffix if (reftype in ('class', ) and '.' in reftarget and reftarget not in mapping): if '.' in front: reftarget, _ = front.rsplit('.', 1) suffix = '.' + suffix reftarget = reftarget + suffix prefix = reftarget.rsplit('.')[0] inventory = env.intersphinx_named_inventory if (reftarget not in mapping and prefix in inventory): if 'py:class' in inventory[prefix] and reftarget in inventory[prefix]['py:class']: newtarget = inventory[prefix]['py:class'][reftarget][2] if not node['refexplicit'] and \ '~' not in node.rawsource: contnode = literal(text=reftarget) newnode = reference('', '', internal=True) newnode['reftitle'] = reftarget newnode['refuri'] = newtarget newnode.append(contnode) return newnode if reftarget in mapping: newtarget = mapping[reftarget] + suffix if not node['refexplicit'] and '~' not in node.rawsource: contnode = literal(text=newtarget) newnode = env.domains['py'].resolve_xref( env, node['refdoc'], app.builder, 'class', newtarget, node, contnode) if newnode is not None: newnode['reftitle'] = reftarget return newnode def setup(app): app.connect('autodoc-process-docstring', process_docstring) app.connect('missing-reference', missing_reference_handler) app.connect('env-merge-info', merge_mapping) return {'parallel_read_safe': True, 'parallel_write_safe': True} sphinx-automodapi-0.12/sphinx_automodapi/templates/0000755000077000000240000000000013525230464022560 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/templates/autosummary_core/0000755000077000000240000000000013525230464026156 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/templates/autosummary_core/base.rst0000644000077000000240000000025213416454725027630 0ustar tomstaff00000000000000{% if referencefile %} .. include:: {{ referencefile }} {% endif %} {{ objname }} {{ underline }} .. currentmodule:: {{ module }} .. auto{{ objtype }}:: {{ objname }} sphinx-automodapi-0.12/sphinx_automodapi/templates/autosummary_core/class.rst0000644000077000000240000000221113233635533030013 0ustar tomstaff00000000000000{% if referencefile %} .. include:: {{ referencefile }} {% endif %} {{ objname }} {{ underline }} .. currentmodule:: {{ module }} .. autoclass:: {{ objname }} :show-inheritance: {% if '__init__' in methods %} {% set caught_result = methods.remove('__init__') %} {% endif %} {% block attributes_summary %} {% if attributes %} .. rubric:: Attributes Summary .. autosummary:: {% for item in attributes %} ~{{ name }}.{{ item }} {%- endfor %} {% endif %} {% endblock %} {% block methods_summary %} {% if methods %} .. rubric:: Methods Summary .. autosummary:: {% for item in methods %} ~{{ name }}.{{ item }} {%- endfor %} {% endif %} {% endblock %} {% block attributes_documentation %} {% if attributes %} .. rubric:: Attributes Documentation {% for item in attributes %} .. autoattribute:: {{ item }} {%- endfor %} {% endif %} {% endblock %} {% block methods_documentation %} {% if methods %} .. rubric:: Methods Documentation {% for item in methods %} .. automethod:: {{ item }} {%- endfor %} {% endif %} {% endblock %} sphinx-automodapi-0.12/sphinx_automodapi/templates/autosummary_core/module.rst0000644000077000000240000000127713233635533030206 0ustar tomstaff00000000000000{% if referencefile %} .. include:: {{ referencefile }} {% endif %} {{ objname }} {{ underline }} .. automodule:: {{ fullname }} {% block functions %} {% if functions %} .. rubric:: Functions .. autosummary:: {% for item in functions %} {{ item }} {%- endfor %} {% endif %} {% endblock %} {% block classes %} {% if classes %} .. rubric:: Classes .. autosummary:: {% for item in classes %} {{ item }} {%- endfor %} {% endif %} {% endblock %} {% block exceptions %} {% if exceptions %} .. rubric:: Exceptions .. autosummary:: {% for item in exceptions %} {{ item }} {%- endfor %} {% endif %} {% endblock %} sphinx-automodapi-0.12/sphinx_automodapi/tests/0000755000077000000240000000000013525230464021724 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/__init__.py0000644000077000000240000000321413525230047024032 0ustar tomstaff00000000000000import os import sys import subprocess as sp from textwrap import dedent import pytest @pytest.fixture def cython_testpackage(tmpdir, request): """ Creates a trivial Cython package for use with tests. """ test_pkg = tmpdir.mkdir('test_pkg') test_pkg.mkdir('apyhtest_eva').ensure('__init__.py') test_pkg.join('apyhtest_eva').join('unit02.pyx').write(dedent("""\ def pilot(): \"\"\"Returns the pilot of Eva Unit-02.\"\"\" return True """)) import sphinx_automodapi # noqa test_pkg.join('setup.py').write(dedent("""\ import sys sys.path.insert(0, {0!r}) from os.path import join from setuptools import setup, Extension NAME = 'apyhtest_eva' VERSION = 0.1 RELEASE = True setup( name=NAME, version=VERSION, ext_modules=[Extension('apyhtest_eva.unit02', [join('apyhtest_eva', 'unit02.pyx')])] ) """.format(os.path.dirname(sphinx_automodapi.__path__[0])))) # Build the Cython module in a subprocess; otherwise strange things can # happen with Cython's global module state sp.call([sys.executable, 'setup.py', 'build_ext', '--inplace'], cwd=test_pkg.strpath) sys.path.insert(0, str(test_pkg)) import apyhtest_eva.unit02 # noqa def cleanup(test_pkg=test_pkg): for modname in ['apyhtest_eva', 'apyhtest_eva.unit02']: try: del sys.modules[modname] except KeyError: pass sys.path.remove(str(test_pkg)) request.addfinalizer(cleanup) return test_pkg sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/0000755000077000000240000000000013525230464023022 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/abstract_classes/0000755000077000000240000000000013525230464026342 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/abstract_classes/README.md0000644000077000000240000000031713370623057027624 0ustar tomstaff00000000000000This example is to make sure that classes derived from the `abc` module will have their members listed when ``:inherited-members:`` is not in effect (https://github.com/astropy/sphinx-automodapi/issues/52). sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/abstract_classes/input/0000755000077000000240000000000013525230464027501 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/abstract_classes/input/index.rst0000644000077000000240000000011013370623057031334 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module.abstract_classes sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/abstract_classes/output/0000755000077000000240000000000013525230464027702 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/abstract_classes/output/api/0000755000077000000240000000000013525230464030453 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000023600000000000011216 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/abstract_classes/output/api/sphinx_automodapi.tests.example_module.abstract_classes.SequenceSubclass.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/abstract_classes/output/api/sphinx_automodapi.t0000644000077000000240000000075213370623057034401 0ustar tomstaff00000000000000SequenceSubclass ================ .. currentmodule:: sphinx_automodapi.tests.example_module.abstract_classes .. autoclass:: SequenceSubclass :show-inheritance: .. rubric:: Attributes Summary .. autosummary:: ~SequenceSubclass.my_property .. rubric:: Methods Summary .. autosummary:: ~SequenceSubclass.my_method .. rubric:: Attributes Documentation .. autoattribute:: my_property .. rubric:: Methods Documentation .. automethod:: my_method sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/abstract_classes/output/index.rst.automodapi0000644000077000000240000000075513370623057033715 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module.abstract_classes Module -------------------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.abstract_classes Classes ^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.abstract_classes :classes-only: :toctree: api Class Inheritance Diagram ^^^^^^^^^^^^^^^^^^^^^^^^^ .. automod-diagram:: sphinx_automodapi.tests.example_module.abstract_classes :private-bases: :parts: 1 sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/abstract_classes/output/index.rst.automodsumm0000644000077000000240000000020513370623057034113 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module.abstract_classes .. autosummary:: :toctree: api SequenceSubclass sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_no_inherit/0000755000077000000240000000000013525230464026675 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_no_inherit/README.md0000644000077000000240000000011113233635533030147 0ustar tomstaff00000000000000Documenting a module with classes but excluding a class with inheritance sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_no_inherit/input/0000755000077000000240000000000013525230464030034 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_no_inherit/input/index.rst0000644000077000000240000000011613233635533031675 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module.classes :skip: Spam sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_no_inherit/output/0000755000077000000240000000000013525230464030235 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_no_inherit/output/api/0000755000077000000240000000000013525230465031007 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000021200000000000011210 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_no_inherit/output/api/sphinx_automodapi.tests.example_module.classes.Egg.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_no_inherit/output/api/sphinx_automodapi0000644000077000000240000000066013233635533034470 0ustar tomstaff00000000000000Egg === .. currentmodule:: sphinx_automodapi.tests.example_module.classes .. autoclass:: Egg :show-inheritance: .. rubric:: Attributes Summary .. autosummary:: ~Egg.weight .. rubric:: Methods Summary .. autosummary:: ~Egg.buy ~Egg.eat .. rubric:: Attributes Documentation .. autoattribute:: weight .. rubric:: Methods Documentation .. automethod:: buy .. automethod:: eat sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_no_inherit/output/index.rst.automodapi0000644000077000000240000000074013233635533034242 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module.classes Module ----------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.classes Classes ^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.classes :classes-only: :toctree: api :skip: Spam Class Inheritance Diagram ^^^^^^^^^^^^^^^^^^^^^^^^^ .. automod-diagram:: sphinx_automodapi.tests.example_module.classes :private-bases: :parts: 1 :skip: Spam sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_no_inherit/output/index.rst.automodsumm0000644000077000000240000000015713233635533034454 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module.classes .. autosummary:: :toctree: api Egg sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/0000755000077000000240000000000013525230465027235 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/README.md0000644000077000000240000000015113233635533030512 0ustar tomstaff00000000000000Documenting a module with classes including one that inherits a base class that isn't in the public API. sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/input/0000755000077000000240000000000013525230465030374 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/input/index.rst0000644000077000000240000000007713233635533032242 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module.classes sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/output/0000755000077000000240000000000013525230465030575 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/output/api/0000755000077000000240000000000013525230465031346 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000021400000000000011212 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/output/api/sphinx_automodapi.tests.example_module.classes.Egg.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/output/api/sphinx_automoda0000644000077000000240000000066013233635533034476 0ustar tomstaff00000000000000Egg === .. currentmodule:: sphinx_automodapi.tests.example_module.classes .. autoclass:: Egg :show-inheritance: .. rubric:: Attributes Summary .. autosummary:: ~Egg.weight .. rubric:: Methods Summary .. autosummary:: ~Egg.buy ~Egg.eat .. rubric:: Attributes Documentation .. autoattribute:: weight .. rubric:: Methods Documentation .. automethod:: buy .. automethod:: eat ././@LongLink0000000000000000000000000000021500000000000011213 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/output/api/sphinx_automodapi.tests.example_module.classes.Spam.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/output/api/sphinx_automoda0000644000077000000240000000017013233635533034472 0ustar tomstaff00000000000000Spam ==== .. currentmodule:: sphinx_automodapi.tests.example_module.classes .. autoclass:: Spam :show-inheritance: ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/output/index.rst.automodapisphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/output/index.rst.automodap0000644000077000000240000000070013233635533034424 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module.classes Module ----------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.classes Classes ^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.classes :classes-only: :toctree: api Class Inheritance Diagram ^^^^^^^^^^^^^^^^^^^^^^^^^ .. automod-diagram:: sphinx_automodapi.tests.example_module.classes :private-bases: :parts: 1 ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/output/index.rst.automodsummsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/classes_with_inherit/output/index.rst.automodsu0000644000077000000240000000017013233635533034454 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module.classes .. autosummary:: :toctree: api Spam Egg sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_headings/0000755000077000000240000000000013525230465025620 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_headings/README.md0000644000077000000240000000011113233635533027071 0ustar tomstaff00000000000000Documenting a module with functions, and customizing the heading symbols sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_headings/input/0000755000077000000240000000000013525230465026757 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_headings/input/index.rst0000644000077000000240000000012313233635533030615 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module.functions :headings: *&^ sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_headings/output/0000755000077000000240000000000013525230465027160 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_headings/output/api/0000755000077000000240000000000013525230465027731 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000020700000000000011214 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_headings/output/api/sphinx_automodapi.tests.example_module.functions.add.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_headings/output/api/sphinx_automodapi.test0000644000077000000240000000014413233635533034365 0ustar tomstaff00000000000000add === .. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autofunction:: add ././@LongLink0000000000000000000000000000021400000000000011212 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_headings/output/api/sphinx_automodapi.tests.example_module.functions.multiply.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_headings/output/api/sphinx_automodapi.test0000644000077000000240000000016313233635533034366 0ustar tomstaff00000000000000multiply ======== .. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autofunction:: multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_headings/output/index.rst.automodapi0000644000077000000240000000046213233635533033165 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module.functions Module ******************************************************* .. automodule:: sphinx_automodapi.tests.example_module.functions Functions &&&&&&&&& .. automodsumm:: sphinx_automodapi.tests.example_module.functions :functions-only: :toctree: api sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_headings/output/index.rst.automodsumm0000644000077000000240000000021313525230047033362 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autosummary:: :toctree: api add subtract multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_noheading/0000755000077000000240000000000013525230465025772 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_noheading/README.md0000644000077000000240000000011213233635533027244 0ustar tomstaff00000000000000Documenting a module with functions, and disabling the top-level headings sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_noheading/input/0000755000077000000240000000000013525230465027131 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_noheading/input/index.rst0000644000077000000240000000012113233635533030765 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module.functions :no-heading: sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_noheading/output/0000755000077000000240000000000013525230465027332 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_noheading/output/api/0000755000077000000240000000000013525230465030103 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000021000000000000011206 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_noheading/output/api/sphinx_automodapi.tests.example_module.functions.add.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_noheading/output/api/sphinx_automodapi.tes0000644000077000000240000000014413233635533034353 0ustar tomstaff00000000000000add === .. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autofunction:: add ././@LongLink0000000000000000000000000000021500000000000011213 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_noheading/output/api/sphinx_automodapi.tests.example_module.functions.multiply.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_noheading/output/api/sphinx_automodapi.tes0000644000077000000240000000016313233635533034354 0ustar tomstaff00000000000000multiply ======== .. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autofunction:: multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_noheading/output/index.rst.automodapi0000644000077000000240000000030013233635533033326 0ustar tomstaff00000000000000.. automodule:: sphinx_automodapi.tests.example_module.functions Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.functions :functions-only: :toctree: api sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_noheading/output/index.rst.automodsumm0000644000077000000240000000021313525230047033534 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autosummary:: :toctree: api add subtract multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/0000755000077000000240000000000013525230465027234 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/README.md0000644000077000000240000000010413233635533030507 0ustar tomstaff00000000000000Documenting a module with functions, excluding the module docstring sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/input/0000755000077000000240000000000013525230465030373 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/input/index.rst0000644000077000000240000000012513233635533032233 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module.functions :no-main-docstr: sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/output/0000755000077000000240000000000013525230465030574 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/output/api/0000755000077000000240000000000013525230465031345 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000021600000000000011214 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/output/api/sphinx_automodapi.tests.example_module.functions.add.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/output/api/sphinx_automoda0000644000077000000240000000014413233635533034472 0ustar tomstaff00000000000000add === .. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autofunction:: add ././@LongLink0000000000000000000000000000022300000000000011212 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/output/api/sphinx_automodapi.tests.example_module.functions.multiply.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/output/api/sphinx_automoda0000644000077000000240000000016313233635533034473 0ustar tomstaff00000000000000multiply ======== .. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autofunction:: multiply ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/output/index.rst.automodapisphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/output/index.rst.automodap0000644000077000000240000000036213233635533034427 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module.functions Module ------------------------------------------------------- Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.functions :functions-only: :toctree: api ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/output/index.rst.automodsummsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_nomaindocstring/output/index.rst.automodsu0000644000077000000240000000021313525230047034444 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autosummary:: :toctree: api add subtract multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_simple/0000755000077000000240000000000013525230465025327 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_simple/README.md0000644000077000000240000000004413233635533026605 0ustar tomstaff00000000000000Documenting a module with functions sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_simple/input/0000755000077000000240000000000013525230465026466 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_simple/input/index.rst0000644000077000000240000000010113233635533030320 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module.functions sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_simple/output/0000755000077000000240000000000013525230465026667 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_simple/output/api/0000755000077000000240000000000013525230465027440 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000020500000000000011212 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_simple/output/api/sphinx_automodapi.tests.example_module.functions.add.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_simple/output/api/sphinx_automodapi.tests.0000644000077000000240000000014413233635533034335 0ustar tomstaff00000000000000add === .. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autofunction:: add ././@LongLink0000000000000000000000000000021200000000000011210 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_simple/output/api/sphinx_automodapi.tests.example_module.functions.multiply.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_simple/output/api/sphinx_automodapi.tests.0000644000077000000240000000016313233635533034336 0ustar tomstaff00000000000000multiply ======== .. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autofunction:: multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_simple/output/index.rst.automodapi0000644000077000000240000000046213233635533032674 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module.functions Module ------------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.functions Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.functions :functions-only: :toctree: api sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/func_simple/output/index.rst.automodsumm0000644000077000000240000000021313525230047033071 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autosummary:: :toctree: api add subtract multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/0000755000077000000240000000000013525230465026510 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/README.md0000644000077000000240000000041313233635533027766 0ustar tomstaff00000000000000This example is to make sure that when there are multiple automodapi calls and only one has inherited-members, it applies only to that one (this is a regression test for a bug that causes a single inherited-members option to apply to all subsequent automodapi calls) sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/input/0000755000077000000240000000000013525230465027647 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/input/index.rst0000644000077000000240000000023413233635533031510 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module.classes :inherited-members: .. automodapi:: sphinx_automodapi.tests.example_module.other_classes sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/output/0000755000077000000240000000000013525230465030050 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/output/api/0000755000077000000240000000000013525230465030621 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000021100000000000011207 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/output/api/sphinx_automodapi.tests.example_module.classes.Egg.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/output/api/sphinx_automodapi.0000644000077000000240000000066013233635533034360 0ustar tomstaff00000000000000Egg === .. currentmodule:: sphinx_automodapi.tests.example_module.classes .. autoclass:: Egg :show-inheritance: .. rubric:: Attributes Summary .. autosummary:: ~Egg.weight .. rubric:: Methods Summary .. autosummary:: ~Egg.buy ~Egg.eat .. rubric:: Attributes Documentation .. autoattribute:: weight .. rubric:: Methods Documentation .. automethod:: buy .. automethod:: eat ././@LongLink0000000000000000000000000000021200000000000011210 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/output/api/sphinx_automodapi.tests.example_module.classes.Spam.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/output/api/sphinx_automodapi.0000644000077000000240000000044313233635533034357 0ustar tomstaff00000000000000Spam ==== .. currentmodule:: sphinx_automodapi.tests.example_module.classes .. autoclass:: Spam :show-inheritance: .. rubric:: Methods Summary .. autosummary:: ~Spam.buy ~Spam.eat .. rubric:: Methods Documentation .. automethod:: buy .. automethod:: eat ././@LongLink0000000000000000000000000000021700000000000011215 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/output/api/sphinx_automodapi.tests.example_module.other_classes.Foo.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/output/api/sphinx_automodapi.0000644000077000000240000000037613233635533034364 0ustar tomstaff00000000000000Foo === .. currentmodule:: sphinx_automodapi.tests.example_module.other_classes .. autoclass:: Foo :show-inheritance: .. rubric:: Methods Summary .. autosummary:: ~Foo.hmm .. rubric:: Methods Documentation .. automethod:: hmm sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/output/index.rst.automodapi0000644000077000000240000000167013233635533034057 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module.classes Module ----------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.classes Classes ^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.classes :classes-only: :toctree: api :inherited-members: Class Inheritance Diagram ^^^^^^^^^^^^^^^^^^^^^^^^^ .. automod-diagram:: sphinx_automodapi.tests.example_module.classes :private-bases: :parts: 1 sphinx_automodapi.tests.example_module.other_classes Module ----------------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.other_classes Classes ^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.other_classes :classes-only: :toctree: api Class Inheritance Diagram ^^^^^^^^^^^^^^^^^^^^^^^^^ .. automod-diagram:: sphinx_automodapi.tests.example_module.other_classes :private-bases: :parts: 1 sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/inherited_members/output/index.rst.automodsumm0000644000077000000240000000040513233635533034262 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module.classes .. autosummary:: :toctree: api :inherited-members: Spam Egg .. currentmodule:: sphinx_automodapi.tests.example_module.other_classes .. autosummary:: :toctree: api Foo sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/0000755000077000000240000000000013525230465026043 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/README.md0000644000077000000240000000023513233635533027323 0ustar tomstaff00000000000000Documenting a module with classes and functions that are imported from other files, and with an inheritance diagram (which then requires the smart_resolver) sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/input/0000755000077000000240000000000013525230465027202 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/input/index.rst0000644000077000000240000000006713233635533031047 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/output/0000755000077000000240000000000013525230465027403 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/output/api/0000755000077000000240000000000013525230465030154 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000017600000000000011221 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/output/api/sphinx_automodapi.tests.example_module.Egg.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/output/api/sphinx_automodapi.tes0000644000077000000240000000065013233635533034426 0ustar tomstaff00000000000000Egg === .. currentmodule:: sphinx_automodapi.tests.example_module .. autoclass:: Egg :show-inheritance: .. rubric:: Attributes Summary .. autosummary:: ~Egg.weight .. rubric:: Methods Summary .. autosummary:: ~Egg.buy ~Egg.eat .. rubric:: Attributes Documentation .. autoattribute:: weight .. rubric:: Methods Documentation .. automethod:: buy .. automethod:: eat ././@LongLink0000000000000000000000000000017700000000000011222 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/output/api/sphinx_automodapi.tests.example_module.Spam.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/output/api/sphinx_automodapi.tes0000644000077000000240000000016013233635533034422 0ustar tomstaff00000000000000Spam ==== .. currentmodule:: sphinx_automodapi.tests.example_module .. autoclass:: Spam :show-inheritance: ././@LongLink0000000000000000000000000000017600000000000011221 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/output/api/sphinx_automodapi.tests.example_module.add.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/output/api/sphinx_automodapi.tes0000644000077000000240000000013213233635533034421 0ustar tomstaff00000000000000add === .. currentmodule:: sphinx_automodapi.tests.example_module .. autofunction:: add ././@LongLink0000000000000000000000000000020300000000000011210 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/output/api/sphinx_automodapi.tests.example_module.multiply.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/output/api/sphinx_automodapi.tes0000644000077000000240000000015113233635533034422 0ustar tomstaff00000000000000multiply ======== .. currentmodule:: sphinx_automodapi.tests.example_module .. autofunction:: multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/output/index.rst.automodapi0000644000077000000240000000101713233635533033405 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module Package ---------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module :functions-only: :toctree: api Classes ^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module :classes-only: :toctree: api Class Inheritance Diagram ^^^^^^^^^^^^^^^^^^^^^^^^^ .. automod-diagram:: sphinx_automodapi.tests.example_module :private-bases: :parts: 1 sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel/output/index.rst.automodsumm0000644000077000000240000000036113525230047033611 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module .. autosummary:: :toctree: api add multiply subtract .. currentmodule:: sphinx_automodapi.tests.example_module .. autosummary:: :toctree: api Egg Spam sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/0000755000077000000240000000000013525230465030404 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/README.md0000644000077000000240000000025213233635533031663 0ustar tomstaff00000000000000Documenting a module with classes, functions, and variables that are imported from other files, and with an inheritance diagram (which then requires the smart_resolver). sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/input/0000755000077000000240000000000013525230465031543 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/input/index.rst0000644000077000000240000000012113233635533033377 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module :include-all-objects: sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/0000755000077000000240000000000013525230465031744 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/0000755000077000000240000000000013525230465032515 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000021200000000000011210 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_automodapi.tests.example_module.Egg.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_au0000644000077000000240000000065013233635533034440 0ustar tomstaff00000000000000Egg === .. currentmodule:: sphinx_automodapi.tests.example_module .. autoclass:: Egg :show-inheritance: .. rubric:: Attributes Summary .. autosummary:: ~Egg.weight .. rubric:: Methods Summary .. autosummary:: ~Egg.buy ~Egg.eat .. rubric:: Attributes Documentation .. autoattribute:: weight .. rubric:: Methods Documentation .. automethod:: buy .. automethod:: eat ././@LongLink0000000000000000000000000000022700000000000011216 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_automodapi.tests.example_module.FUNNY_WALK_STEPS.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_au0000644000077000000240000000017513233635533034442 0ustar tomstaff00000000000000FUNNY_WALK_STEPS ================ .. currentmodule:: sphinx_automodapi.tests.example_module .. autodata:: FUNNY_WALK_STEPS ././@LongLink0000000000000000000000000000022300000000000011212 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_automodapi.tests.example_module.PARROT_STATE.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_au0000644000077000000240000000016113233635533034435 0ustar tomstaff00000000000000PARROT_STATE ============ .. currentmodule:: sphinx_automodapi.tests.example_module .. autodata:: PARROT_STATE ././@LongLink0000000000000000000000000000021300000000000011211 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_automodapi.tests.example_module.Spam.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_au0000644000077000000240000000016013233635533034434 0ustar tomstaff00000000000000Spam ==== .. currentmodule:: sphinx_automodapi.tests.example_module .. autoclass:: Spam :show-inheritance: ././@LongLink0000000000000000000000000000021200000000000011210 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_automodapi.tests.example_module.add.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_au0000644000077000000240000000013213233635533034433 0ustar tomstaff00000000000000add === .. currentmodule:: sphinx_automodapi.tests.example_module .. autofunction:: add ././@LongLink0000000000000000000000000000021700000000000011215 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_automodapi.tests.example_module.multiply.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_au0000644000077000000240000000015113233635533034434 0ustar tomstaff00000000000000multiply ======== .. currentmodule:: sphinx_automodapi.tests.example_module .. autofunction:: multiply ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/index.rst.automodapisphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/index.rst.aut0000644000077000000240000000120413233635533034373 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module Package ---------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module :functions-only: :toctree: api Classes ^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module :classes-only: :toctree: api Variables ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module :variables-only: :toctree: api Class Inheritance Diagram ^^^^^^^^^^^^^^^^^^^^^^^^^ .. automod-diagram:: sphinx_automodapi.tests.example_module :private-bases: :parts: 1 ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/index.rst.automodsummsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/index.rst.aut0000644000077000000240000000056613525230047034400 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module .. autosummary:: :toctree: api add multiply subtract .. currentmodule:: sphinx_automodapi.tests.example_module .. autosummary:: :toctree: api Egg Spam .. currentmodule:: sphinx_automodapi.tests.example_module .. autosummary:: :toctree: api FUNNY_WALK_STEPS PARROT_STATE sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/0000755000077000000240000000000013525230465030064 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/README.md0000644000077000000240000000012313233635533031340 0ustar tomstaff00000000000000Documenting a module with classes and functions that are imported from other files sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/input/0000755000077000000240000000000013525230465031223 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/input/index.rst0000644000077000000240000000012313233635533033061 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module :no-inheritance-diagram: sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/0000755000077000000240000000000013525230465031424 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/0000755000077000000240000000000013525230465032175 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000021000000000000011206 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/sphinx_automodapi.tests.example_module.Egg.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/sphinx_auto0000644000077000000240000000065013233635533034463 0ustar tomstaff00000000000000Egg === .. currentmodule:: sphinx_automodapi.tests.example_module .. autoclass:: Egg :show-inheritance: .. rubric:: Attributes Summary .. autosummary:: ~Egg.weight .. rubric:: Methods Summary .. autosummary:: ~Egg.buy ~Egg.eat .. rubric:: Attributes Documentation .. autoattribute:: weight .. rubric:: Methods Documentation .. automethod:: buy .. automethod:: eat ././@LongLink0000000000000000000000000000021100000000000011207 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/sphinx_automodapi.tests.example_module.Spam.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/sphinx_auto0000644000077000000240000000016013233635533034457 0ustar tomstaff00000000000000Spam ==== .. currentmodule:: sphinx_automodapi.tests.example_module .. autoclass:: Spam :show-inheritance: ././@LongLink0000000000000000000000000000021000000000000011206 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/sphinx_automodapi.tests.example_module.add.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/sphinx_auto0000644000077000000240000000013213233635533034456 0ustar tomstaff00000000000000add === .. currentmodule:: sphinx_automodapi.tests.example_module .. autofunction:: add ././@LongLink0000000000000000000000000000021500000000000011213 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/sphinx_automodapi.tests.example_module.multiply.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/sphinx_auto0000644000077000000240000000015113233635533034457 0ustar tomstaff00000000000000multiply ======== .. currentmodule:: sphinx_automodapi.tests.example_module .. autofunction:: multiply ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/index.rst.automodapisphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/index.rst.autom0000644000077000000240000000057313233635533034417 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module Package ---------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module :functions-only: :toctree: api Classes ^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module :classes-only: :toctree: api ././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/index.rst.automodsummsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/index.rst.autom0000644000077000000240000000036113525230047034405 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module .. autosummary:: :toctree: api add multiply subtract .. currentmodule:: sphinx_automodapi.tests.example_module .. autosummary:: :toctree: api Egg Spam sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/0000755000077000000240000000000013525230465024305 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/README.md0000644000077000000240000000012713433476531025570 0ustar tomstaff00000000000000Documenting a sub-module which is at a different level in the docs than the API folder sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/input/0000755000077000000240000000000013525230465025444 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/input/index.rst0000644000077000000240000000007413433476531027312 0ustar tomstaff00000000000000.. toctree:: :maxdepth: 1 tests/example_module/index sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/input/tests/0000755000077000000240000000000013525230464026605 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/input/tests/example_module/0000755000077000000240000000000013525230465031606 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/input/tests/example_module/index.rst0000644000077000000240000000011213433476531033445 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module.functions_with_ref ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/input/tests/example_module/references.txtsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/input/tests/example_module/references.tx0000644000077000000240000000004413433476531034306 0ustar tomstaff00000000000000.. _astropy: http://www.astropy.org sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/output/0000755000077000000240000000000013525230464025644 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/output/api/0000755000077000000240000000000013525230465026416 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000021100000000000011207 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/output/api/sphinx_automodapi.tests.example_module.functions_with_ref.add.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/output/api/sphinx_automodapi.tests.examp0000644000077000000240000000024213433476531034350 0ustar tomstaff00000000000000.. include:: ../tests/example_module/references.txt add === .. currentmodule:: sphinx_automodapi.tests.example_module.functions_with_ref .. autofunction:: add ././@LongLink0000000000000000000000000000021600000000000011214 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/output/api/sphinx_automodapi.tests.example_module.functions_with_ref.multiply.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/output/api/sphinx_automodapi.tests.examp0000644000077000000240000000026113433476531034351 0ustar tomstaff00000000000000.. include:: ../tests/example_module/references.txt multiply ======== .. currentmodule:: sphinx_automodapi.tests.example_module.functions_with_ref .. autofunction:: multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/output/tests/0000755000077000000240000000000013525230464027006 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/output/tests/example_module/0000755000077000000240000000000013525230465032007 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/output/tests/example_module/index.rst.automodapisphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/output/tests/example_module/index.rst.au0000644000077000000240000000053413433476531034262 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module.functions_with_ref Module ---------------------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.functions_with_ref Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.functions_with_ref :functions-only: :toctree: ../../api ././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/output/tests/example_module/index.rst.automodsummsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/nested/output/tests/example_module/index.rst.au0000644000077000000240000000021513523261201034240 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module.functions_with_ref .. autosummary:: :toctree: ../../api add multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/non_ascii/0000755000077000000240000000000013525230465024765 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/non_ascii/README.md0000644000077000000240000000002513233635533026242 0ustar tomstaff00000000000000Non-ASCII characters sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/non_ascii/input/0000755000077000000240000000000013525230465026124 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/non_ascii/input/index.rst0000644000077000000240000000017513233635533027771 0ustar tomstaff00000000000000Ceçi est un exemple qui inclus des charactères non-ASCII .. automodapi:: sphinx_automodapi.tests.example_module.functions sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/non_ascii/output/0000755000077000000240000000000013525230465026325 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/non_ascii/output/api/0000755000077000000240000000000013525230465027076 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000020300000000000011210 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/non_ascii/output/api/sphinx_automodapi.tests.example_module.functions.add.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/non_ascii/output/api/sphinx_automodapi.tests.ex0000644000077000000240000000014413233635533034330 0ustar tomstaff00000000000000add === .. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autofunction:: add ././@LongLink0000000000000000000000000000021000000000000011206 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/non_ascii/output/api/sphinx_automodapi.tests.example_module.functions.multiply.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/non_ascii/output/api/sphinx_automodapi.tests.ex0000644000077000000240000000016313233635533034331 0ustar tomstaff00000000000000multiply ======== .. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autofunction:: multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/non_ascii/output/index.rst.automodapi0000644000077000000240000000055613233635533032336 0ustar tomstaff00000000000000Ceçi est un exemple qui inclus des charactères non-ASCII sphinx_automodapi.tests.example_module.functions Module ------------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.functions Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.functions :functions-only: :toctree: api sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/non_ascii/output/index.rst.automodsumm0000644000077000000240000000021313525230047032527 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autosummary:: :toctree: api add subtract multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/0000755000077000000240000000000013525230465025161 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/README.md0000644000077000000240000000005313233635533026437 0ustar tomstaff00000000000000Documentation is inside a source directory sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/input/0000755000077000000240000000000013525230464026317 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/input/src/0000755000077000000240000000000013525230465027107 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/input/src/index.rst0000644000077000000240000000010113233635533030741 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module.functions sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/output/0000755000077000000240000000000013525230464026520 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/output/src/0000755000077000000240000000000013525230465027310 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/output/src/api/0000755000077000000240000000000013525230465030061 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000021000000000000011206 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/output/src/api/sphinx_automodapi.tests.example_module.functions.add.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/output/src/api/sphinx_automodapi.tes0000644000077000000240000000014413233635533034331 0ustar tomstaff00000000000000add === .. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autofunction:: add ././@LongLink0000000000000000000000000000021500000000000011213 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/output/src/api/sphinx_automodapi.tests.example_module.functions.multiply.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/output/src/api/sphinx_automodapi.tes0000644000077000000240000000016313233635533034332 0ustar tomstaff00000000000000multiply ======== .. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autofunction:: multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/output/src/index.rst.automodapi0000644000077000000240000000046213233635533033315 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module.functions Module ------------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.functions Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.functions :functions-only: :toctree: api sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/source_dir/output/src/index.rst.automodsumm0000644000077000000240000000021313525230047033512 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module.functions .. autosummary:: :toctree: api add subtract multiply sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/variables/0000755000077000000240000000000013525230465024773 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/variables/README.md0000644000077000000240000000005313233635533026251 0ustar tomstaff00000000000000Documenting a module with global variables sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/variables/input/0000755000077000000240000000000013525230465026132 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/variables/input/index.rst0000644000077000000240000000013313233635533027771 0ustar tomstaff00000000000000.. automodapi:: sphinx_automodapi.tests.example_module.variables :include-all-objects: sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/variables/output/0000755000077000000240000000000013525230465026333 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/variables/output/api/0000755000077000000240000000000013525230465027104 5ustar tomstaff00000000000000././@LongLink0000000000000000000000000000022000000000000011207 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/variables/output/api/sphinx_automodapi.tests.example_module.variables.FUNNY_WALK_STEPS.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/variables/output/api/sphinx_automodapi.tests.ex0000644000077000000240000000020713233635533034336 0ustar tomstaff00000000000000FUNNY_WALK_STEPS ================ .. currentmodule:: sphinx_automodapi.tests.example_module.variables .. autodata:: FUNNY_WALK_STEPS ././@LongLink0000000000000000000000000000021400000000000011212 Lustar 00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/variables/output/api/sphinx_automodapi.tests.example_module.variables.PARROT_STATE.rstsphinx-automodapi-0.12/sphinx_automodapi/tests/cases/variables/output/api/sphinx_automodapi.tests.ex0000644000077000000240000000017313233635533034340 0ustar tomstaff00000000000000PARROT_STATE ============ .. currentmodule:: sphinx_automodapi.tests.example_module.variables .. autodata:: PARROT_STATE sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/variables/output/index.rst.automodapi0000644000077000000240000000046213233635533032340 0ustar tomstaff00000000000000 sphinx_automodapi.tests.example_module.variables Module ------------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.variables Variables ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.variables :variables-only: :toctree: api sphinx-automodapi-0.12/sphinx_automodapi/tests/cases/variables/output/index.rst.automodsumm0000644000077000000240000000021713233635533032546 0ustar tomstaff00000000000000.. currentmodule:: sphinx_automodapi.tests.example_module.variables .. autosummary:: :toctree: api PARROT_STATE FUNNY_WALK_STEPS sphinx-automodapi-0.12/sphinx_automodapi/tests/example_module/0000755000077000000240000000000013525230465024725 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi/tests/example_module/__init__.py0000644000077000000240000000014113525230047027026 0ustar tomstaff00000000000000from .classes import * # noqa from .functions import * # noqa from .variables import * # noqa sphinx-automodapi-0.12/sphinx_automodapi/tests/example_module/abstract_classes.py0000644000077000000240000000160113370623057030616 0ustar tomstaff00000000000000try: # Python 3 from collections.abc import Sequence except ImportError: # Python 2 (this import also works in Python <= 3.7, but will be removed in # Python 3.8) from collections import Sequence __all__ = ['SequenceSubclass'] class SequenceSubclass(Sequence): """ Inherits from an ABC. """ def __init__(self): self._items = [] def __len__(self): """ Must be defined for the collections.abc.Sequence base class. """ return len(self._items) def __getitem__(self, key): """ Must be defined for the collections.abc.Sequence base class. """ return self._items[key] def my_method(self, parameter): """ An example method. """ pass @property def my_property(self): """ An example property. """ return 42 sphinx-automodapi-0.12/sphinx_automodapi/tests/example_module/classes.py0000644000077000000240000000132713233635533026740 0ustar tomstaff00000000000000__all__ = ['Spam', 'Egg'] class BaseSpam(object): """ Base class for Spam """ def eat(self, time): """ Eat some spam in the required time. """ pass def buy(self, price): """ Buy some MOAR spam. """ pass class Spam(BaseSpam): """ The main spam """ pass class Egg(object): """ An egg (no inheritance) """ def eat(self, time): """ Eat some egg in the required time. """ pass def buy(self, price): """ Buy some MOAR egg. """ pass @property def weight(self): """ The weight of an egg """ return 0 sphinx-automodapi-0.12/sphinx_automodapi/tests/example_module/functions.py0000644000077000000240000000047213525230047027306 0ustar tomstaff00000000000000""" A collection of useful functions """ __all__ = ['add', 'subtract', 'multiply'] def add(a, b): """ Add two numbers """ return a + b def subtract(a, b): """ Subtract two numbers """ return a - b def multiply(c, d): """ Multiply two numbers """ return c * d sphinx-automodapi-0.12/sphinx_automodapi/tests/example_module/functions_with_ref.py0000644000077000000240000000046613433476531031210 0ustar tomstaff00000000000000""" A collection of useful functions """ __all__ = ['add', 'multiply'] def add(a, b): """ Add two numbers Here is an example reference: astropy_ """ return a + b def multiply(c, d): """ Multiply two numbers Here is an example reference: astropy_ """ return c * d sphinx-automodapi-0.12/sphinx_automodapi/tests/example_module/mixed.py0000644000077000000240000000050513525230047026401 0ustar tomstaff00000000000000""" A collection of useful classes and functions """ __all__ = ['add', 'MixedSpam'] def add(a, b): """ Add two numbers """ return a + b class MixedSpam(object): """ Special spam """ def eat(self, time): """ Eat special spam in the required time. """ pass sphinx-automodapi-0.12/sphinx_automodapi/tests/example_module/other_classes.py0000644000077000000240000000042413233635533030136 0ustar tomstaff00000000000000__all__ = ['Foo'] class BaseFoo(object): """ Base class for Foo """ def bar(self, time): """ Eat some spam in the required time. """ pass class Foo(BaseFoo): """ The main foo """ def hmm(self): pass sphinx-automodapi-0.12/sphinx_automodapi/tests/example_module/variables.py0000644000077000000240000000076413233635533027257 0ustar tomstaff00000000000000""" A collection of useful variables. """ __all__ = ['PARROT_STATE', 'FUNNY_WALK_STEPS'] PARROT_STATE = 'dead' """The global state of the parrot.""" FUNNY_WALK_STEPS = [['left', 'right'], ['left', 'jump', 'right', 'jump'], ['swim']] """List of different possible walk. Each item contains a list of steps. """ # A variable not in __all__ should not be propagated. NOTHING_HAPPENS = 0 # Even if it has a docstring REALLY_NOTHING = 1 """Really nothing.""" sphinx-automodapi-0.12/sphinx_automodapi/tests/helpers.py0000644000077000000240000000310713525230047023736 0ustar tomstaff00000000000000# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import os import sys from copy import deepcopy from sphinx.cmd.build import build_main from . import cython_testpackage # noqa __all__ = ['write_conf', 'run_sphinx_in_tmpdir'] intersphinx_mapping = { 'python': ('https://docs.python.org/{0}/'.format(sys.version_info[0]), None) } DEFAULT_CONF = {'source_suffix': '.rst', 'master_doc': 'index', 'nitpicky': True, 'extensions': ['sphinx.ext.intersphinx', 'sphinx_automodapi.automodapi'], 'suppress_warnings': ['app.add_directive', 'app.add_node'], 'intersphinx_mapping': intersphinx_mapping, 'automodapi_toctreedirnm': 'api', 'automodapi_writereprocessed': True, 'automodapi_inheritance_diagram': True, 'automodsumm_writereprocessed': True} def write_conf(filename, conf): with open(filename, 'w') as f: for key, value in conf.items(): f.write("{0} = {1}\n".format(key, repr(conf[key]))) def run_sphinx_in_tmpdir(tmpdir, additional_conf={}, expect_error=False): start_dir = os.path.abspath('.') conf = deepcopy(DEFAULT_CONF) conf.update(additional_conf) write_conf(tmpdir.join('conf.py').strpath, conf) argv = ['-W', '-b', 'html', '.', '_build/html'] try: os.chdir(tmpdir.strpath) status = build_main(argv=argv) finally: os.chdir(start_dir) if expect_error: assert status != 0 else: assert status == 0 sphinx-automodapi-0.12/sphinx_automodapi/tests/test_autodoc_enhancements.py0000644000077000000240000000324413525230047027523 0ustar tomstaff00000000000000import sys from textwrap import dedent import pytest from ..autodoc_enhancements import type_object_attrgetter # Define test classes outside the class; otherwise there is flakiness with the # details of how exec works on different Python versions class Meta(type): @property def foo(cls): return 'foo' if sys.version_info[0] < 3: exec(dedent(""" class MyClass(object): __metaclass__ = Meta @property def foo(self): \"\"\"Docstring for MyClass.foo property.\"\"\" return 'myfoo' """)) else: exec(dedent(""" class MyClass(metaclass=Meta): @property def foo(self): \"\"\"Docstring for MyClass.foo property.\"\"\" return 'myfoo' """)) def test_type_attrgetter(): """ This test essentially reproduces the docstring for `type_object_attrgetter`. Sphinx itself tests the custom attrgetter feature; see: https://bitbucket.org/birkenfeld/sphinx/src/40bd03003ac6fe274ccf3c80d7727509e00a69ea/tests/test_autodoc.py?at=default#cl-502 so rather than a full end-to-end functional test it's simple enough to just test that this function does what it needs to do. """ assert getattr(MyClass, 'foo') == 'foo' obj = type_object_attrgetter(MyClass, 'foo') assert isinstance(obj, property) assert obj.__doc__ == 'Docstring for MyClass.foo property.' with pytest.raises(AttributeError): type_object_attrgetter(MyClass, 'susy') assert type_object_attrgetter(MyClass, 'susy', 'default') == 'default' assert type_object_attrgetter(MyClass, '__dict__') == MyClass.__dict__ sphinx-automodapi-0.12/sphinx_automodapi/tests/test_automodapi.py0000644000077000000240000002063213525230047025477 0ustar tomstaff00000000000000# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import sys from copy import copy import pytest from docutils.parsers.rst import directives, roles from . import cython_testpackage # noqa from .helpers import run_sphinx_in_tmpdir if sys.version_info[0] == 2: from io import open as io_open else: io_open = open def setup_function(func): # This can be replaced with the docutils_namespace context manager once # it is in a stable release of Sphinx func._directives = copy(directives._directives) func._roles = copy(roles._roles) def teardown_function(func): directives._directives = func._directives roles._roles = func._roles am_replacer_str = """ This comes before .. automodapi:: sphinx_automodapi.tests.example_module.mixed {options} This comes after """ am_replacer_basic_expected = """ This comes before sphinx_automodapi.tests.example_module.mixed Module --------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.mixed Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.mixed :functions-only: :toctree: api Classes ^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.mixed :classes-only: :toctree: api Class Inheritance Diagram ^^^^^^^^^^^^^^^^^^^^^^^^^ .. automod-diagram:: sphinx_automodapi.tests.example_module.mixed :private-bases: :parts: 1 This comes after """ def test_am_replacer_basic(tmpdir): """ Tests replacing an ".. automodapi::" with the automodapi no-option template """ with open(tmpdir.join('index.rst').strpath, 'w') as f: f.write(am_replacer_str.format(options='')) run_sphinx_in_tmpdir(tmpdir) with open(tmpdir.join('index.rst.automodapi').strpath) as f: result = f.read() assert result == am_replacer_basic_expected am_replacer_repr_str = u""" This comes before with spéciàl çhars .. automodapi:: sphinx_automodapi.tests.example_module.mixed {options} This comes after """ @pytest.mark.parametrize('writereprocessed', [False, True]) def test_am_replacer_writereprocessed(tmpdir, writereprocessed): """ Tests the automodapi_writereprocessed option """ with io_open(tmpdir.join('index.rst').strpath, 'w', encoding='utf-8') as f: f.write(am_replacer_repr_str.format(options='')) run_sphinx_in_tmpdir(tmpdir, additional_conf={'automodapi_writereprocessed': writereprocessed}) assert tmpdir.join('index.rst.automodapi').isfile() is writereprocessed am_replacer_noinh_expected = """ This comes before sphinx_automodapi.tests.example_module.mixed Module --------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.mixed Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.mixed :functions-only: :toctree: api Classes ^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.mixed :classes-only: :toctree: api This comes after """.format(empty='') def test_am_replacer_noinh(tmpdir): """ Tests replacing an ".. automodapi::" with no-inheritance-diagram option """ ops = ['', ':no-inheritance-diagram:'] ostr = '\n '.join(ops) with open(tmpdir.join('index.rst').strpath, 'w') as f: f.write(am_replacer_str.format(options=ostr)) run_sphinx_in_tmpdir(tmpdir) with open(tmpdir.join('index.rst.automodapi').strpath) as f: result = f.read() assert result == am_replacer_noinh_expected am_replacer_titleandhdrs_expected = """ This comes before sphinx_automodapi.tests.example_module.mixed Module &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& .. automodule:: sphinx_automodapi.tests.example_module.mixed Functions ********* .. automodsumm:: sphinx_automodapi.tests.example_module.mixed :functions-only: :toctree: api Classes ******* .. automodsumm:: sphinx_automodapi.tests.example_module.mixed :classes-only: :toctree: api Class Inheritance Diagram ************************* .. automod-diagram:: sphinx_automodapi.tests.example_module.mixed :private-bases: :parts: 1 This comes after """ def test_am_replacer_titleandhdrs(tmpdir): """ Tests replacing an ".. automodapi::" entry with title-setting and header character options. """ ops = ['', ':headings: &*'] ostr = '\n '.join(ops) with open(tmpdir.join('index.rst').strpath, 'w') as f: f.write(am_replacer_str.format(options=ostr)) run_sphinx_in_tmpdir(tmpdir) with open(tmpdir.join('index.rst.automodapi').strpath) as f: result = f.read() assert result == am_replacer_titleandhdrs_expected def test_am_replacer_titleandhdrs_invalid(tmpdir, capsys): """ Tests replacing an ".. automodapi::" entry with title-setting and header character options. """ ops = ['', ':headings: &'] ostr = '\n '.join(ops) with open(tmpdir.join('index.rst').strpath, 'w') as f: f.write(am_replacer_str.format(options=ostr)) run_sphinx_in_tmpdir(tmpdir, expect_error=True) stdout, stderr = capsys.readouterr() assert "Not enough headings (got 1, need 2), using default -^" in stderr am_replacer_nomain_str = """ This comes before .. automodapi:: sphinx_automodapi.tests.example_module.functions :no-main-docstr: This comes after """ am_replacer_nomain_expected = """ This comes before sphinx_automodapi.tests.example_module.functions Module ------------------------------------------------------- Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.functions :functions-only: :toctree: api This comes after """.format(empty='') def test_am_replacer_nomain(tmpdir): """ Tests replacing an ".. automodapi::" with "no-main-docstring" . """ with open(tmpdir.join('index.rst').strpath, 'w') as f: f.write(am_replacer_nomain_str.format(options='')) run_sphinx_in_tmpdir(tmpdir) with open(tmpdir.join('index.rst.automodapi').strpath) as f: result = f.read() assert result == am_replacer_nomain_expected am_replacer_skip_str = """ This comes before .. automodapi:: sphinx_automodapi.tests.example_module.functions :skip: add :skip: subtract This comes after """ am_replacer_skip_expected = """ This comes before sphinx_automodapi.tests.example_module.functions Module ------------------------------------------------------- .. automodule:: sphinx_automodapi.tests.example_module.functions Functions ^^^^^^^^^ .. automodsumm:: sphinx_automodapi.tests.example_module.functions :functions-only: :toctree: api :skip: add,subtract This comes after """.format(empty='') def test_am_replacer_skip(tmpdir): """ Tests using the ":skip: option in an ".. automodapi::" . """ with open(tmpdir.join('index.rst').strpath, 'w') as f: f.write(am_replacer_skip_str.format(options='')) run_sphinx_in_tmpdir(tmpdir) with open(tmpdir.join('index.rst.automodapi').strpath) as f: result = f.read() assert result == am_replacer_skip_expected am_replacer_invalidop_str = """ This comes before .. automodapi:: sphinx_automodapi.tests.example_module.functions :invalid-option: This comes after """ def test_am_replacer_invalidop(tmpdir, capsys): """ Tests that a sphinx warning is produced with an invalid option. """ with open(tmpdir.join('index.rst').strpath, 'w') as f: f.write(am_replacer_invalidop_str.format(options='')) run_sphinx_in_tmpdir(tmpdir, expect_error=True) stdout, stderr = capsys.readouterr() assert "Found additional options invalid-option in automodapi." in stderr am_replacer_cython_str = """ This comes before .. automodapi:: apyhtest_eva.unit02 {options} This comes after """ am_replacer_cython_expected = """ This comes before apyhtest_eva.unit02 Module -------------------------- .. automodule:: apyhtest_eva.unit02 Functions ^^^^^^^^^ .. automodsumm:: apyhtest_eva.unit02 :functions-only: :toctree: api This comes after """.format(empty='') def test_am_replacer_cython(tmpdir, cython_testpackage): # noqa """ Tests replacing an ".. automodapi::" for a Cython module. """ with open(tmpdir.join('index.rst').strpath, 'w') as f: f.write(am_replacer_cython_str.format(options='')) run_sphinx_in_tmpdir(tmpdir) with open(tmpdir.join('index.rst.automodapi').strpath) as f: result = f.read() assert result == am_replacer_cython_expected sphinx-automodapi-0.12/sphinx_automodapi/tests/test_automodsumm.py0000644000077000000240000000616213525230047025711 0ustar tomstaff00000000000000# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import copy from docutils.parsers.rst import directives, roles from . import cython_testpackage # noqa from .helpers import run_sphinx_in_tmpdir def setup_function(func): # This can be replaced with the docutils_namespace context manager once # it is in a stable release of Sphinx func._directives = copy(directives._directives) func._roles = copy(roles._roles) def teardown_function(func): directives._directives = func._directives roles._roles = func._roles # nosignatures ADD_RST = """ :orphan: add === .. currentmodule:: sphinx_automodapi.tests.example_module.mixed .. autofunction:: add """.strip() MIXEDSPAM_RST = """ :orphan: MixedSpam ========= .. currentmodule:: sphinx_automodapi.tests.example_module.mixed .. autoclass:: MixedSpam :show-inheritance: """.strip() def write_api_files_to_tmpdir(tmpdir): apidir = tmpdir.mkdir('api') with open(apidir.join('sphinx_automodapi.tests.example_module.mixed.add.rst').strpath, 'w') as f: f.write(ADD_RST) with open(apidir.join('sphinx_automodapi.tests.example_module.mixed.MixedSpam.rst').strpath, 'w') as f: f.write(MIXEDSPAM_RST) ams_to_asmry_str = """ Before .. automodsumm:: sphinx_automodapi.tests.example_module.mixed {options} And After """ ams_to_asmry_expected = """\ .. currentmodule:: sphinx_automodapi.tests.example_module.mixed .. autosummary:: add MixedSpam """ def test_ams_to_asmry(tmpdir): with open(tmpdir.join('index.rst').strpath, 'w') as f: f.write(ams_to_asmry_str.format(options='')) write_api_files_to_tmpdir(tmpdir) run_sphinx_in_tmpdir(tmpdir) with open(tmpdir.join('index.rst.automodsumm').strpath) as f: result = f.read() assert result == ams_to_asmry_expected def test_too_many_options(tmpdir, capsys): ops = ['', ':classes-only:', ':functions-only:'] ostr = '\n '.join(ops) with open(tmpdir.join('index.rst').strpath, 'w') as f: f.write(ams_to_asmry_str.format(options=ostr)) write_api_files_to_tmpdir(tmpdir) run_sphinx_in_tmpdir(tmpdir, expect_error=True) stdout, stderr = capsys.readouterr() assert ("[automodsumm] Defined more than one of functions-only, " "classes-only, and variables-only. Skipping this directive." in stderr) PILOT_RST = """ :orphan: pilot ===== .. currentmodule:: apyhtest_eva.unit02 .. autofunction:: pilot """.strip() ams_cython_str = """ Before .. automodsumm:: apyhtest_eva.unit02 :functions-only: And After """ ams_cython_expected = """\ .. currentmodule:: apyhtest_eva.unit02 .. autosummary:: pilot """ def test_ams_cython(tmpdir, cython_testpackage): # noqa with open(tmpdir.join('index.rst').strpath, 'w') as f: f.write(ams_cython_str) apidir = tmpdir.mkdir('api') with open(apidir.join('apyhtest_eva.unit02.pilot.rst').strpath, 'w') as f: f.write(PILOT_RST) run_sphinx_in_tmpdir(tmpdir) with open(tmpdir.join('index.rst.automodsumm').strpath) as f: result = f.read() assert result == ams_cython_expected sphinx-automodapi-0.12/sphinx_automodapi/tests/test_cases.py0000644000077000000240000001045413525230047024434 0ustar tomstaff00000000000000# The following tests use a plain Python example module that is at # sphinx_automodapi.tests.example_module. # We store different cases in the cases sub-directory of the tests directory import os import io import sys import glob import shutil from itertools import product import pytest from copy import deepcopy, copy from sphinx.util.osutil import ensuredir from docutils.parsers.rst import directives, roles from .helpers import build_main, write_conf CASES_ROOT = os.path.join(os.path.dirname(__file__), 'cases') CASES_DIRS = glob.glob(os.path.join(CASES_ROOT, '*')) PARALLEL = {False, True} intersphinx_mapping = { 'python': ('https://docs.python.org/{0}/'.format(sys.version_info[0]), None) } DEFAULT_CONF = {'source_suffix': '.rst', 'master_doc': 'index', 'nitpicky': True, 'extensions': ['sphinx.ext.intersphinx', 'sphinx_automodapi.automodapi'], 'suppress_warnings': ['app.add_directive', 'app.add_node'], 'intersphinx_mapping': intersphinx_mapping, 'nitpick_ignore': [('py:class', 'sphinx_automodapi.tests.example_module.classes.BaseSpam'), ('py:class', 'sphinx_automodapi.tests.example_module.other_classes.BaseFoo'), # See the following links for why these classes need to be ignored. # This only seems to be necessary for Python 2.7. # # https://trac.sagemath.org/ticket/19211 # https://stackoverflow.com/q/11417221/3776794 ('py:class', '_abcoll.Sequence'), ('py:class', '_abcoll.Iterable'), ('py:class', '_abcoll.Container'), ('py:class', '_abcoll.Sized')]} def setup_function(func): # This can be replaced with the docutils_namespace context manager once # it is in a stable release of Sphinx func._directives = copy(directives._directives) func._roles = copy(roles._roles) def teardown_function(func): directives._directives = func._directives roles._roles = func._roles @pytest.mark.parametrize(('case_dir', 'parallel'), product(CASES_DIRS, PARALLEL)) def test_run_full_case(tmpdir, case_dir, parallel): input_dir = os.path.join(case_dir, 'input') output_dir = os.path.join(case_dir, 'output') docs_dir = tmpdir.mkdir('docs').strpath conf = deepcopy(DEFAULT_CONF) conf.update({'automodapi_toctreedirnm': 'api', 'automodapi_writereprocessed': True, 'automodsumm_writereprocessed': True}) if os.path.basename(case_dir) in ('mixed_toplevel', 'mixed_toplevel_all_objects'): conf['extensions'].append('sphinx_automodapi.smart_resolver') start_dir = os.path.abspath('.') src_dir = 'src' if 'source_dir' in case_dir else '.' ensuredir(os.path.join(docs_dir, src_dir)) write_conf(os.path.join(os.path.join(docs_dir, src_dir), 'conf.py'), conf) for root, dirnames, filenames in os.walk(input_dir): for filename in filenames: root_dir = os.path.join(docs_dir, os.path.relpath(root, input_dir)) ensuredir(root_dir) input_file = os.path.join(root, filename) shutil.copy(input_file, root_dir) argv = ['-W', '-b', 'html', src_dir, '_build/html'] if parallel: argv.insert(0, '-j 4') try: os.chdir(docs_dir) status = build_main(argv=argv) finally: os.chdir(start_dir) assert status == 0 # Check that all expected output files are there and match the reference files for root, dirnames, filenames in os.walk(output_dir): for filename in filenames: path_reference = os.path.join(root, filename) path_relative = os.path.relpath(path_reference, output_dir) path_actual = os.path.join(docs_dir, path_relative) assert os.path.exists(path_actual) with io.open(path_actual, encoding='utf8') as f: actual = f.read() with io.open(path_reference, encoding='utf8') as f: reference = f.read() assert actual.strip() == reference.strip() sphinx-automodapi-0.12/sphinx_automodapi/tests/test_utils.py0000644000077000000240000000133113233635533024475 0ustar tomstaff00000000000000# namedtuple is needed for find_mod_objs so it can have a non-local module from collections import namedtuple from ..utils import find_mod_objs def test_find_mod_objs(): lnms, fqns, objs = find_mod_objs('sphinx_automodapi') # just check for astropy.test ... other things might be added, so we # shouldn't check that it's the only thing assert lnms == [] lnms, fqns, objs = find_mod_objs( 'sphinx_automodapi.tests.test_utils', onlylocals=False) assert namedtuple in objs lnms, fqns, objs = find_mod_objs( 'sphinx_automodapi.tests.test_utils', onlylocals=True) assert 'namedtuple' not in lnms assert 'collections.namedtuple' not in fqns assert namedtuple not in objs sphinx-automodapi-0.12/sphinx_automodapi/utils.py0000644000077000000240000001623013525230047022273 0ustar tomstaff00000000000000import inspect import sys import re import os from warnings import warn from distutils.version import LooseVersion from sphinx import __version__ from sphinx.ext.autosummary.generate import find_autosummary_in_docstring __all__ = ['cleanup_whitespace', 'find_mod_objs', 'find_autosummary_in_lines_for_automodsumm'] if sys.version_info[0] >= 3: def iteritems(dictionary): return dictionary.items() else: def iteritems(dictionary): return dictionary.iteritems() # We use \n instead of os.linesep because even on Windows, the generated files # use \n as the newline character. SPACE_NEWLINE = ' \n' SINGLE_NEWLINE = '\n' DOUBLE_NEWLINE = '\n\n' TRIPLE_NEWLINE = '\n\n\n' def cleanup_whitespace(text): """ Make sure there are never more than two consecutive newlines, and that there are no trailing whitespaces. """ # Get rid of overall leading/trailing whitespace text = text.strip() + '\n' # Get rid of trailing whitespace on each line while SPACE_NEWLINE in text: text = text.replace(SPACE_NEWLINE, SINGLE_NEWLINE) # Avoid too many consecutive newlines while TRIPLE_NEWLINE in text: text = text.replace(TRIPLE_NEWLINE, DOUBLE_NEWLINE) return text def find_mod_objs(modname, onlylocals=False): """ Returns all the public attributes of a module referenced by name. .. note:: The returned list *not* include subpackages or modules of `modname`,nor does it include private attributes (those that beginwith '_' or are not in `__all__`). Parameters ---------- modname : str The name of the module to search. onlylocals : bool If True, only attributes that are either members of `modname` OR one of its modules or subpackages will be included. Returns ------- localnames : list of str A list of the names of the attributes as they are named in the module `modname` . fqnames : list of str A list of the full qualified names of the attributes (e.g., ``astropy.utils.misc.find_mod_objs``). For attributes that are simple variables, this is based on the local name, but for functions or classes it can be different if they are actually defined elsewhere and just referenced in `modname`. objs : list of objects A list of the actual attributes themselves (in the same order as the other arguments) """ __import__(modname) mod = sys.modules[modname] if hasattr(mod, '__all__'): pkgitems = [(k, mod.__dict__[k]) for k in mod.__all__] else: pkgitems = [(k, mod.__dict__[k]) for k in dir(mod) if k[0] != '_'] # filter out modules and pull the names and objs out ismodule = inspect.ismodule localnames = [k for k, v in pkgitems if not ismodule(v)] objs = [v for k, v in pkgitems if not ismodule(v)] # fully qualified names can be determined from the object's module fqnames = [] for obj, lnm in zip(objs, localnames): if hasattr(obj, '__module__') and hasattr(obj, '__name__'): fqnames.append(obj.__module__ + '.' + obj.__name__) else: fqnames.append(modname + '.' + lnm) if onlylocals: valids = [fqn.startswith(modname) for fqn in fqnames] localnames = [e for i, e in enumerate(localnames) if valids[i]] fqnames = [e for i, e in enumerate(fqnames) if valids[i]] objs = [e for i, e in enumerate(objs) if valids[i]] return localnames, fqnames, objs def find_autosummary_in_lines_for_automodsumm(lines, module=None, filename=None): """Find out what items appear in autosummary:: directives in the given lines. Returns a list of (name, toctree, template, inherited_members) where *name* is a name of an object and *toctree* the :toctree: path of the corresponding autosummary directive (relative to the root of the file name), *template* the value of the :template: option, and *inherited_members* is the value of the :inherited-members: option. *toctree*, *template*, and *inherited_members* are ``None`` if the directive does not have the corresponding options set. .. note:: This is a slightly modified version of ``sphinx.ext.autosummary.generate.find_autosummary_in_lines`` which recognizes the ``inherited-members`` option. """ autosummary_re = re.compile(r'^(\s*)\.\.\s+autosummary::\s*') automodule_re = re.compile( r'^\s*\.\.\s+automodule::\s*([A-Za-z0-9_.]+)\s*$') module_re = re.compile( r'^\s*\.\.\s+(current)?module::\s*([a-zA-Z0-9_.]+)\s*$') autosummary_item_re = re.compile(r'^\s+(~?[_a-zA-Z][a-zA-Z0-9_.]*)\s*.*?') toctree_arg_re = re.compile(r'^\s+:toctree:\s*(.*?)\s*$') template_arg_re = re.compile(r'^\s+:template:\s*(.*?)\s*$') inherited_members_arg_re = re.compile(r'^\s+:inherited-members:\s*$') no_inherited_members_arg_re = re.compile(r'^\s+:no-inherited-members:\s*$') documented = [] toctree = None template = None inherited_members = None current_module = module in_autosummary = False base_indent = "" for line in lines: if in_autosummary: m = toctree_arg_re.match(line) if m: toctree = m.group(1) if filename: toctree = os.path.join(os.path.dirname(filename), toctree) continue m = template_arg_re.match(line) if m: template = m.group(1).strip() continue m = inherited_members_arg_re.match(line) if m: inherited_members = True continue m = no_inherited_members_arg_re.match(line) if m: inherited_members = False continue if line.strip().startswith(':'): warn(line) continue # skip options m = autosummary_item_re.match(line) if m: name = m.group(1).strip() if name.startswith('~'): name = name[1:] if current_module and \ not name.startswith(current_module + '.'): name = "%s.%s" % (current_module, name) documented.append((name, toctree, template, inherited_members)) continue if not line.strip() or line.startswith(base_indent + " "): continue in_autosummary = False m = autosummary_re.match(line) if m: in_autosummary = True base_indent = m.group(1) toctree = None template = None inherited_members = None continue m = automodule_re.search(line) if m: current_module = m.group(1).strip() # recurse into the automodule docstring documented.extend(find_autosummary_in_docstring( current_module, filename=filename)) continue m = module_re.match(line) if m: current_module = m.group(2) continue return documented sphinx-automodapi-0.12/sphinx_automodapi.egg-info/0000755000077000000240000000000013525230464022254 5ustar tomstaff00000000000000sphinx-automodapi-0.12/sphinx_automodapi.egg-info/PKG-INFO0000644000077000000240000000371713525230464023361 0ustar tomstaff00000000000000Metadata-Version: 2.1 Name: sphinx-automodapi Version: 0.12 Summary: Sphinx extension for auto-generating API documentation for entire modules Home-page: http://astropy.org Author: The Astropy Developers Author-email: astropy.team@gmail.com License: BSD 3-Clause License Description: |Azure Status| |Coverage Status| |PyPI| About ===== This is a Sphinx extension to automatically generate API pages for whole modules. It was originally developed for the Astropy project but is now available as a standalone package since it can be used for any other package. The documentation can be found on `ReadTheDocs `_. Running tests ------------- To run the tests, you can either do:: pytest sphinx_automodapi or if you have `tox `_ installed:: tox -e test .. |Azure Status| image:: https://dev.azure.com/astropy-project/sphinx-automodapi/_apis/build/status/astropy.sphinx-automodapi?branchName=master :target: https://dev.azure.com/astropy-project/sphinx-automodapi/_build/latest?definitionId=2&branchName=master .. |Coverage Status| image:: https://codecov.io/gh/astropy/sphinx-automodapi/branch/master/graph/badge.svg :target: https://codecov.io/gh/astropy/sphinx-automodapi .. |PyPI| image:: https://img.shields.io/pypi/v/sphinx-automodapi.svg :target: https://pypi.python.org/pypi/sphinx-automodapi Platform: UNKNOWN Classifier: Development Status :: 3 - Alpha Classifier: Intended Audience :: Developers Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 3 Classifier: Operating System :: OS Independent Classifier: License :: OSI Approved :: BSD License Provides-Extra: test sphinx-automodapi-0.12/sphinx_automodapi.egg-info/SOURCES.txt0000644000077000000240000002347213525230464024150 0ustar tomstaff00000000000000.coveragerc .gitignore CHANGES.rst LICENSE.rst MANIFEST.in README.rst azure-pipelines.yml azure-template.yml setup.cfg setup.py tox.ini docs/Makefile docs/automodapi.rst docs/automodsumm.rst docs/conf.py docs/index.rst sphinx_automodapi/__init__.py sphinx_automodapi/autodoc_enhancements.py sphinx_automodapi/automodapi.py sphinx_automodapi/automodsumm.py sphinx_automodapi/smart_resolver.py sphinx_automodapi/utils.py sphinx_automodapi.egg-info/PKG-INFO sphinx_automodapi.egg-info/SOURCES.txt sphinx_automodapi.egg-info/dependency_links.txt sphinx_automodapi.egg-info/not-zip-safe sphinx_automodapi.egg-info/requires.txt sphinx_automodapi.egg-info/top_level.txt sphinx_automodapi/templates/autosummary_core/base.rst sphinx_automodapi/templates/autosummary_core/class.rst sphinx_automodapi/templates/autosummary_core/module.rst sphinx_automodapi/tests/__init__.py sphinx_automodapi/tests/helpers.py sphinx_automodapi/tests/test_autodoc_enhancements.py sphinx_automodapi/tests/test_automodapi.py sphinx_automodapi/tests/test_automodsumm.py sphinx_automodapi/tests/test_cases.py sphinx_automodapi/tests/test_utils.py sphinx_automodapi/tests/cases/abstract_classes/README.md sphinx_automodapi/tests/cases/abstract_classes/input/index.rst sphinx_automodapi/tests/cases/abstract_classes/output/index.rst.automodapi sphinx_automodapi/tests/cases/abstract_classes/output/index.rst.automodsumm sphinx_automodapi/tests/cases/abstract_classes/output/api/sphinx_automodapi.tests.example_module.abstract_classes.SequenceSubclass.rst sphinx_automodapi/tests/cases/classes_no_inherit/README.md sphinx_automodapi/tests/cases/classes_no_inherit/input/index.rst sphinx_automodapi/tests/cases/classes_no_inherit/output/index.rst.automodapi sphinx_automodapi/tests/cases/classes_no_inherit/output/index.rst.automodsumm sphinx_automodapi/tests/cases/classes_no_inherit/output/api/sphinx_automodapi.tests.example_module.classes.Egg.rst sphinx_automodapi/tests/cases/classes_with_inherit/README.md sphinx_automodapi/tests/cases/classes_with_inherit/input/index.rst sphinx_automodapi/tests/cases/classes_with_inherit/output/index.rst.automodapi sphinx_automodapi/tests/cases/classes_with_inherit/output/index.rst.automodsumm sphinx_automodapi/tests/cases/classes_with_inherit/output/api/sphinx_automodapi.tests.example_module.classes.Egg.rst sphinx_automodapi/tests/cases/classes_with_inherit/output/api/sphinx_automodapi.tests.example_module.classes.Spam.rst sphinx_automodapi/tests/cases/func_headings/README.md sphinx_automodapi/tests/cases/func_headings/input/index.rst sphinx_automodapi/tests/cases/func_headings/output/index.rst.automodapi sphinx_automodapi/tests/cases/func_headings/output/index.rst.automodsumm sphinx_automodapi/tests/cases/func_headings/output/api/sphinx_automodapi.tests.example_module.functions.add.rst sphinx_automodapi/tests/cases/func_headings/output/api/sphinx_automodapi.tests.example_module.functions.multiply.rst sphinx_automodapi/tests/cases/func_noheading/README.md sphinx_automodapi/tests/cases/func_noheading/input/index.rst sphinx_automodapi/tests/cases/func_noheading/output/index.rst.automodapi sphinx_automodapi/tests/cases/func_noheading/output/index.rst.automodsumm sphinx_automodapi/tests/cases/func_noheading/output/api/sphinx_automodapi.tests.example_module.functions.add.rst sphinx_automodapi/tests/cases/func_noheading/output/api/sphinx_automodapi.tests.example_module.functions.multiply.rst sphinx_automodapi/tests/cases/func_nomaindocstring/README.md sphinx_automodapi/tests/cases/func_nomaindocstring/input/index.rst sphinx_automodapi/tests/cases/func_nomaindocstring/output/index.rst.automodapi sphinx_automodapi/tests/cases/func_nomaindocstring/output/index.rst.automodsumm sphinx_automodapi/tests/cases/func_nomaindocstring/output/api/sphinx_automodapi.tests.example_module.functions.add.rst sphinx_automodapi/tests/cases/func_nomaindocstring/output/api/sphinx_automodapi.tests.example_module.functions.multiply.rst sphinx_automodapi/tests/cases/func_simple/README.md sphinx_automodapi/tests/cases/func_simple/input/index.rst sphinx_automodapi/tests/cases/func_simple/output/index.rst.automodapi sphinx_automodapi/tests/cases/func_simple/output/index.rst.automodsumm sphinx_automodapi/tests/cases/func_simple/output/api/sphinx_automodapi.tests.example_module.functions.add.rst sphinx_automodapi/tests/cases/func_simple/output/api/sphinx_automodapi.tests.example_module.functions.multiply.rst sphinx_automodapi/tests/cases/inherited_members/README.md sphinx_automodapi/tests/cases/inherited_members/input/index.rst sphinx_automodapi/tests/cases/inherited_members/output/index.rst.automodapi sphinx_automodapi/tests/cases/inherited_members/output/index.rst.automodsumm sphinx_automodapi/tests/cases/inherited_members/output/api/sphinx_automodapi.tests.example_module.classes.Egg.rst sphinx_automodapi/tests/cases/inherited_members/output/api/sphinx_automodapi.tests.example_module.classes.Spam.rst sphinx_automodapi/tests/cases/inherited_members/output/api/sphinx_automodapi.tests.example_module.other_classes.Foo.rst sphinx_automodapi/tests/cases/mixed_toplevel/README.md sphinx_automodapi/tests/cases/mixed_toplevel/input/index.rst sphinx_automodapi/tests/cases/mixed_toplevel/output/index.rst.automodapi sphinx_automodapi/tests/cases/mixed_toplevel/output/index.rst.automodsumm sphinx_automodapi/tests/cases/mixed_toplevel/output/api/sphinx_automodapi.tests.example_module.Egg.rst sphinx_automodapi/tests/cases/mixed_toplevel/output/api/sphinx_automodapi.tests.example_module.Spam.rst sphinx_automodapi/tests/cases/mixed_toplevel/output/api/sphinx_automodapi.tests.example_module.add.rst sphinx_automodapi/tests/cases/mixed_toplevel/output/api/sphinx_automodapi.tests.example_module.multiply.rst sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/README.md sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/input/index.rst sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/index.rst.automodapi sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/index.rst.automodsumm sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_automodapi.tests.example_module.Egg.rst sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_automodapi.tests.example_module.FUNNY_WALK_STEPS.rst sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_automodapi.tests.example_module.PARROT_STATE.rst sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_automodapi.tests.example_module.Spam.rst sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_automodapi.tests.example_module.add.rst sphinx_automodapi/tests/cases/mixed_toplevel_all_objects/output/api/sphinx_automodapi.tests.example_module.multiply.rst sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/README.md sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/input/index.rst sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/index.rst.automodapi sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/index.rst.automodsumm sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/sphinx_automodapi.tests.example_module.Egg.rst sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/sphinx_automodapi.tests.example_module.Spam.rst sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/sphinx_automodapi.tests.example_module.add.rst sphinx_automodapi/tests/cases/mixed_toplevel_nodiagram/output/api/sphinx_automodapi.tests.example_module.multiply.rst sphinx_automodapi/tests/cases/nested/README.md sphinx_automodapi/tests/cases/nested/input/index.rst sphinx_automodapi/tests/cases/nested/input/tests/example_module/index.rst sphinx_automodapi/tests/cases/nested/input/tests/example_module/references.txt sphinx_automodapi/tests/cases/nested/output/api/sphinx_automodapi.tests.example_module.functions_with_ref.add.rst sphinx_automodapi/tests/cases/nested/output/api/sphinx_automodapi.tests.example_module.functions_with_ref.multiply.rst sphinx_automodapi/tests/cases/nested/output/tests/example_module/index.rst.automodapi sphinx_automodapi/tests/cases/nested/output/tests/example_module/index.rst.automodsumm sphinx_automodapi/tests/cases/non_ascii/README.md sphinx_automodapi/tests/cases/non_ascii/input/index.rst sphinx_automodapi/tests/cases/non_ascii/output/index.rst.automodapi sphinx_automodapi/tests/cases/non_ascii/output/index.rst.automodsumm sphinx_automodapi/tests/cases/non_ascii/output/api/sphinx_automodapi.tests.example_module.functions.add.rst sphinx_automodapi/tests/cases/non_ascii/output/api/sphinx_automodapi.tests.example_module.functions.multiply.rst sphinx_automodapi/tests/cases/source_dir/README.md sphinx_automodapi/tests/cases/source_dir/input/src/index.rst sphinx_automodapi/tests/cases/source_dir/output/src/index.rst.automodapi sphinx_automodapi/tests/cases/source_dir/output/src/index.rst.automodsumm sphinx_automodapi/tests/cases/source_dir/output/src/api/sphinx_automodapi.tests.example_module.functions.add.rst sphinx_automodapi/tests/cases/source_dir/output/src/api/sphinx_automodapi.tests.example_module.functions.multiply.rst sphinx_automodapi/tests/cases/variables/README.md sphinx_automodapi/tests/cases/variables/input/index.rst sphinx_automodapi/tests/cases/variables/output/index.rst.automodapi sphinx_automodapi/tests/cases/variables/output/index.rst.automodsumm sphinx_automodapi/tests/cases/variables/output/api/sphinx_automodapi.tests.example_module.variables.FUNNY_WALK_STEPS.rst sphinx_automodapi/tests/cases/variables/output/api/sphinx_automodapi.tests.example_module.variables.PARROT_STATE.rst sphinx_automodapi/tests/example_module/__init__.py sphinx_automodapi/tests/example_module/abstract_classes.py sphinx_automodapi/tests/example_module/classes.py sphinx_automodapi/tests/example_module/functions.py sphinx_automodapi/tests/example_module/functions_with_ref.py sphinx_automodapi/tests/example_module/mixed.py sphinx_automodapi/tests/example_module/other_classes.py sphinx_automodapi/tests/example_module/variables.pysphinx-automodapi-0.12/sphinx_automodapi.egg-info/dependency_links.txt0000644000077000000240000000000113525230464026322 0ustar tomstaff00000000000000 sphinx-automodapi-0.12/sphinx_automodapi.egg-info/not-zip-safe0000644000077000000240000000000113525230464024502 0ustar tomstaff00000000000000 sphinx-automodapi-0.12/sphinx_automodapi.egg-info/requires.txt0000644000077000000240000000007613525230464024657 0ustar tomstaff00000000000000sphinx>=1.7 [test] pytest pytest-cov cython codecov coverage sphinx-automodapi-0.12/sphinx_automodapi.egg-info/top_level.txt0000644000077000000240000000002213525230464025000 0ustar tomstaff00000000000000sphinx_automodapi sphinx-automodapi-0.12/tox.ini0000644000077000000240000000131613525230047016340 0ustar tomstaff00000000000000[tox] envlist = py27-test py37-test py27-test-clocale py37-test-clocale py27-test-sphinx17 py36-test-sphinx17 py37-test-sphinx18 py37-test-sphinx20 py37-test-sphinxdev requires = pip >= 18.0 setuptools >= 30.3.0 [testenv] changedir = .tmp/{envname} deps = sphinx17: sphinx==1.7.9 sphinx18: sphinx==1.8.5 sphinx20: sphinx==2.0.1 sphinx21: sphinx==2.1.2 sphinxdev: git+https://github.com/sphinx-doc/sphinx.git extras = test: test commands = test: pytest --pyargs sphinx_automodapi --cov-append --cov sphinx_automodapi --cov-report= setenv = clocale: LC_CTYPE=C clocale: LC_ALL=C clocale: LANG=C platform = clocale: linux|darwin