Hello community,
here is the log from the commit of package python-sphinxcontrib-apidoc for openSUSE:Factory checked in at 2019-04-28 20:14:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-sphinxcontrib-apidoc (Old)
and /work/SRC/openSUSE:Factory/.python-sphinxcontrib-apidoc.new.5536 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-sphinxcontrib-apidoc"
Sun Apr 28 20:14:35 2019 rev:3 rq:698631 version:0.3.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-sphinxcontrib-apidoc/python-sphinxcontrib-apidoc.changes 2018-12-24 11:44:26.973289494 +0100
+++ /work/SRC/openSUSE:Factory/.python-sphinxcontrib-apidoc.new.5536/python-sphinxcontrib-apidoc.changes 2019-04-28 20:14:36.626375336 +0200
@@ -1,0 +2,9 @@
+Fri Apr 26 12:46:35 UTC 2019 - Marketa Calabkova
+
+- update to version 0.3.0
+ * Ensure '--tocfile' isn't configured for Sphinx < 1.8
+ * Support more configuration options
+ * fix the dist name used to get the version after installation
+- Launching tests using multibuild. It just did not work without it.
+
+-------------------------------------------------------------------
Old:
----
sphinxcontrib-apidoc-0.2.1.tar.gz
New:
----
_multibuild
sphinxcontrib-apidoc-0.3.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-sphinxcontrib-apidoc.spec ++++++
--- /var/tmp/diff_new_pack.g6isZL/_old 2019-04-28 20:14:37.178374993 +0200
+++ /var/tmp/diff_new_pack.g6isZL/_new 2019-04-28 20:14:37.182374991 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-sphinxcontrib-apidoc
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,15 +17,23 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-Name: python-sphinxcontrib-apidoc
-Version: 0.2.1
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -test
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
+Name: python-sphinxcontrib-apidoc%{psuffix}
+Version: 0.3.0
Release: 0
Summary: A Sphinx extension for running 'sphinx-apidoc' on each build
License: BSD-2-Clause
Group: Development/Languages/Python
URL: http://www.sphinx-doc.org/
Source: https://files.pythonhosted.org/packages/source/s/sphinxcontrib-apidoc/sphinxcontrib-apidoc-%{version}.tar.gz
-BuildRequires: %{python_module pbr}
+BuildRequires: %{python_module pbr >= 4.0}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -33,9 +41,10 @@
Requires: python-pbr
BuildArch: noarch
# SECTION test requirements
-BuildRequires: %{python_module Sphinx >= 1.6.0}
-BuildRequires: %{python_module pbr}
+%if %{with test}
BuildRequires: %{python_module pytest >= 3.0}
+BuildRequires: %{python_module sphinxcontrib-apidoc = %{version}}
+%endif
# /SECTION
%python_subpackages
@@ -50,21 +59,24 @@
%setup -q -n sphinxcontrib-apidoc-%{version}
%build
-export PBR_VERSION=%{version}
%python_build
%install
-export PBR_VERSION=%{version}
+%if !%{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
+%if %{with test}
%check
-export PBR_VERSION=%{version}
-%python_exec setup.py test
+%pytest tests
+%endif
+%if !%{with test}
%files %{python_files}
%license LICENSE
%doc AUTHORS ChangeLog README.rst
%{python_sitelib}/*
+%endif
%changelog
++++++ _multibuild ++++++
<multibuild>
<package>test</package>
</multibuild>
++++++ sphinxcontrib-apidoc-0.2.1.tar.gz -> sphinxcontrib-apidoc-0.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/.travis.yml new/sphinxcontrib-apidoc-0.3.0/.travis.yml
--- old/sphinxcontrib-apidoc-0.2.1/.travis.yml 2018-04-06 10:25:48.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/.travis.yml 2018-10-04 10:36:45.000000000 +0200
@@ -11,11 +11,20 @@
- pip install tox-travis
script:
- tox
-deploy:
- provider: pypi
- user: stephenfin
- password:
- secure: QC2uv/IrJXZH3IpLxXhypCzhzsQR3tMoE1m07Q/mt5tNxZrNlO/wro4LPRXih/XwHnz+qz9QaejRsI2RgDmEuGqqLcH5iEFCgnC3cNd3y5T7RU6CJTwb0+DEQQIX/p7DRKaXsfb3OOaoNYvo2/FQRF7th2ClkbKJbjIvXlrnmHW6e/nvcXvrxJuIH0x3jE2ou38TSCtVDNfRUomxCRvWP0yqg416d7Ulv3ksI8qKPx6HwcKX7KWFyPOX0vbDnOGlnPxHCetAEtwJ8enoNQSK1+CKkTDSChUqH7fspUz5/f1yzqp+CU9R8ukRmI3ZpfRgKDkLkLPKAH97B+1g43ioS6EKtObN1kSZkqc0nxtqjVBVr2r3wZmX+RZC71VqzW595QAl6H/89zH1tj71eNcOd+X+y5TGoE/Ie+T5TgC7ktZdMb5LHcz4RYP945F+L7w3RSXRY7is3zMsG4yyF9EaHdZs6dpJVKDgY2ZRbMG4mLaH01f4k7GsUm6SthgfPIhITvpBR9UpIgWNFhQ5bLQFd6hBKg8h3/Qci3Nj1+Ai8fX1bp3Uvb6wKBpBXCFLkwX2oiF8MDSmYXN0HzT8hEDBCXMTloF8IKtDm2sPkwTnPut97MHmp9lQyUvsgCkUvA+a1kf8bmDomlccdWxHYXXX6+i5on1YidhyPgFzwvd8VQI=
- on:
- tags: true
- distributions: sdist bdist_wheel
+stages:
+- test
+- deploy
+jobs:
+ include:
+ - stage: deploy
+ python: 3.6
+ install: skip # no tests, no depedencies needed
+ script: skip # we're not running tests
+ deploy:
+ provider: pypi
+ user: stephenfin
+ password:
+ secure: QC2uv/IrJXZH3IpLxXhypCzhzsQR3tMoE1m07Q/mt5tNxZrNlO/wro4LPRXih/XwHnz+qz9QaejRsI2RgDmEuGqqLcH5iEFCgnC3cNd3y5T7RU6CJTwb0+DEQQIX/p7DRKaXsfb3OOaoNYvo2/FQRF7th2ClkbKJbjIvXlrnmHW6e/nvcXvrxJuIH0x3jE2ou38TSCtVDNfRUomxCRvWP0yqg416d7Ulv3ksI8qKPx6HwcKX7KWFyPOX0vbDnOGlnPxHCetAEtwJ8enoNQSK1+CKkTDSChUqH7fspUz5/f1yzqp+CU9R8ukRmI3ZpfRgKDkLkLPKAH97B+1g43ioS6EKtObN1kSZkqc0nxtqjVBVr2r3wZmX+RZC71VqzW595QAl6H/89zH1tj71eNcOd+X+y5TGoE/Ie+T5TgC7ktZdMb5LHcz4RYP945F+L7w3RSXRY7is3zMsG4yyF9EaHdZs6dpJVKDgY2ZRbMG4mLaH01f4k7GsUm6SthgfPIhITvpBR9UpIgWNFhQ5bLQFd6hBKg8h3/Qci3Nj1+Ai8fX1bp3Uvb6wKBpBXCFLkwX2oiF8MDSmYXN0HzT8hEDBCXMTloF8IKtDm2sPkwTnPut97MHmp9lQyUvsgCkUvA+a1kf8bmDomlccdWxHYXXX6+i5on1YidhyPgFzwvd8VQI=
+ on:
+ tags: true
+ distributions: sdist bdist_wheel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/AUTHORS new/sphinxcontrib-apidoc-0.3.0/AUTHORS
--- old/sphinxcontrib-apidoc-0.2.1/AUTHORS 2018-04-06 10:26:44.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/AUTHORS 2018-10-04 10:36:52.000000000 +0200
@@ -1,2 +1,4 @@
+Doug Hellmann
+Paul Melnikow
Stephen Finucane
Zane Bitter
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/ChangeLog new/sphinxcontrib-apidoc-0.3.0/ChangeLog
--- old/sphinxcontrib-apidoc-0.2.1/ChangeLog 2018-04-06 10:26:44.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/ChangeLog 2018-10-04 10:36:52.000000000 +0200
@@ -1,6 +1,21 @@
CHANGES
=======
+0.3.0
+-----
+
+* tests: Test 'apidoc\_extra\_args' option
+* tests: Add advanced\_negative test
+* tests: Add tests for additional flags
+* tests: Check for source files also
+* Ensure '--tocfile' isn't configured for Sphinx < 1.8
+* Support more configuration options
+* fix the dist name used to get the version after installation
+* trivial: Fix style issues
+* setup.cfg: Remove dead '[global] setup-hooks' configuration
+* travis: Use build stages
+* setup.cfg: Update homepage
+
0.2.1
-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/PKG-INFO new/sphinxcontrib-apidoc-0.3.0/PKG-INFO
--- old/sphinxcontrib-apidoc-0.2.1/PKG-INFO 2018-04-06 10:26:45.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/PKG-INFO 2018-10-04 10:36:52.000000000 +0200
@@ -1,11 +1,13 @@
Metadata-Version: 1.1
Name: sphinxcontrib-apidoc
-Version: 0.2.1
+Version: 0.3.0
Summary: A Sphinx extension for running 'sphinx-apidoc' on each build
-Home-page: http://www.sphinx-doc.org/
+Home-page: https://github.com/sphinx-contrib/apidoc
Author: Stephen Finucane
Author-email: stephen@that.guru
License: UNKNOWN
+Project-URL: Bug Tracker, https://github.com/sphinx-contrib/apidoc/issues
+Project-URL: Source Code, https://github.com/sphinx-contrib/apidoc
Description: ====================
sphinxcontrib-apidoc
====================
@@ -77,6 +79,24 @@
**Optional**, defaults to ``False``.
+ ``apidoc_toc_file``
+ Filename for a table of contents file. Defaults to ``modules``. If set to
+ ``False``, *apidoc* will not create a table of contents file.
+
+ **Optional**, defaults to ``modules``.
+
+ ``apidoc_module_first``
+ When set to ``True``, put module documentation before submodule
+ documentation.
+
+ **Optional**, defaults to ``False``.
+
+ ``apidoc_extra_args``
+ Extra arguments which will be passed to ``sphinx-apidoc``. These are placed
+ after flags and before the module name.
+
+ **Optional**, defaults to ``[]``.
+
Migration from pbr
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/README.rst new/sphinxcontrib-apidoc-0.3.0/README.rst
--- old/sphinxcontrib-apidoc-0.2.1/README.rst 2018-04-06 10:25:48.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/README.rst 2018-10-03 19:33:13.000000000 +0200
@@ -69,6 +69,24 @@
**Optional**, defaults to ``False``.
+``apidoc_toc_file``
+ Filename for a table of contents file. Defaults to ``modules``. If set to
+ ``False``, *apidoc* will not create a table of contents file.
+
+ **Optional**, defaults to ``modules``.
+
+``apidoc_module_first``
+ When set to ``True``, put module documentation before submodule
+ documentation.
+
+ **Optional**, defaults to ``False``.
+
+``apidoc_extra_args``
+ Extra arguments which will be passed to ``sphinx-apidoc``. These are placed
+ after flags and before the module name.
+
+ **Optional**, defaults to ``[]``.
+
Migration from pbr
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/setup.cfg new/sphinxcontrib-apidoc-0.3.0/setup.cfg
--- old/sphinxcontrib-apidoc-0.2.1/setup.cfg 2018-04-06 10:26:45.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/setup.cfg 2018-10-04 10:36:52.000000000 +0200
@@ -1,12 +1,15 @@
[metadata]
name = sphinxcontrib-apidoc
summary = A Sphinx extension for running 'sphinx-apidoc' on each build
-description-file =
+description_file =
README.rst
author = Stephen Finucane
-author-email = stephen@that.guru
-home-page = http://www.sphinx-doc.org/
-classifier =
+author_email = stephen@that.guru
+url = https://github.com/sphinx-contrib/apidoc
+project_urls =
+ Bug Tracker = https://github.com/sphinx-contrib/apidoc/issues
+ Source Code = https://github.com/sphinx-contrib/apidoc
+classifiers =
Development Status :: 4 - Beta
Environment :: Console
Environment :: Web Environment
@@ -27,10 +30,6 @@
Topic :: Documentation :: Sphinx
Topic :: Utilities
-[global]
-setup-hooks =
- pbr.hooks.setup_hook
-
[files]
packages =
sphinxcontrib
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/setup.py new/sphinxcontrib-apidoc-0.3.0/setup.py
--- old/sphinxcontrib-apidoc-0.2.1/setup.py 2018-04-06 10:25:48.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/setup.py 2018-04-06 10:52:46.000000000 +0200
@@ -4,6 +4,6 @@
setuptools.setup(
- setup_requires=['pbr'],
+ setup_requires=['pbr>=4.0'],
pbr=True,
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/sphinxcontrib/apidoc/__init__.py new/sphinxcontrib-apidoc-0.3.0/sphinxcontrib/apidoc/__init__.py
--- old/sphinxcontrib-apidoc-0.2.1/sphinxcontrib/apidoc/__init__.py 2018-04-06 10:25:48.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/sphinxcontrib/apidoc/__init__.py 2018-10-03 19:33:13.000000000 +0200
@@ -12,7 +12,7 @@
from sphinxcontrib.apidoc import ext
-__version__ = pbr.version.VersionInfo('apidoc').version_string()
+__version__ = pbr.version.VersionInfo('sphinxcontrib-apidoc').version_string()
if False:
# For type annotation
@@ -29,5 +29,8 @@
app.add_config_value('apidoc_output_dir', 'api', 'env', [str])
app.add_config_value('apidoc_excluded_paths', [], 'env', [[str]])
app.add_config_value('apidoc_separate_modules', False, 'env', [bool])
+ app.add_config_value('apidoc_toc_file', None, 'env', [str, bool])
+ app.add_config_value('apidoc_module_first', False, 'env', [bool])
+ app.add_config_value('apidoc_extra_args', [], 'env', [list])
return {'version': __version__, 'parallel_read_safe': True}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/sphinxcontrib/apidoc/ext.py new/sphinxcontrib-apidoc-0.3.0/sphinxcontrib/apidoc/ext.py
--- old/sphinxcontrib-apidoc-0.2.1/sphinxcontrib/apidoc/ext.py 2018-04-06 10:25:48.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/sphinxcontrib/apidoc/ext.py 2018-10-03 19:33:13.000000000 +0200
@@ -10,6 +10,7 @@
from os import path
+import sphinx
from sphinx.util import logging
try:
@@ -32,6 +33,14 @@
output_dir = path.join(app.srcdir, app.config.apidoc_output_dir)
excludes = app.config.apidoc_excluded_paths
separate_modules = app.config.apidoc_separate_modules
+ toc_file = app.config.apidoc_toc_file
+ module_first = app.config.apidoc_module_first
+ extra_args = app.config.apidoc_extra_args
+
+ if toc_file and sphinx.version_info < (1, 8, 0):
+ logger.warning("'apidoc_toc_file' is only supported by Sphinx "
+ "1.8+; skipping API doc generation")
+ return
if not module_dir:
logger.warning("No 'apidoc_module_dir' specified; skipping API doc "
@@ -43,8 +52,9 @@
module_dir = path.abspath(path.join(app.srcdir, module_dir))
if not path.exists(module_dir):
- logger.warning("The path defined in 'apidoc_module_dir' does not "
- "exist; skipping API doc generation; %s", module_dir)
+ logger.warning(
+ "The path defined in 'apidoc_module_dir' does not "
+ "exist; skipping API doc generation; %s", module_dir)
return
# refactor this module so that we can call 'recurse_tree' like a sane
@@ -59,9 +69,21 @@
if separate_modules:
yield '--separate'
- yield '-o'
+ if isinstance(toc_file, bool) and toc_file is False:
+ yield '--no-toc'
+ elif toc_file:
+ yield '--tocfile'
+ yield toc_file
+
+ if module_first:
+ yield '--module-first'
+
+ yield '--output-dir'
yield output_dir
+ for arg in extra_args:
+ yield arg
+
yield module_dir
for exc in excludes:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/sphinxcontrib_apidoc.egg-info/PKG-INFO new/sphinxcontrib-apidoc-0.3.0/sphinxcontrib_apidoc.egg-info/PKG-INFO
--- old/sphinxcontrib-apidoc-0.2.1/sphinxcontrib_apidoc.egg-info/PKG-INFO 2018-04-06 10:26:44.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/sphinxcontrib_apidoc.egg-info/PKG-INFO 2018-10-04 10:36:50.000000000 +0200
@@ -1,11 +1,13 @@
Metadata-Version: 1.1
Name: sphinxcontrib-apidoc
-Version: 0.2.1
+Version: 0.3.0
Summary: A Sphinx extension for running 'sphinx-apidoc' on each build
-Home-page: http://www.sphinx-doc.org/
+Home-page: https://github.com/sphinx-contrib/apidoc
Author: Stephen Finucane
Author-email: stephen@that.guru
License: UNKNOWN
+Project-URL: Bug Tracker, https://github.com/sphinx-contrib/apidoc/issues
+Project-URL: Source Code, https://github.com/sphinx-contrib/apidoc
Description: ====================
sphinxcontrib-apidoc
====================
@@ -77,6 +79,24 @@
**Optional**, defaults to ``False``.
+ ``apidoc_toc_file``
+ Filename for a table of contents file. Defaults to ``modules``. If set to
+ ``False``, *apidoc* will not create a table of contents file.
+
+ **Optional**, defaults to ``modules``.
+
+ ``apidoc_module_first``
+ When set to ``True``, put module documentation before submodule
+ documentation.
+
+ **Optional**, defaults to ``False``.
+
+ ``apidoc_extra_args``
+ Extra arguments which will be passed to ``sphinx-apidoc``. These are placed
+ after flags and before the module name.
+
+ **Optional**, defaults to ``[]``.
+
Migration from pbr
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/sphinxcontrib_apidoc.egg-info/SOURCES.txt new/sphinxcontrib-apidoc-0.3.0/sphinxcontrib_apidoc.egg-info/SOURCES.txt
--- old/sphinxcontrib-apidoc-0.2.1/sphinxcontrib_apidoc.egg-info/SOURCES.txt 2018-04-06 10:26:44.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/sphinxcontrib_apidoc.egg-info/SOURCES.txt 2018-10-04 10:36:52.000000000 +0200
@@ -26,7 +26,14 @@
tests/roots/test-advanced/apidoc_dummy_module.py
tests/roots/test-advanced/conf.py
tests/roots/test-advanced/index.rst
+tests/roots/test-advanced-negative/apidoc_dummy_module.py
+tests/roots/test-advanced-negative/conf.py
+tests/roots/test-advanced-negative/index.rst
+tests/roots/test-advanced-negative/apidoc_dummy_package/__init__.py
+tests/roots/test-advanced-negative/apidoc_dummy_package/apidoc_dummy_submodule_a.py
+tests/roots/test-advanced-negative/apidoc_dummy_package/apidoc_dummy_submodule_b.py
tests/roots/test-advanced/apidoc_dummy_package/__init__.py
+tests/roots/test-advanced/apidoc_dummy_package/_apidoc_private_dummy_submodule.py
tests/roots/test-advanced/apidoc_dummy_package/apidoc_dummy_submodule_a.py
tests/roots/test-advanced/apidoc_dummy_package/apidoc_dummy_submodule_b.py
tests/roots/test-basics/apidoc_dummy_module.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/sphinxcontrib_apidoc.egg-info/pbr.json new/sphinxcontrib-apidoc-0.3.0/sphinxcontrib_apidoc.egg-info/pbr.json
--- old/sphinxcontrib-apidoc-0.2.1/sphinxcontrib_apidoc.egg-info/pbr.json 2018-04-06 10:26:44.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/sphinxcontrib_apidoc.egg-info/pbr.json 2018-10-04 10:36:50.000000000 +0200
@@ -1 +1 @@
-{"git_version": "c546f21", "is_release": true}
\ No newline at end of file
+{"git_version": "55db45d", "is_release": true}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/tests/conftest.py new/sphinxcontrib-apidoc-0.3.0/tests/conftest.py
--- old/sphinxcontrib-apidoc-0.2.1/tests/conftest.py 2018-04-06 10:25:48.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/tests/conftest.py 2018-10-03 15:34:19.000000000 +0200
@@ -20,9 +20,8 @@
@pytest.fixture(scope='session')
def sphinx_test_tempdir():
return path(
- os.environ.get(
- 'SPHINX_TEST_TEMPDIR',
- tempfile.mkdtemp(prefix='apidoc-'))).abspath()
+ os.environ.get('SPHINX_TEST_TEMPDIR',
+ tempfile.mkdtemp(prefix='apidoc-'))).abspath()
@pytest.fixture(scope='session')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced/apidoc_dummy_package/__init__.py new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced/apidoc_dummy_package/__init__.py
--- old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced/apidoc_dummy_package/__init__.py 2018-04-06 10:25:48.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced/apidoc_dummy_package/__init__.py 2018-10-03 19:33:13.000000000 +0200
@@ -0,0 +1,2 @@
+def bogus():
+ return 'bogus'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced/apidoc_dummy_package/_apidoc_private_dummy_submodule.py new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced/apidoc_dummy_package/_apidoc_private_dummy_submodule.py
--- old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced/apidoc_dummy_package/_apidoc_private_dummy_submodule.py 1970-01-01 01:00:00.000000000 +0100
+++ new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced/apidoc_dummy_package/_apidoc_private_dummy_submodule.py 2018-10-03 19:33:13.000000000 +0200
@@ -0,0 +1,2 @@
+def very_private():
+ return 'private'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced/conf.py new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced/conf.py
--- old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced/conf.py 2018-04-06 10:25:48.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced/conf.py 2018-10-03 19:33:13.000000000 +0200
@@ -11,3 +11,6 @@
apidoc_module_dir = '.'
apidoc_excluded_paths = ['conf.py']
apidoc_separate_modules = True
+apidoc_toc_file = 'custom'
+apidoc_module_first = True
+apidoc_extra_args = ['--private']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced/index.rst new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced/index.rst
--- old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced/index.rst 2018-04-06 10:25:48.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced/index.rst 2018-10-03 19:33:13.000000000 +0200
@@ -3,4 +3,4 @@
.. toctree::
- api/modules
+ api/custom
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced-negative/apidoc_dummy_module.py new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced-negative/apidoc_dummy_module.py
--- old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced-negative/apidoc_dummy_module.py 1970-01-01 01:00:00.000000000 +0100
+++ new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced-negative/apidoc_dummy_module.py 2018-10-03 19:33:13.000000000 +0200
@@ -0,0 +1,12 @@
+from os import * # noqa
+
+from apidoc_dummy_package import apidoc_dummy_submodule_a as a # noqa
+from apidoc_dummy_package import apidoc_dummy_submodule_b as b # noqa
+
+
+class Foo:
+ def __init__(self):
+ pass
+
+ def bar(self):
+ pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced-negative/apidoc_dummy_package/apidoc_dummy_submodule_a.py new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced-negative/apidoc_dummy_package/apidoc_dummy_submodule_a.py
--- old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced-negative/apidoc_dummy_package/apidoc_dummy_submodule_a.py 1970-01-01 01:00:00.000000000 +0100
+++ new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced-negative/apidoc_dummy_package/apidoc_dummy_submodule_a.py 2018-10-03 19:33:13.000000000 +0200
@@ -0,0 +1,6 @@
+from __future__ import print_function
+
+
+class Bar(object):
+ def foo(self):
+ print('Hello, world')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced-negative/apidoc_dummy_package/apidoc_dummy_submodule_b.py new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced-negative/apidoc_dummy_package/apidoc_dummy_submodule_b.py
--- old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced-negative/apidoc_dummy_package/apidoc_dummy_submodule_b.py 1970-01-01 01:00:00.000000000 +0100
+++ new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced-negative/apidoc_dummy_package/apidoc_dummy_submodule_b.py 2018-10-03 19:33:13.000000000 +0200
@@ -0,0 +1,3 @@
+class Baz(object):
+ def inga(self):
+ return 1 + 3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced-negative/conf.py new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced-negative/conf.py
--- old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced-negative/conf.py 1970-01-01 01:00:00.000000000 +0100
+++ new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced-negative/conf.py 2018-10-03 19:33:13.000000000 +0200
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+
+import os
+import sys
+
+sys.path.insert(0, os.path.abspath('./'))
+
+extensions = ['sphinxcontrib.apidoc']
+master_doc = 'index'
+
+apidoc_module_dir = '.'
+apidoc_excluded_paths = ['conf.py']
+apidoc_separate_modules = False
+apidoc_toc_file = False
+apidoc_module_first = False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced-negative/index.rst new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced-negative/index.rst
--- old/sphinxcontrib-apidoc-0.2.1/tests/roots/test-advanced-negative/index.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/sphinxcontrib-apidoc-0.3.0/tests/roots/test-advanced-negative/index.rst 2018-10-03 19:33:13.000000000 +0200
@@ -0,0 +1,7 @@
+apidoc
+======
+
+.. toctree::
+
+ api/apidoc_dummy_module
+ api/apidoc_dummy_package
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-apidoc-0.2.1/tests/test_ext.py new/sphinxcontrib-apidoc-0.3.0/tests/test_ext.py
--- old/sphinxcontrib-apidoc-0.2.1/tests/test_ext.py 2018-04-06 10:25:48.000000000 +0200
+++ new/sphinxcontrib-apidoc-0.3.0/tests/test_ext.py 2018-10-03 19:33:13.000000000 +0200
@@ -10,6 +10,7 @@
"""
import pytest
+import sphinx
from sphinx.util import logging
@@ -17,27 +18,91 @@
def test_basics(app, status, warning):
logging.setup(app, status, warning)
app.builder.build_all()
+
+ assert (app.srcdir / 'api').isdir()
+ assert (app.srcdir / 'api' / 'modules.rst').exists()
+ assert (app.srcdir / 'api' / 'apidoc_dummy_module.rst').exists()
+ assert not (app.srcdir / 'api' / 'conf.rst').exists()
+
assert (app.outdir / 'api').isdir()
assert (app.outdir / 'api' / 'modules.html').exists()
assert (app.outdir / 'api' / 'apidoc_dummy_module.html').exists()
assert not (app.outdir / 'api' / 'conf.html').exists()
+
assert not warning.getvalue()
@pytest.mark.sphinx('html', testroot='advanced')
def test_advanced(app, status, warning):
+ if sphinx.version_info < (1, 8, 0):
+ pytest.xfail('This should fail on older Sphinx versions')
+
logging.setup(app, status, warning)
app.builder.build_all()
+
+ assert (app.srcdir / 'api').isdir()
+ assert (app.srcdir / 'api' / 'custom.rst').exists()
+ for module in [
+ 'apidoc_dummy_module.rst',
+ 'apidoc_dummy_package.apidoc_dummy_submodule_a.rst',
+ 'apidoc_dummy_package.apidoc_dummy_submodule_b.rst',
+ 'apidoc_dummy_package._apidoc_private_dummy_submodule.rst',
+ ]:
+ assert (app.srcdir / 'api' / module).exists()
+ assert (app.srcdir / 'api' / 'apidoc_dummy_package.rst').exists()
+ assert not (app.srcdir / 'api' / 'conf.rst').exists()
+
+ with open(app.srcdir / 'api' / 'apidoc_dummy_package.rst') as fh:
+ package_doc = [x.strip() for x in fh.readlines()]
+
+ # The 'Module contents' header isn't present if '--module-first' used
+ assert 'Module contents' not in package_doc
+
assert (app.outdir / 'api').isdir()
- assert (app.outdir / 'api' / 'modules.html').exists()
+ assert (app.outdir / 'api' / 'custom.html').exists()
for module in [
'apidoc_dummy_module.html',
'apidoc_dummy_package.apidoc_dummy_submodule_a.html',
- 'apidoc_dummy_package.apidoc_dummy_submodule_b.html'
+ 'apidoc_dummy_package.apidoc_dummy_submodule_b.html',
+ 'apidoc_dummy_package._apidoc_private_dummy_submodule.html',
]:
assert (app.outdir / 'api' / module).exists()
assert (app.outdir / 'api' / 'apidoc_dummy_package.html').exists()
assert not (app.outdir / 'api' / 'conf.html').exists()
+
+ assert not warning.getvalue()
+
+
+@pytest.mark.sphinx('html', testroot='advanced-negative')
+def test_advanced_negative(app, status, warning):
+ """The "test_advanced" test but with boolean options toggled."""
+ logging.setup(app, status, warning)
+ app.builder.build_all()
+
+ assert (app.srcdir / 'api').isdir()
+ for module in [
+ 'apidoc_dummy_module.rst',
+ ]:
+ assert (app.srcdir / 'api' / module).exists()
+ assert (app.srcdir / 'api' / 'apidoc_dummy_package.rst').exists()
+ assert not (app.srcdir / 'api' / 'custom.rst').exists()
+ assert not (app.srcdir / 'api' / 'conf.rst').exists()
+
+ with open(app.srcdir / 'api' / 'apidoc_dummy_package.rst') as fh:
+ package_doc = [x.strip() for x in fh.readlines()]
+
+ # The 'Module contents' header is present if '--module-first' isn't used
+ assert 'Module contents' in package_doc
+
+ assert (app.outdir / 'api').isdir()
+ for module in [
+ 'apidoc_dummy_module.html',
+ ]:
+ assert (app.outdir / 'api' / module).exists()
+ assert (app.outdir / 'api' / 'apidoc_dummy_package.html').exists()
+ assert not (app.outdir / 'api' / 'custom.html').exists()
+ assert not (app.outdir / 'api' / 'conf.html').exists()
+
assert not warning.getvalue()