repoze.sphinx.autointerface-1.0.0/ 0000755 0001750 0001750 00000000000 14243621326 016505 5 ustar nilesh nilesh repoze.sphinx.autointerface-1.0.0/README.rst 0000644 0001750 0001750 00000003617 14243620167 020205 0 ustar nilesh nilesh repoze.sphinx.autointerface README
==================================
.. image:: https://github.com/repoze/repoze.sphinx.autointerface/actions/workflows/ci-tests.yml/badge.svg
:target: https://github.com/repoze/repoze.sphinx.autointerface/actions/workflows/ci-tests.yml
.. image:: https://img.shields.io/pypi/v/repoze.sphinx.autointerface.svg
:target: https://pypi.python.org/pypi/repoze.sphinx.autointerface
.. image:: https://img.shields.io/pypi/pyversions/repoze.sphinx.autointerface.svg
:target: https://pypi.python.org/pypi/repoze.sphinx.autointerface
Overview
--------
Thie package defines an extension for the
`Sphinx `_ documentation system.
The extension allows generation of API documentation by introspection of
`zope.interface `_ instances in
code.
Installation
------------
Install via ``pip``:
.. code-block:: bash
pip install repoze.sphinx.autointerface
Registering the Extension
-------------------------
Add ``repoze.sphinx.autointerface`` to the ``extensions`` list in the
``conf.py`` of the Sphinx documentation for your product.
.. code-block:: python
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"repoze.sphinx.autointerface",
]
Using the Extension
-------------------
At appropriate points in your document, call out the autodoc interface.
.. code-block:: rst
.. autointerface:: yourpackage.interfaces.IFoo
Output from the directive includes
- the fully-qualified interface name
- any base interfaces
- the docstring from the interface, rendered as reStructuredText
- the members of the interface (methods and attributes)
* For each attribute, the output includes the attribute name
and its description.
* For each method, the output includes the method name, its signature,
and its docstring (also rendered as reStructuredText).
repoze.sphinx.autointerface-1.0.0/CONTRIBUTORS.txt 0000644 0001750 0001750 00000011116 14243620167 021205 0 ustar nilesh nilesh Repoze Project Contributor Agreement
====================================
The submitter agrees by adding his or her name within the section below named
"Contributors" and submitting the resulting modified document to the
canonical shared repository location for this software project (whether
directly, as a user with "direct commit access", or via a "pull request"), he
or she is signing a contract electronically. The submitter becomes a
Contributor after a) he or she signs this document by adding their name
beneath the "Contributors" section below, and b) the resulting document is
accepted into the canonical version control repository.
Treatment of Account
---------------------
Contributor will not allow anyone other than the Contributor to use his or
her username or source repository login to submit code to a Repoze Project
source repository. Should Contributor become aware of any such use,
Contributor will immediately by notifying Agendaless Consulting.
Notification must be performed by sending an email to
webmaster@agendaless.com. Until such notice is received, Contributor will be
presumed to have taken all actions made through Contributor's account. If the
Contributor has direct commit access, Agendaless Consulting will have
complete control and discretion over capabilities assigned to Contributor's
account, and may disable Contributor's account for any reason at any time.
Legal Effect of Contribution
----------------------------
Upon submitting a change or new work to a Repoze Project source Repository (a
"Contribution"), you agree to assign, and hereby do assign, a one-half
interest of all right, title and interest in and to copyright and other
intellectual property rights with respect to your new and original portions
of the Contribution to Agendaless Consulting. You and Agendaless Consulting
each agree that the other shall be free to exercise any and all exclusive
rights in and to the Contribution, without accounting to one another,
including without limitation, the right to license the Contribution to others
under the Repoze Public License. This agreement shall run with title to the
Contribution. Agendaless Consulting does not convey to you any right, title
or interest in or to the Program or such portions of the Contribution that
were taken from the Program. Your transmission of a submission to the Repoze
Project source Repository and marks of identification concerning the
Contribution itself constitute your intent to contribute and your assignment
of the work in accordance with the provisions of this Agreement.
License Terms
-------------
Code committed to the Repoze Project source repository (Committed Code) must
be governed by the Repoze Public License (http://repoze.org/LICENSE.txt, aka
"the RPL") or another license acceptable to Agendaless Consulting. Until
Agendaless Consulting declares in writing an acceptable license other than
the RPL, only the RPL shall be used. A list of exceptions is detailed within
the "Licensing Exceptions" section of this document, if one exists.
Representations, Warranty, and Indemnification
----------------------------------------------
Contributor represents and warrants that the Committed Code does not violate
the rights of any person or entity, and that the Contributor has legal
authority to enter into this Agreement and legal authority over Contributed
Code. Further, Contributor indemnifies Agendaless Consulting against
violations.
Cryptography
------------
Contributor understands that cryptographic code may be subject to government
regulations with which Agendaless Consulting and/or entities using Committed
Code must comply. Any code which contains any of the items listed below must
not be checked-in until Agendaless Consulting staff has been notified and has
approved such contribution in writing.
- Cryptographic capabilities or features
- Calls to cryptographic features
- User interface elements which provide context relating to cryptography
- Code which may, under casual inspection, appear to be cryptographic.
Notices
-------
Contributor confirms that any notices required will be included in any
Committed Code.
Licensing Exceptions
====================
None.
List of Contributors
====================
The below-signed are contributors to a code repository that is part of the
project named "repoze.sphinx.autointerface".
Each below-signed contributor has read, understand and agrees to the terms
above in the section within this document entitled "Repoze Project Contributor
Agreement" as of the date beside his or her name.
Contributors
------------
- Tres Seaver, 2011/03/22
- Jason Madden, 2013/01/10
- Steve Piercy, 2021/05/11
repoze.sphinx.autointerface-1.0.0/TODO.txt 0000644 0001750 0001750 00000000374 14242143053 020012 0 ustar nilesh nilesh repoze.sphinx.autointerface TODOs
=================================
- [X] Add an :interface: mode and corresponding directive.
- [_] Get our output to look more like that produced by '.. autoclass::'.
Probably blocks in the ':interface:' mode.
repoze.sphinx.autointerface-1.0.0/CHANGES.rst 0000644 0001750 0001750 00000005331 14243621263 020311 0 ustar nilesh nilesh repoze.sphinx.autointerface Changelog
=====================================
1.0.0 (2022-05-26)
------------------
- Remove sphinx.util.force_decode. Previously we hacked it in to support Python
2 and Sphinx 3.x, but Sphinx 4.0 deprecated it and dropped Python 2 support.
- Replace Travis-CI with GitHub Actions
- Add support for Python 3.6, 3.7, 3.8, 3.9, 3.10, and PyPy3.
- Drop support for Python 2.7, 3.3, 3.4, 3.5, and PyPy.
- Update to work with newer Sphinx versions:
* Sphinx.domains -> Sphinx.registry.domains
* Sphinx.override_domain(D) -> Sphinx.add_domain(D, override=True)
- Drop support for Sphinx < 4.0.
0.8 (2016-03-28)
----------------
- Add support for Python 3.3, 3.4, and 3.5.
- Drop support for Python 2.6 and 3.2.
- Allow cross references using the ``:class:`` directive to use the
``.`` for "fuzzy" searching. Thanks to Jason Madden for the patch.
0.7.1 (2012-09-15)
------------------
- Remove ``setup.py`` dependency on ``ez_setup.py``.
0.7.0 (2012-06-20)
------------------
- PyPy compatibility.
- Python 3.2+ compatibility. Thanks to Arfrever for the patch.
- Include interface docs under the ``automodule`` directive. Thanks to
Krys Lawrence for the patch.
0.6.2 (2011-02-13)
------------------
- Fix ``TypeError: 'NoneType' object is not iterable`` error when generating
a rendering of an interface under Python 2.7.
0.6.1 (2011-01-28)
------------------
- Fix ':member-order: bysource' handling.
0.6 (2011-01-28)
----------------
- Correctly handle ':members:' values explicitly set in the directive.
0.5 (2011-01-18)
----------------
- Added support for the ':member-order:' flag, which can take one of the
three stock values, "alphabetical", "groupwise", or "bysource". By
default, members are documented in "hash" order.
0.4 (2010-07-26)
----------------
- Fixed compatibility with Sphinx 1.0
- Un-break PyPI ReST/HTML-rendering again.
0.3 (2009-10-25)
----------------
- Refactor sphinx integration. There are now separate ``autointerface``
and ``interface`` directives.
0.2.1 (2009-08-20)
------------------
- Fix add_directive arguments to work with Sphinx 0.6.1, now required.
0.1.3 (2009-01-14)
------------------
- Coerce unicode path elements to str in ``_resolve_dotted_name``.
Note that non-ASCII path elements won't work: this fix just deals
with the case where the path was of type unicode.
- Fixed spelling of directive in README.txt.
- Added dependency on ``zope.interface``.
0.1.2 (2008-10-03)
------------------
- Packaging change: improved description in README.txt.
0.1.1 (2008-10-03)
------------------
- Packaging bug: the ``long_description`` was not rendering properly to
HTML on PyPI.
0.1 (2008-10-02)
----------------
- Initial release.
repoze.sphinx.autointerface-1.0.0/PKG-INFO 0000644 0001750 0001750 00000013556 14243621326 017614 0 ustar nilesh nilesh Metadata-Version: 2.1
Name: repoze.sphinx.autointerface
Version: 1.0.0
Summary: Sphinx extension: auto-generates API docs from Zope interfaces
Home-page: https://github.com/repoze/repoze.sphinx.autointerface/
Author: Agendaless Consulting
Author-email: repoze-dev@lists.repoze.org
License: BSD-derived (Repoze)
Project-URL: Documentation, https://github.com/repoze/repoze.sphinx.autointerface/
Project-URL: Changelog, https://github.com/repoze/repoze.sphinx.autointerface/blob/master/CHANGES.rst
Project-URL: Issue Tracker, https://github.com/repoze/repoze.sphinx.autointerface/issues
Keywords: web wsgi zope Sphinx
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
Provides-Extra: test
License-File: LICENSE.txt
repoze.sphinx.autointerface README
==================================
.. image:: https://github.com/repoze/repoze.sphinx.autointerface/actions/workflows/ci-tests.yml/badge.svg
:target: https://github.com/repoze/repoze.sphinx.autointerface/actions/workflows/ci-tests.yml
.. image:: https://img.shields.io/pypi/v/repoze.sphinx.autointerface.svg
:target: https://pypi.python.org/pypi/repoze.sphinx.autointerface
.. image:: https://img.shields.io/pypi/pyversions/repoze.sphinx.autointerface.svg
:target: https://pypi.python.org/pypi/repoze.sphinx.autointerface
Overview
--------
Thie package defines an extension for the
`Sphinx `_ documentation system.
The extension allows generation of API documentation by introspection of
`zope.interface `_ instances in
code.
Installation
------------
Install via ``pip``:
.. code-block:: bash
pip install repoze.sphinx.autointerface
Registering the Extension
-------------------------
Add ``repoze.sphinx.autointerface`` to the ``extensions`` list in the
``conf.py`` of the Sphinx documentation for your product.
.. code-block:: python
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"repoze.sphinx.autointerface",
]
Using the Extension
-------------------
At appropriate points in your document, call out the autodoc interface.
.. code-block:: rst
.. autointerface:: yourpackage.interfaces.IFoo
Output from the directive includes
- the fully-qualified interface name
- any base interfaces
- the docstring from the interface, rendered as reStructuredText
- the members of the interface (methods and attributes)
* For each attribute, the output includes the attribute name
and its description.
* For each method, the output includes the method name, its signature,
and its docstring (also rendered as reStructuredText).
repoze.sphinx.autointerface Changelog
=====================================
1.0.0 (2022-05-26)
------------------
- Remove sphinx.util.force_decode. Previously we hacked it in to support Python
2 and Sphinx 3.x, but Sphinx 4.0 deprecated it and dropped Python 2 support.
- Replace Travis-CI with GitHub Actions
- Add support for Python 3.6, 3.7, 3.8, 3.9, 3.10, and PyPy3.
- Drop support for Python 2.7, 3.3, 3.4, 3.5, and PyPy.
- Update to work with newer Sphinx versions:
* Sphinx.domains -> Sphinx.registry.domains
* Sphinx.override_domain(D) -> Sphinx.add_domain(D, override=True)
- Drop support for Sphinx < 4.0.
0.8 (2016-03-28)
----------------
- Add support for Python 3.3, 3.4, and 3.5.
- Drop support for Python 2.6 and 3.2.
- Allow cross references using the ``:class:`` directive to use the
``.`` for "fuzzy" searching. Thanks to Jason Madden for the patch.
0.7.1 (2012-09-15)
------------------
- Remove ``setup.py`` dependency on ``ez_setup.py``.
0.7.0 (2012-06-20)
------------------
- PyPy compatibility.
- Python 3.2+ compatibility. Thanks to Arfrever for the patch.
- Include interface docs under the ``automodule`` directive. Thanks to
Krys Lawrence for the patch.
0.6.2 (2011-02-13)
------------------
- Fix ``TypeError: 'NoneType' object is not iterable`` error when generating
a rendering of an interface under Python 2.7.
0.6.1 (2011-01-28)
------------------
- Fix ':member-order: bysource' handling.
0.6 (2011-01-28)
----------------
- Correctly handle ':members:' values explicitly set in the directive.
0.5 (2011-01-18)
----------------
- Added support for the ':member-order:' flag, which can take one of the
three stock values, "alphabetical", "groupwise", or "bysource". By
default, members are documented in "hash" order.
0.4 (2010-07-26)
----------------
- Fixed compatibility with Sphinx 1.0
- Un-break PyPI ReST/HTML-rendering again.
0.3 (2009-10-25)
----------------
- Refactor sphinx integration. There are now separate ``autointerface``
and ``interface`` directives.
0.2.1 (2009-08-20)
------------------
- Fix add_directive arguments to work with Sphinx 0.6.1, now required.
0.1.3 (2009-01-14)
------------------
- Coerce unicode path elements to str in ``_resolve_dotted_name``.
Note that non-ASCII path elements won't work: this fix just deals
with the case where the path was of type unicode.
- Fixed spelling of directive in README.txt.
- Added dependency on ``zope.interface``.
0.1.2 (2008-10-03)
------------------
- Packaging change: improved description in README.txt.
0.1.1 (2008-10-03)
------------------
- Packaging bug: the ``long_description`` was not rendering properly to
HTML on PyPI.
0.1 (2008-10-02)
----------------
- Initial release.
repoze.sphinx.autointerface-1.0.0/repoze.sphinx.autointerface.egg-info/ 0000755 0001750 0001750 00000000000 14243621326 025643 5 ustar nilesh nilesh repoze.sphinx.autointerface-1.0.0/repoze.sphinx.autointerface.egg-info/not-zip-safe 0000644 0001750 0001750 00000000001 14243621325 030070 0 ustar nilesh nilesh
repoze.sphinx.autointerface-1.0.0/repoze.sphinx.autointerface.egg-info/top_level.txt 0000644 0001750 0001750 00000000007 14243621325 030371 0 ustar nilesh nilesh repoze
repoze.sphinx.autointerface-1.0.0/repoze.sphinx.autointerface.egg-info/PKG-INFO 0000644 0001750 0001750 00000013556 14243621325 026751 0 ustar nilesh nilesh Metadata-Version: 2.1
Name: repoze.sphinx.autointerface
Version: 1.0.0
Summary: Sphinx extension: auto-generates API docs from Zope interfaces
Home-page: https://github.com/repoze/repoze.sphinx.autointerface/
Author: Agendaless Consulting
Author-email: repoze-dev@lists.repoze.org
License: BSD-derived (Repoze)
Project-URL: Documentation, https://github.com/repoze/repoze.sphinx.autointerface/
Project-URL: Changelog, https://github.com/repoze/repoze.sphinx.autointerface/blob/master/CHANGES.rst
Project-URL: Issue Tracker, https://github.com/repoze/repoze.sphinx.autointerface/issues
Keywords: web wsgi zope Sphinx
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
Provides-Extra: test
License-File: LICENSE.txt
repoze.sphinx.autointerface README
==================================
.. image:: https://github.com/repoze/repoze.sphinx.autointerface/actions/workflows/ci-tests.yml/badge.svg
:target: https://github.com/repoze/repoze.sphinx.autointerface/actions/workflows/ci-tests.yml
.. image:: https://img.shields.io/pypi/v/repoze.sphinx.autointerface.svg
:target: https://pypi.python.org/pypi/repoze.sphinx.autointerface
.. image:: https://img.shields.io/pypi/pyversions/repoze.sphinx.autointerface.svg
:target: https://pypi.python.org/pypi/repoze.sphinx.autointerface
Overview
--------
Thie package defines an extension for the
`Sphinx `_ documentation system.
The extension allows generation of API documentation by introspection of
`zope.interface `_ instances in
code.
Installation
------------
Install via ``pip``:
.. code-block:: bash
pip install repoze.sphinx.autointerface
Registering the Extension
-------------------------
Add ``repoze.sphinx.autointerface`` to the ``extensions`` list in the
``conf.py`` of the Sphinx documentation for your product.
.. code-block:: python
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"repoze.sphinx.autointerface",
]
Using the Extension
-------------------
At appropriate points in your document, call out the autodoc interface.
.. code-block:: rst
.. autointerface:: yourpackage.interfaces.IFoo
Output from the directive includes
- the fully-qualified interface name
- any base interfaces
- the docstring from the interface, rendered as reStructuredText
- the members of the interface (methods and attributes)
* For each attribute, the output includes the attribute name
and its description.
* For each method, the output includes the method name, its signature,
and its docstring (also rendered as reStructuredText).
repoze.sphinx.autointerface Changelog
=====================================
1.0.0 (2022-05-26)
------------------
- Remove sphinx.util.force_decode. Previously we hacked it in to support Python
2 and Sphinx 3.x, but Sphinx 4.0 deprecated it and dropped Python 2 support.
- Replace Travis-CI with GitHub Actions
- Add support for Python 3.6, 3.7, 3.8, 3.9, 3.10, and PyPy3.
- Drop support for Python 2.7, 3.3, 3.4, 3.5, and PyPy.
- Update to work with newer Sphinx versions:
* Sphinx.domains -> Sphinx.registry.domains
* Sphinx.override_domain(D) -> Sphinx.add_domain(D, override=True)
- Drop support for Sphinx < 4.0.
0.8 (2016-03-28)
----------------
- Add support for Python 3.3, 3.4, and 3.5.
- Drop support for Python 2.6 and 3.2.
- Allow cross references using the ``:class:`` directive to use the
``.`` for "fuzzy" searching. Thanks to Jason Madden for the patch.
0.7.1 (2012-09-15)
------------------
- Remove ``setup.py`` dependency on ``ez_setup.py``.
0.7.0 (2012-06-20)
------------------
- PyPy compatibility.
- Python 3.2+ compatibility. Thanks to Arfrever for the patch.
- Include interface docs under the ``automodule`` directive. Thanks to
Krys Lawrence for the patch.
0.6.2 (2011-02-13)
------------------
- Fix ``TypeError: 'NoneType' object is not iterable`` error when generating
a rendering of an interface under Python 2.7.
0.6.1 (2011-01-28)
------------------
- Fix ':member-order: bysource' handling.
0.6 (2011-01-28)
----------------
- Correctly handle ':members:' values explicitly set in the directive.
0.5 (2011-01-18)
----------------
- Added support for the ':member-order:' flag, which can take one of the
three stock values, "alphabetical", "groupwise", or "bysource". By
default, members are documented in "hash" order.
0.4 (2010-07-26)
----------------
- Fixed compatibility with Sphinx 1.0
- Un-break PyPI ReST/HTML-rendering again.
0.3 (2009-10-25)
----------------
- Refactor sphinx integration. There are now separate ``autointerface``
and ``interface`` directives.
0.2.1 (2009-08-20)
------------------
- Fix add_directive arguments to work with Sphinx 0.6.1, now required.
0.1.3 (2009-01-14)
------------------
- Coerce unicode path elements to str in ``_resolve_dotted_name``.
Note that non-ASCII path elements won't work: this fix just deals
with the case where the path was of type unicode.
- Fixed spelling of directive in README.txt.
- Added dependency on ``zope.interface``.
0.1.2 (2008-10-03)
------------------
- Packaging change: improved description in README.txt.
0.1.1 (2008-10-03)
------------------
- Packaging bug: the ``long_description`` was not rendering properly to
HTML on PyPI.
0.1 (2008-10-02)
----------------
- Initial release.
repoze.sphinx.autointerface-1.0.0/repoze.sphinx.autointerface.egg-info/dependency_links.txt 0000644 0001750 0001750 00000000001 14243621325 031710 0 ustar nilesh nilesh
repoze.sphinx.autointerface-1.0.0/repoze.sphinx.autointerface.egg-info/SOURCES.txt 0000644 0001750 0001750 00000001305 14243621325 027525 0 ustar nilesh nilesh CHANGES.rst
CONTRIBUTORS.txt
COPYRIGHT.txt
LICENSE.txt
MANIFEST.in
README.rst
TODO.txt
setup.py
tox.ini
.github/workflows/ci-tests.yml
repoze/__init__.py
repoze.sphinx.autointerface.egg-info/PKG-INFO
repoze.sphinx.autointerface.egg-info/SOURCES.txt
repoze.sphinx.autointerface.egg-info/dependency_links.txt
repoze.sphinx.autointerface.egg-info/namespace_packages.txt
repoze.sphinx.autointerface.egg-info/not-zip-safe
repoze.sphinx.autointerface.egg-info/requires.txt
repoze.sphinx.autointerface.egg-info/top_level.txt
repoze/sphinx/__init__.py
repoze/sphinx/autointerface.py
repoze/sphinx/tests/__init__.py
repoze/sphinx/tests/test_autointerface.py
repoze/sphinx/tests/util.py
repoze/sphinx/tests/root/conf.py repoze.sphinx.autointerface-1.0.0/repoze.sphinx.autointerface.egg-info/namespace_packages.txt 0000644 0001750 0001750 00000000025 14243621325 032172 0 ustar nilesh nilesh repoze
repoze.sphinx
repoze.sphinx.autointerface-1.0.0/repoze.sphinx.autointerface.egg-info/requires.txt 0000644 0001750 0001750 00000000076 14243621325 030245 0 ustar nilesh nilesh zope.interface
Sphinx>=4.0
setuptools
[test]
zope.testrunner
repoze.sphinx.autointerface-1.0.0/tox.ini 0000644 0001750 0001750 00000001516 14243620167 020025 0 ustar nilesh nilesh [tox]
envlist =
py36,py37,py38,py39,py310,pypy3
[testenv]
usedevelop = true
commands =
zope-testrunner --test-path={toxinidir}
deps =
zope.testrunner
;[testenv:format]
;skip_install = true
;commands =
; flake8 repoze tests setup.py
; isort --check-only --df repoze tests setup.py
; black --check --diff repoze tests setup.py
;deps =
; flake8
; black
; isort
[testenv:build]
skip_install = true
commands =
# clean up build/ and dist/ folders
python -c 'import shutil; shutil.rmtree("dist", ignore_errors=True); shutil.rmtree("build", ignore_errors=True)'
# build sdist and wheel
python -m build --sdist --wheel --skip-dependencies --no-isolation {toxinidir}
# check long_description via CHANGES and README
twine check dist/*
check-manifest
deps =
build
check-manifest
twine
repoze.sphinx.autointerface-1.0.0/setup.py 0000644 0001750 0001750 00000005016 14243620523 020217 0 ustar nilesh nilesh ##############################################################################
#
# Copyright (c) 2008 Agendaless Consulting and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the BSD-like license at
# http://www.repoze.org/LICENSE.txt. A copy of the license should accompany
# this distribution. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
# EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND
# FITNESS FOR A PARTICULAR PURPOSE
#
##############################################################################
from setuptools import setup, find_packages
def readfile(name):
with open(name) as f:
return f.read()
README = readfile("README.rst")
CHANGES = readfile("CHANGES.rst")
tests_require = [
"zope.testrunner",
]
setup(
name="repoze.sphinx.autointerface",
version="1.0.0",
description="Sphinx extension: auto-generates API docs from Zope interfaces",
long_description=README + "\n\n" + CHANGES,
long_description_content_type='text/x-rst',
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
keywords="web wsgi zope Sphinx",
author="Agendaless Consulting",
author_email="repoze-dev@lists.repoze.org",
url="https://github.com/repoze/repoze.sphinx.autointerface/",
project_urls={
"Documentation": "https://github.com/repoze/repoze.sphinx.autointerface/",
"Changelog": "https://github.com/repoze/repoze.sphinx.autointerface/blob/master/CHANGES.rst",
"Issue Tracker": "https://github.com/repoze/repoze.sphinx.autointerface/issues",
},
license="BSD-derived (Repoze)",
packages=find_packages(),
include_package_data=True,
namespace_packages=["repoze", "repoze.sphinx"],
zip_safe=False,
python_requires=">=3.6",
tests_require=tests_require,
install_requires=[
"zope.interface",
"Sphinx >= 4.0",
"setuptools",
],
extras_require={
"test": tests_require,
},
)
repoze.sphinx.autointerface-1.0.0/LICENSE.txt 0000644 0001750 0001750 00000003377 14242143053 020335 0 ustar nilesh nilesh License
A copyright notice accompanies this license document that identifies
the copyright holders.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions in source code must retain the accompanying
copyright notice, this list of conditions, and the following
disclaimer.
2. Redistributions in binary form must reproduce the accompanying
copyright notice, this list of conditions, and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
3. Names of the copyright holders must not be used to endorse or
promote products derived from this software without prior
written permission from the copyright holders.
4. If any files are modified, you must cause the modified files to
carry prominent notices stating that you changed the files and
the date of any change.
Disclaimer
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND
ANY EXPRESSED 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
HOLDERS 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.
repoze.sphinx.autointerface-1.0.0/setup.cfg 0000644 0001750 0001750 00000000046 14243621326 020326 0 ustar nilesh nilesh [egg_info]
tag_build =
tag_date = 0
repoze.sphinx.autointerface-1.0.0/COPYRIGHT.txt 0000644 0001750 0001750 00000000155 14242143053 020612 0 ustar nilesh nilesh Copyright (c) 2008 Agendaless Consulting and Contributors.
(http://www.agendaless.com), All Rights Reserved
repoze.sphinx.autointerface-1.0.0/MANIFEST.in 0000644 0001750 0001750 00000000343 14243620167 020245 0 ustar nilesh nilesh graft repoze
include README.rst
include CHANGES.rst
include CONTRIBUTORS.txt LICENSE.txt COPYRIGHT.txt
include tox.ini .travis.yml
include TODO.txt
graft .github
global-exclude __pycache__ *.py[cod]
global-exclude .DS_Store
repoze.sphinx.autointerface-1.0.0/repoze/ 0000755 0001750 0001750 00000000000 14243621326 020011 5 ustar nilesh nilesh repoze.sphinx.autointerface-1.0.0/repoze/sphinx/ 0000755 0001750 0001750 00000000000 14243621326 021322 5 ustar nilesh nilesh repoze.sphinx.autointerface-1.0.0/repoze/sphinx/tests/ 0000755 0001750 0001750 00000000000 14243621326 022464 5 ustar nilesh nilesh repoze.sphinx.autointerface-1.0.0/repoze/sphinx/tests/root/ 0000755 0001750 0001750 00000000000 14243621326 023447 5 ustar nilesh nilesh repoze.sphinx.autointerface-1.0.0/repoze/sphinx/tests/root/conf.py 0000644 0001750 0001750 00000000044 14242143053 024737 0 ustar nilesh nilesh extensions = ['sphinx.ext.autodoc']
repoze.sphinx.autointerface-1.0.0/repoze/sphinx/tests/util.py 0000644 0001750 0001750 00000007256 14243620167 024027 0 ustar nilesh nilesh import sys
import os
import tempfile
import shutil
from io import StringIO
from sphinx import application
from sphinx.builders.latex import LaTeXBuilder
from sphinx.pycode import ModuleAnalyzer
from docutils import nodes
from docutils.parsers.rst import directives, roles
rootdir = os.path.abspath(os.path.dirname(__file__) or '.')
class ListOutput(object):
"""
File-like object that collects written text in a list.
"""
def __init__(self, name):
self.name = name
self.content = []
def reset(self):
del self.content[:]
def write(self, text):
self.content.append(text)
class TestApp(application.Sphinx):
"""
A subclass of :class:`Sphinx` that runs on the test root, with some
better default values for the initialization parameters.
"""
def __init__(self, buildername='html', testroot=None, srcdir=None,
freshenv=False, confoverrides=None, status=None, warning=None,
tags=None, docutilsconf=None):
if testroot is None:
defaultsrcdir = 'root'
testroot = os.path.join(rootdir, 'root')
else:
defaultsrcdir = 'test-' + testroot
testroot = os.path.join(rootdir, 'roots', ('test-' + testroot))
self.__tempdir = os.path.abspath(tempfile.mkdtemp())
if srcdir is None:
srcdir = os.path.join(self.__tempdir, defaultsrcdir)
else:
srcdir = os.path.join(self.__tempdir, srcdir)
if not os.path.exists(srcdir):
shutil.copytree(testroot, srcdir, symlinks=False)
if docutilsconf is not None:
with open(os.path.join(srcdir, 'docutils.conf')) as f:
f.write(docutilsconf)
builddir = os.path.join(srcdir, '_build')
# if confdir is None:
confdir = srcdir
# if outdir is None:
outdir = os.path.join(builddir, buildername)
if not os.path.exists(outdir):
os.makedirs(outdir)
doctreedir = os.path.join(builddir, 'doctrees')
if not os.path.exists(doctreedir):
os.makedirs(doctreedir)
if confoverrides is None:
confoverrides = {}
if status is None:
status = StringIO()
if warning is None:
warning = ListOutput('stderr')
# if warningiserror is None:
warningiserror = False
self._saved_path = sys.path[:]
self._saved_directives = directives._directives.copy()
self._saved_roles = roles._roles.copy()
self._saved_nodeclasses = set(v for v in dir(nodes.GenericNodeVisitor)
if v.startswith('visit_'))
try:
application.Sphinx.__init__(self, srcdir, confdir, outdir, doctreedir,
buildername, confoverrides, status, warning,
freshenv, warningiserror, tags)
except:
self.cleanup()
raise
def cleanup(self, doctrees=False):
shutil.rmtree(self.__tempdir)
ModuleAnalyzer.cache.clear()
LaTeXBuilder.usepackages = []
sys.path[:] = self._saved_path
sys.modules.pop('autodoc_fodder', None)
directives._directives = self._saved_directives
roles._roles = self._saved_roles
for method in dir(nodes.GenericNodeVisitor):
if method.startswith('visit_') and \
method not in self._saved_nodeclasses:
delattr(nodes.GenericNodeVisitor, 'visit_' + method[6:])
delattr(nodes.GenericNodeVisitor, 'depart_' + method[6:])
def __repr__(self):
return '<%s buildername=%r>' % (self.__class__.__name__, self.builder.name)
repoze.sphinx.autointerface-1.0.0/repoze/sphinx/tests/test_autointerface.py 0000644 0001750 0001750 00000006060 14243620167 026732 0 ustar nilesh nilesh import unittest
from .util import TestApp
from .. import autointerface
from sphinx.ext.autodoc import ALL
from docutils.statemachine import ViewList
from zope import interface
class IPlumbusMaker(interface.Interface):
grumbo = interface.Attribute("The dinglebop is fed through here")
fleeb = interface.Attribute("The dinglebop is polished with this")
def smoothTheDinglebop(schleem):
"""
Smooth it out.
The schleem is then repurposed.
"""
class Options(dict):
inherited_members = False
undoc_members = False
private_members = False
special_members = False
imported_members = False
show_inheritance = False
noindex = False
annotation = None
synopsis = ''
platform = ''
deprecated = False
members = ()
member_order = 'alphabetic'
exclude_members = ()
def __init__(self):
super(Options, self).__init__()
self.exclude_members = set()
self.members = []
self.__dict__ = self
class Settings(object):
tab_width = 4
class Document(object):
def __init__(self, settings):
self.settings = settings
class State(object):
def __init__(self, document):
self.document = document
class Directive(object):
env = None
genopt = None
result = None
record_dependencies = None
def __init__(self):
self._warnings = []
self.filename_set = set()
self.result = ViewList()
self.record_dependencies = set()
self.state = State(Document(Settings()))
def warn(self, msg):
self._warnings.append(msg)
class TestAutoInterface(unittest.TestCase):
def setUp(self):
app = self.app = TestApp()
app.builder.env.app = app
app.builder.env.temp_data['docname'] = 'dummy'
autointerface.setup(app)
opt = self.options = Options()
d = self.directive = Directive()
d.env = app.builder.env
d.genopt = opt
def tearDown(self):
self.app.cleanup()
self.app = None
def assertResultContains(self, item,
objtype='interface', name='repoze.sphinx.tests.test_autointerface.IPlumbusMaker',
**kw):
directive = self.directive
inst = self.app.registry.documenters['interface'](directive, name)
inst.generate(**kw)
# print '\n'.join(directive.result)
self.assertEqual([], directive._warnings)
self.assertIn(item, directive.result)
results = directive.result[:]
del directive.result[:]
return '\n'.join(results)
def test_restricted_members(self):
self.options.members = ['smoothTheDinglebop']
all_results = self.assertResultContains(' .. method:: smoothTheDinglebop(schleem)')
self.assertNotIn('grumbo', all_results)
def test_all_members(self):
self.options.members = ALL
all_results = self.assertResultContains(' .. method:: smoothTheDinglebop(schleem)')
self.assertIn('grumbo', all_results)
self.assertIn('fleeb', all_results)
repoze.sphinx.autointerface-1.0.0/repoze/sphinx/tests/__init__.py 0000644 0001750 0001750 00000000000 14242143053 024556 0 ustar nilesh nilesh repoze.sphinx.autointerface-1.0.0/repoze/sphinx/__init__.py 0000644 0001750 0001750 00000000070 14242143053 023423 0 ustar nilesh nilesh __import__('pkg_resources').declare_namespace(__name__)
repoze.sphinx.autointerface-1.0.0/repoze/sphinx/autointerface.py 0000644 0001750 0001750 00000011434 14243620167 024532 0 ustar nilesh nilesh
import sys
from sphinx.util.docstrings import prepare_docstring
from sphinx.domains.python import PyClasslike
from sphinx.ext import autodoc
from zope.interface import Interface
from zope.interface.interface import InterfaceClass
class InterfaceDesc(PyClasslike):
def get_index_text(self, modname, name_cls):
return '%s (interface in %s)' % (name_cls[0], modname)
class InterfaceDocumenter(autodoc.ClassDocumenter):
"""
Specialized Documenter directive for zope interfaces.
"""
objtype = "interface"
# Must be a higher priority than ClassDocumenter
member_order = 10
def __init__(self, *args, **kwargs):
super(InterfaceDocumenter, self).__init__(*args, **kwargs)
self.options.show_inheritance = True
@classmethod
def can_document_member(cls, member, membername, isattr, parent):
return isinstance(member, InterfaceClass)
def add_directive_header(self, sig):
if self.doc_as_attr:
self.directivetype = 'attribute'
autodoc.Documenter.add_directive_header(self, sig)
# add inheritance info, if wanted
bases = [base for base in self.object.__bases__
if base is not Interface]
if not self.doc_as_attr and self.options.show_inheritance and bases:
self.add_line(u'', '')
bases = [u':class:`%s.%s`' % (b.__module__, b.getName())
for b in bases]
self.add_line(u' Extends: %s' % ', '.join(bases),
'')
def format_args(self):
return ""
def document_members(self, all_members=True):
oldindent = self.indent
members = list(self.object.namesAndDescriptions())
if self.options.members is not autodoc.ALL:
specified = []
for line in (self.options.members or []):
specified.extend(line.split())
mapping = dict(members)
members = [(x, mapping[x]) for x in specified]
member_order = (self.options.member_order or
self.env.config.autodoc_member_order)
if member_order == 'alphabetical':
members.sort()
if member_order == 'groupwise':
# sort by group; relies on stable sort to keep items in the
# same group sorted alphabetically
members.sort(key=lambda e:
getattr(e[1], 'getSignatureString',
None) is not None)
elif member_order == 'bysource' and self.analyzer:
# sort by source order, by virtue of the module analyzer
tagorder = self.analyzer.tagorder
name = self.object.__name__
def keyfunc(entry):
return tagorder.get('%s.%s' % (name, entry[0]), len(tagorder))
members.sort(key=keyfunc)
for name, desc in members:
self.add_line(u'', '')
sig = getattr(desc, 'getSignatureString', None)
if sig is None:
self.add_line(u'.. attribute:: %s' % name, '')
else:
self.add_line(u'.. method:: %s%s' % (name, sig()),
'')
doc = desc.getDoc()
if doc:
self.add_line(u'', '')
self.indent += self.content_indent
sourcename = u'docstring of %s.%s' % (self.fullname, name)
docstrings = [prepare_docstring(doc)]
for i, line in enumerate(self.process_doc(docstrings)):
self.add_line(line, sourcename, i)
self.add_line(u'', '')
self.indent = oldindent
def setup(app):
app.add_directive_to_domain('py', 'interface', InterfaceDesc)
from sphinx.domains import ObjType
try:
domains = app.domains
except AttributeError:
domains = app.registry.domains
# Allow the :class: directive to xref interface objects through the search
# mechanism, i.e., prefixed with a '.', like :class:`.ITheInterface`
# (without this, an exact match is required)
class InterfacePythonDomain(domains['py']):
pass
InterfacePythonDomain.object_types = domains['py'].object_types.copy()
InterfacePythonDomain.object_types['interface'] = ObjType( 'interface', 'interface', 'obj', 'class')
old_class = InterfacePythonDomain.object_types['class']
new_class = ObjType( old_class.lname, *(old_class.roles + ('interface',)), **old_class.attrs )
InterfacePythonDomain.object_types['class'] = new_class
if hasattr(app, 'override_domain'):
app.override_domain( InterfacePythonDomain )
else:
app.add_domain( InterfacePythonDomain, override=True )
app.add_autodocumenter(InterfaceDocumenter)
repoze.sphinx.autointerface-1.0.0/repoze/__init__.py 0000644 0001750 0001750 00000000070 14242143053 022112 0 ustar nilesh nilesh __import__('pkg_resources').declare_namespace(__name__)