Hello community, here is the log from the commit of package python-releases for openSUSE:Factory checked in at 2018-08-12 20:56:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-releases (Old) and /work/SRC/openSUSE:Factory/.python-releases.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-releases" Sun Aug 12 20:56:33 2018 rev:2 rq:628769 version:1.6.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-releases/python-releases.changes 2018-05-29 10:30:35.968215885 +0200 +++ /work/SRC/openSUSE:Factory/.python-releases.new/python-releases.changes 2018-08-12 20:56:36.641618164 +0200 @@ -1,0 +2,11 @@ +Sat Aug 11 14:43:12 UTC 2018 - [email protected] + +- Enable testsuite in multibuild mode as it creates cycle otherwise + +------------------------------------------------------------------- +Sat Aug 11 09:50:05 UTC 2018 - [email protected] + +- Update to 1.6.1: + * Support sphinx 1.7 + +------------------------------------------------------------------- Old: ---- releases-1.5.0.tar.gz New: ---- _multibuild releases-1.6.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-releases.spec ++++++ --- /var/tmp/diff_new_pack.CN4ALz/_old 2018-08-12 20:56:37.029618953 +0200 +++ /var/tmp/diff_new_pack.CN4ALz/_new 2018-08-12 20:56:37.033618961 +0200 @@ -13,26 +13,44 @@ # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ +# +%global flavor @BUILD_FLAVOR@%{nil} %{?!python_module:%define python_module() python-%{**} python3-%{**}} -# Tests have dependency loop with python-invoke and python-invocations -Name: python-releases -Version: 1.5.0 +%if "%{flavor}" == "test" +%bcond_without test +%else +%bcond_with test +%endif +Version: 1.6.1 Release: 0 -License: BSD-2-Clause Summary: A Sphinx extension for changelog manipulation -Url: https://github.com/bitprophet/releases +License: BSD-2-Clause Group: Development/Languages/Python +URL: https://github.com/bitprophet/releases Source: https://files.pythonhosted.org/packages/source/r/releases/releases-%{version}.tar.gz -BuildRequires: python-rpm-macros -BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes -Requires: python-semantic_version < 3.0 +BuildRequires: python-rpm-macros Requires: python-Sphinx >= 1.3 +Requires: python-semantic_version +Requires: python-six >= 1.4.1 BuildArch: noarch - +%if %{with test} +Name: python-releases-%{flavor} +%else +Name: python-releases +%endif +%if %{with test} +BuildRequires: %{python_module Sphinx >= 1.3} +BuildRequires: %{python_module invocations} +BuildRequires: %{python_module invoke} +BuildRequires: %{python_module mock >= 1.0.1} +BuildRequires: %{python_module semantic_version} +BuildRequires: %{python_module six >= 1.4.1} +BuildRequires: %{python_module spec >= 0.11.3} +%endif %python_subpackages %description @@ -59,13 +77,21 @@ %python_build %install +%if !%{with test} %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif + +%if %{with test} +%check +%python_expand invoke-%{$python_bin_suffix} test +%endif %files %{python_files} -%defattr(-,root,root,-) %doc README.rst %license LICENSE +%if !%{with test} %{python_sitelib}/* +%endif %changelog ++++++ _multibuild ++++++ <multibuild> <package>test</package> </multibuild> ++++++ releases-1.5.0.tar.gz -> releases-1.6.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/releases-1.5.0/PKG-INFO new/releases-1.6.1/PKG-INFO --- old/releases-1.5.0/PKG-INFO 2018-05-03 00:29:54.000000000 +0200 +++ new/releases-1.6.1/PKG-INFO 2018-07-02 21:32:46.000000000 +0200 @@ -1,12 +1,11 @@ Metadata-Version: 1.1 Name: releases -Version: 1.5.0 +Version: 1.6.1 Summary: A Sphinx extension for changelog manipulation Home-page: https://github.com/bitprophet/releases Author: Jeff Forcier Author-email: [email protected] License: UNKNOWN -Description-Content-Type: UNKNOWN Description: .. image:: https://secure.travis-ci.org/bitprophet/releases.png?branch=master :target: https://travis-ci.org/bitprophet/releases Binary files old/releases-1.5.0/docs/.changelog.rst.swp and new/releases-1.6.1/docs/.changelog.rst.swp differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/releases-1.5.0/docs/changelog.rst new/releases-1.6.1/docs/changelog.rst --- old/releases-1.5.0/docs/changelog.rst 2018-05-03 00:29:35.000000000 +0200 +++ new/releases-1.6.1/docs/changelog.rst 2018-07-02 21:32:23.000000000 +0200 @@ -2,133 +2,145 @@ Changelog ========= -* :release:`1.5.0 <2018-05-02>` -* :feature:`59` Allow multiple changelog files -- ``releases_document_name`` +- :release:`1.6.1 <2018-07-02>` +- :release:`1.5.1 <2018-07-02>` +- :support:`73 backported` (via :issue:`77`) Add support for Sphinx 1.7.x + (while retaining support for previous versions of Sphinx). Thanks to Miro + Hrončok for the patch. +- :release:`1.6.0 <2018-06-20>` +- :feature:`75` Update ``releases.util.parse_changelog`` so it hands kwargs + into ``releases.util.make_app``, which in turn now accepts a + ``load_extensions`` argument triggering loading of one's configured + extensions. This is only of interest if you're using ``parse_changelog`` + directly; it does not impact normal Releases usage. +- :release:`1.5.0 <2018-05-02>` +- :feature:`59` Allow multiple changelog files -- ``releases_document_name`` may now optionally be a list of strings instead of a single string. Thanks to William Minchin for the patch. -* :release:`1.4.2 <2018-04-27>` -* :support:`74` We never pulled our README into our ``setup.py`` metadata, - resulting in a rather sparse PyPI page! This has been fixed. Thanks to Peter - Demin for the report. -* :release:`1.4.1 <2018-03-28>` -* :support:`73` Sphinx 1.7.x changed some semi-public APIs; given this is the - second minor release in a row to do so, we're explicitly bracketing our - ``setup.py`` dependencies to Sphinx >= 1.3 and < 1.7. We expect to bump this - up one minor release at a time as we add compatibility back in. -* :release:`1.4.0 <2017-10-20>` -* :support:`-` Drop Python 2.6 and 3.3 support, to correspond with earlier +- :release:`1.4.2 <2018-04-27>` +- :support:`74 backported` We never pulled our README into our ``setup.py`` + metadata, resulting in a rather sparse PyPI page! This has been fixed. Thanks + to Peter Demin for the report. +- :release:`1.4.1 <2018-03-28>` +- :support:`73 backported` Sphinx 1.7.x changed some semi-public APIs; given + this is the second minor release in a row to do so, we're explicitly + bracketing our ``setup.py`` dependencies to Sphinx >= 1.3 and < 1.7. We + expect to bump this up one minor release at a time as we add compatibility + back in. +- :release:`1.4.0 <2017-10-20>` +- :support:`-` Drop Python 2.6 and 3.3 support, to correspond with earlier changes in Sphinx and most other public Python projects. -* :bug:`- major` Identified a handful of issues with our Sphinx pin & +- :bug:`- major` Identified a handful of issues with our Sphinx pin & subsequently, internal changes in Sphinx 1.6 which broke (and/or appear to break, such as noisy warnings) our own behavior. These have (hopefully) all been fixed. -* :release:`1.3.2 <2017-10-19>` -* :support:`68 backported` Update packaging requirements to allow for +- :release:`1.3.2 <2017-10-19>` +- :support:`68 backported` Update packaging requirements to allow for ``sphinx>=1.3,<2``. Thanks to William Minchin. -* :release:`1.3.1 <2017-05-18>` -* :bug:`60` Report extension version to Sphinx for improved Sphinx debug +- :release:`1.3.1 <2017-05-18>` +- :bug:`60` Report extension version to Sphinx for improved Sphinx debug output. Credit: William Minchin. -* :bug:`66` (via :issue:`67`) Deal with some Sphinx 1.6.1 brokenness causing +- :bug:`66` (via :issue:`67`) Deal with some Sphinx 1.6.1 brokenness causing ``AttributeError`` by leveraging ``getattr()``'s default-value argument. Thanks to Ian Cordasco for catch & patch. -* :release:`1.3.0 <2016-12-09>` -* :feature:`-` Add ``releases.util``, exposing (among other things) a highly +- :release:`1.3.0 <2016-12-09>` +- :feature:`-` Add ``releases.util``, exposing (among other things) a highly useful ``parse_changelog(path)`` function that returns a user-facing dict representing a parsed changelog. Allows users to examine their changelogs programmatically and answer questions like "do I have any outstanding bugs in the 1.1 release line?". -* :release:`1.2.1 <2016-07-25>` -* :support:`51 backported` Modernize release management so PyPI trove +- :release:`1.2.1 <2016-07-25>` +- :support:`51 backported` Modernize release management so PyPI trove classifiers are more accurate, wheel archives are universal instead of Python 2 only, and release artifacts are GPG signed. -* :bug:`56` Fix exceptions that occurred when no release/issue link options +- :bug:`56` Fix exceptions that occurred when no release/issue link options were configured. Now those options are truly optional: release version and issue number text will simply display normally instead of as hyperlinks. Thanks to André Caron for the report. -* :bug:`36` Changelogs with no releases whatsoever should still be viable +- :bug:`36` Changelogs with no releases whatsoever should still be viable instead of raising exceptions. This is now happily the case. All items in such changelogs will end up in a single "unreleased features" list, just as with regular prehistory entries. Thanks to Steve Ivy for initial report and André Caron for additional feedback. -* :release:`1.2.0 <2016-05-20>` -* :bug:`- major` Fix formatting of release header dates; a "75% text size" +- :release:`1.2.0 <2016-05-20>` +- :bug:`- major` Fix formatting of release header dates; a "75% text size" style rule has had an uncaught typo for some time. -* :bug:`55 major` Non-annotated changelog line items (which implicitly become +- :bug:`55 major` Non-annotated changelog line items (which implicitly become bugs) were incorrectly truncating their contents in some situations (basically, any time they included non-regular-text elements like monospace, bold etc). This has been fixed. -* :feature:`19` Add ``unstable_prehistory`` option/mode for changelogs whose +- :feature:`19` Add ``unstable_prehistory`` option/mode for changelogs whose 0.x release cycle is "rapid" or "unstable" and doesn't closely follow normal semantic version-driven organization. See :ref:`unstable-prehistory`. -* :bug:`53 major` Tweak newly-updated models so bugfix items prior to an +- :bug:`53 major` Tweak newly-updated models so bugfix items prior to an initial release are considered 'major bugs' so they get rolled into that initial release (instead of causing a ``ValueError``). -* :release:`1.1.0 <2016-04-28>` -* :feature:`45` Add support for major version transitions (e.g. 1.0 to 2.0). +- :release:`1.1.0 <2016-04-28>` +- :feature:`45` Add support for major version transitions (e.g. 1.0 to 2.0). .. note:: This adds a new install-time dependency: the `semantic_version library <https://python-semanticversion.readthedocs.io>`_. It's pure Python, so installation should be trivial. -* :bug:`44 major` Update one of our internal docutils-related classes for +- :bug:`44 major` Update one of our internal docutils-related classes for compatibility with Sphinx 1.4.x. Thanks to Gabi Davar for catch & patch. -* :release:`1.0.0 <2015-11-05>` -* :feature:`42` For readability, issues within each release so they are +- :release:`1.0.0 <2015-11-05>` +- :feature:`42` For readability, issues within each release so they are displayed in feature->bug->support order. -* :feature:`41` Clean up changelog discovery so one can have comments, +- :feature:`41` Clean up changelog discovery so one can have comments, paragraphs or other non-bullet-list elements above or below the changelog. Thanks to Rodrigue Cloutier for the original request/patch. -* :release:`0.7.0 <2014-09-04>` -* :bug:`30 major` Add LICENSE (plus a handful of other administrative files) to +- :release:`0.7.0 <2014-09-04>` +- :bug:`30 major` Add LICENSE (plus a handful of other administrative files) to a ``MANIFEST.in`` so sdists pick it up. Thanks to Zygmunt Krynicki for catch & original patch (:issue:`33`). -* :feature:`21` Allow duplicate issue numbers; not allowing them was +- :feature:`21` Allow duplicate issue numbers; not allowing them was technically an implementation detail. Thanks to Dorian Puła for the patch. -* :release:`0.6.1 <2014-04-06>` -* :bug:`-` Fix a silly issue with the new feature from :issue:`22` where it +- :release:`0.6.1 <2014-04-06>` +- :bug:`-` Fix a silly issue with the new feature from :issue:`22` where it accidentally referred to the Sphinx document *title* instead of the document *filename*. -* :release:`0.6.0 <2014-04-03>` -* :feature:`22` Make the document name used as the changelog - previously +- :release:`0.6.0 <2014-04-03>` +- :feature:`22` Make the document name used as the changelog - previously hardcoded as ``changelog`` (``.rst``) - configurable. Thanks to James Mills for the feature request. -* :feature:`26` Allow specifying Github path shorthand config option instead of +- :feature:`26` Allow specifying Github path shorthand config option instead of explicit release/issue URL strings. -* :release:`0.5.3 <2014-03-15>` -* :bug:`25` Empty/no-issue line items broke at some point; fixed. -* :bug:`24` Broke inline issue parsing; fixed now. -* :release:`0.5.2 <2014-03-13>` -* :bug:`23` Rework implementation to deal with issue descriptions that span +- :release:`0.5.3 <2014-03-15>` +- :bug:`25` Empty/no-issue line items broke at some point; fixed. +- :bug:`24` Broke inline issue parsing; fixed now. +- :release:`0.5.2 <2014-03-13>` +- :bug:`23` Rework implementation to deal with issue descriptions that span more than one paragraph - subsequent paragraphs/blocks were not being displayed prior. -* :release:`0.5.1 <2014-02-11>` -* :bug:`-` Fix silly bug in :issue:`20` that cropped up on Python 3.x. -* :release:`0.5.0 <2014-02-11>` -* :feature:`20` Allow specifying minimum release line in bugfixes that don't +- :release:`0.5.1 <2014-02-11>` +- :bug:`-` Fix silly bug in :issue:`20` that cropped up on Python 3.x. +- :release:`0.5.0 <2014-02-11>` +- :feature:`20` Allow specifying minimum release line in bugfixes that don't apply to all active lines (e.g. because they pertain to a recently added feature.) -* :release:`0.4.0 <2013-12-24>` -* :feature:`17` Allow releases to explicitly define which issues they include. +- :release:`0.4.0 <2013-12-24>` +- :feature:`17` Allow releases to explicitly define which issues they include. Useful for overriding default assumptions (e.g. a special bugfix release from an otherwise dormant line.) -* :release:`0.3.1 <2013-12-18>` -* :bug:`16` Fix some edge cases regarding release ordering & unreleased issue +- :release:`0.3.1 <2013-12-18>` +- :bug:`16` Fix some edge cases regarding release ordering & unreleased issue display. Includes splitting unreleased display info into two 'Next release' pseudo-release entries. -* :support:`15` Add :doc:`/concepts` to flesh out some assumptions not +- :support:`15` Add :doc:`/concepts` to flesh out some assumptions not adequately explained in :doc:`/usage`. -* :release:`0.3.0 <2013-11-21>` -* :feature:`11` Fix up styling so changelogs don't look suboptimal under `the +- :release:`0.3.0 <2013-11-21>` +- :feature:`11` Fix up styling so changelogs don't look suboptimal under `the new Read The Docs theme <http://ericholscher.com/blog/2013/nov/4/new-theme-read-the-docs/>`_. Still looks OK under their old theme too! -* :support:`0` Move to actual Sphinx docs so we can use ourselves. -* :support:`0` Created a basic test suite to protect against regressions. -* :bug:`9 major` Clean up additional 'unreleased' display/organization +- :support:`0` Move to actual Sphinx docs so we can use ourselves. +- :support:`0` Created a basic test suite to protect against regressions. +- :bug:`9 major` Clean up additional 'unreleased' display/organization behavior, including making sure ALL unreleased issues show up as 'unreleased'. Thanks to Donald Stufft for the report. -* :feature:`1` (also :issue:`3`, :issue:`10`) Allow using ``-`` or ``0`` as a +- :feature:`1` (also :issue:`3`, :issue:`10`) Allow using ``-`` or ``0`` as a dummy issue 'number', which will result in no issue number/link being displayed. Thanks to Markus Zapke-Gründemann and Hynek Schlawack for patches & discussion. @@ -141,22 +153,22 @@ regular bugs) is being retained as there's not a lot to gain from deactivating it. -* :release:`0.2.4 <2013.10.04>` -* :support:`0 backported` Handful of typos, doc tweaks & addition of a +- :release:`0.2.4 <2013.10.04>` +- :support:`0 backported` Handful of typos, doc tweaks & addition of a .gitignore file. Thanks to Markus Zapke-Gründemann. -* :bug:`0` Fix duplicate display of "bare" (not prefixed with an issue role) +- :bug:`0` Fix duplicate display of "bare" (not prefixed with an issue role) changelog entries. Thanks again to Markus. -* :support:`0 backported` Edited the README/docs to be clearer about how +- :support:`0 backported` Edited the README/docs to be clearer about how Releases works/operates. -* :support:`0 backported` Explicitly documented how non-role-prefixed line +- :support:`0 backported` Explicitly documented how non-role-prefixed line items are preserved. -* :bug:`0` Updated non-role-prefixed line items so they get prefixed with a +- :bug:`0` Updated non-role-prefixed line items so they get prefixed with a '[Bug]' signifier (since they are otherwise treated as bugfix items.) -* :release:`0.2.3 <2013.09.16>` -* :bug:`0` Fix a handful of bugs in release assignment logic. -* :release:`0.2.2 <2013.09.15>` -* :bug:`0` Ensured Python 3 compatibility. -* :release:`0.2.1 <2013.09.15>` -* :bug:`0` Fixed a stupid bug causing invalid issue hyperlinks. -* :release:`0.2.0 <2013.09.15>` -* :feature:`0` Basic functionality. +- :release:`0.2.3 <2013.09.16>` +- :bug:`0` Fix a handful of bugs in release assignment logic. +- :release:`0.2.2 <2013.09.15>` +- :bug:`0` Ensured Python 3 compatibility. +- :release:`0.2.1 <2013.09.15>` +- :bug:`0` Fixed a stupid bug causing invalid issue hyperlinks. +- :release:`0.2.0 <2013.09.15>` +- :feature:`0` Basic functionality. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/releases-1.5.0/releases/_version.py new/releases-1.6.1/releases/_version.py --- old/releases-1.5.0/releases/_version.py 2018-05-01 23:27:47.000000000 +0200 +++ new/releases-1.6.1/releases/_version.py 2018-07-02 21:32:26.000000000 +0200 @@ -1,2 +1,2 @@ -__version_info__ = (1, 5, 0) +__version_info__ = (1, 6, 1) __version__ = '.'.join(map(str, __version_info__)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/releases-1.5.0/releases/util.py new/releases-1.6.1/releases/util.py --- old/releases-1.5.0/releases/util.py 2018-05-01 23:27:47.000000000 +0200 +++ new/releases-1.6.1/releases/util.py 2018-07-02 21:31:44.000000000 +0200 @@ -11,10 +11,15 @@ from docutils.io import NullOutput from docutils.nodes import bullet_list from sphinx.application import Sphinx # not exposed at top level -# NOTE: importing these from environment for backwards compat with Sphinx 1.3 -from sphinx.environment import ( - SphinxStandaloneReader, SphinxFileInput, SphinxDummyWriter, -) +try: + from sphinx.io import ( + SphinxStandaloneReader, SphinxFileInput, SphinxDummyWriter, + ) +except ImportError: + # NOTE: backwards compat with Sphinx 1.3 + from sphinx.environment import ( + SphinxStandaloneReader, SphinxFileInput, SphinxDummyWriter, + ) # sphinx_domains is only in Sphinx 1.5+, but is presumably necessary from then # onwards. try: @@ -29,7 +34,7 @@ from . import construct_releases, setup -def parse_changelog(path): +def parse_changelog(path, **kwargs): """ Load and parse changelog file from ``path``, returning data structures. @@ -44,6 +49,10 @@ print("Unreleased issues for 2.3.x: {}".format(changelog['2.3'])) print("Contents of v1.2.1: {}".format(changelog['1.2.1'])) + Aside from the documented arguments, any additional keyword arguments are + passed unmodified into an internal `get_doctree` call (which then passes + them to `make_app`). + :param str path: A relative or absolute file path string. :returns: @@ -59,8 +68,11 @@ families (so, a changelog spanning only 1.x will only have ``unreleased_1_feature``, whereas one with 1.x and 2.x releases will have ``unreleased_1_feature`` and ``unreleased_2_feature``, etc). + + .. versionchanged:: 1.6 + Added support for passing kwargs to `get_doctree`/`make_app`. """ - app, doctree = get_doctree(path) + app, doctree = get_doctree(path, **kwargs) # Have to semi-reproduce the 'find first bullet list' bit from main code, # which is unfortunately side-effect-heavy (thanks to Sphinx plugin # design). @@ -94,7 +106,7 @@ return ret -def get_doctree(path): +def get_doctree(path, **kwargs): """ Obtain a Sphinx doctree from the RST file at ``path``. @@ -102,17 +114,23 @@ Sphinx itself, but things there are pretty tightly coupled. So we wrote this. + Any additional kwargs are passed unmodified into an internal `make_app` + call. + :param str path: A relative or absolute file path string. :returns: A two-tuple of the generated ``sphinx.application.Sphinx`` app and the doctree (a ``docutils.document`` object). + + .. versionchanged:: 1.6 + Added support for passing kwargs to `make_app`. """ root, filename = os.path.split(path) docname, _ = os.path.splitext(filename) # TODO: this only works for top level changelog files (i.e. ones where # their dirname is the project/doc root) - app = make_app(srcdir=root) + app = make_app(srcdir=root, **kwargs) # Create & init a BuildEnvironment. Mm, tasty side effects. app._init_env(freshenv=True) env = app.env @@ -149,7 +167,12 @@ # domains' roles & so forth. Without this, rendering the doctree lacks # almost all Sphinx magic, including things like :ref: and :doc:! with sphinx_domains(env): - reader = SphinxStandaloneReader(**reader_kwargs) + try: + reader = SphinxStandaloneReader(**reader_kwargs) + except TypeError: + # If we import from io, this happens automagically, not in API + del reader_kwargs['parsers'] + reader = SphinxStandaloneReader(**reader_kwargs) pub = Publisher(reader=reader, writer=SphinxDummyWriter(), destination_class=NullOutput) @@ -171,6 +194,19 @@ return app, pub.document +def load_conf(srcdir): + """ + Load ``conf.py`` from given ``srcdir``. + + :returns: Dictionary derived from the conf module. + """ + path = os.path.join(srcdir, 'conf.py') + mylocals = {'__file__': path} + with open(path) as fd: + exec(fd.read(), mylocals) + return mylocals + + def make_app(**kwargs): """ Create a dummy Sphinx app, filling in various hardcoded assumptions. @@ -183,6 +219,9 @@ It also neuters Sphinx's internal logging, which otherwise causes verbosity in one's own test output and/or debug logs. + Finally, it does load the given srcdir's ``conf.py``, but only to read + specific bits like ``extensions`` (if requested); most of it is ignored. + All args are stored in a single ``**kwargs``. Aside from the params listed below (all of which are optional), all kwargs given are turned into 'releases_xxx' config settings; e.g. ``make_app(foo='bar')`` is like @@ -200,17 +239,29 @@ :param str doctreedir: Sphinx doctree directory path. + :param bool load_extensions: + Whether to load the real ``conf.py`` and setup any extensions it + configures. Default: ``False``. + :returns: A Sphinx ``Application`` instance. + + .. versionchanged:: 1.6 + Added the ``load_extensions`` kwarg. """ srcdir = kwargs.pop('srcdir', mkdtemp()) dstdir = kwargs.pop('dstdir', mkdtemp()) doctreedir = kwargs.pop('doctreedir', mkdtemp()) + load_extensions = kwargs.pop('load_extensions', False) + real_conf = None try: # Sphinx <1.6ish Sphinx._log = lambda self, message, wfile, nonl=False: None # Sphinx >=1.6ish. Technically still lets Very Bad Things through, # unlike the total muting above, but probably OK. - logging.getLogger('sphinx').setLevel(logging.ERROR) + # NOTE: used to just do 'sphinx' but that stopped working, even on + # sphinx 1.6.x. Weird. Unsure why hierarchy not functioning. + for name in ('sphinx', 'sphinx.sphinx.application'): + logging.getLogger(name).setLevel(logging.ERROR) # App API seems to work on all versions so far. app = Sphinx( srcdir=srcdir, @@ -219,6 +270,9 @@ doctreedir=doctreedir, buildername='html', ) + # Might as well load the conf file here too. + if load_extensions: + real_conf = load_conf(srcdir) finally: for d in (srcdir, dstdir, doctreedir): # Only remove empty dirs; non-empty dirs are implicitly something @@ -229,6 +283,9 @@ pass setup(app) # Mock out the config within. More assumptions by Sphinx :( + # TODO: just use real config and overlay what truly needs changing? is that + # feasible given the rest of the weird ordering we have to do? If it is, + # maybe just literally slap this over the return value of load_conf()... config = { 'releases_release_uri': 'foo_%s', 'releases_issue_uri': 'bar_%s', @@ -250,6 +307,14 @@ app.config.init_values() except TypeError: # boy I wish Python had an ArityError or w/e app.config.init_values(lambda x: x) + # Initialize extensions (the internal call to this happens at init time, + # which of course had no valid config yet here...) + if load_extensions: + for extension in real_conf.get('extensions', []): + # But don't set up ourselves again, that causes errors + if extension == 'releases': + continue + app.setup_extension(extension) return app diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/releases-1.5.0/releases.egg-info/PKG-INFO new/releases-1.6.1/releases.egg-info/PKG-INFO --- old/releases-1.5.0/releases.egg-info/PKG-INFO 2018-05-03 00:29:54.000000000 +0200 +++ new/releases-1.6.1/releases.egg-info/PKG-INFO 2018-07-02 21:32:46.000000000 +0200 @@ -1,12 +1,11 @@ Metadata-Version: 1.1 Name: releases -Version: 1.5.0 +Version: 1.6.1 Summary: A Sphinx extension for changelog manipulation Home-page: https://github.com/bitprophet/releases Author: Jeff Forcier Author-email: [email protected] License: UNKNOWN -Description-Content-Type: UNKNOWN Description: .. image:: https://secure.travis-ci.org/bitprophet/releases.png?branch=master :target: https://travis-ci.org/bitprophet/releases diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/releases-1.5.0/releases.egg-info/SOURCES.txt new/releases-1.6.1/releases.egg-info/SOURCES.txt --- old/releases-1.5.0/releases.egg-info/SOURCES.txt 2018-05-03 00:29:54.000000000 +0200 +++ new/releases-1.6.1/releases.egg-info/SOURCES.txt 2018-07-02 21:32:46.000000000 +0200 @@ -5,6 +5,7 @@ setup.cfg setup.py tasks.py +docs/.changelog.rst.swp docs/changelog.rst docs/concepts.rst docs/conf.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/releases-1.5.0/releases.egg-info/requires.txt new/releases-1.6.1/releases.egg-info/requires.txt --- old/releases-1.5.0/releases.egg-info/requires.txt 2018-05-03 00:29:54.000000000 +0200 +++ new/releases-1.6.1/releases.egg-info/requires.txt 2018-07-02 21:32:46.000000000 +0200 @@ -1,2 +1,2 @@ semantic_version<3.0 -sphinx<1.7,>=1.3 +sphinx<1.8,>=1.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/releases-1.5.0/setup.py new/releases-1.6.1/setup.py --- old/releases-1.5.0/setup.py 2018-05-01 22:28:06.000000000 +0200 +++ new/releases-1.6.1/setup.py 2018-07-02 20:40:56.000000000 +0200 @@ -19,7 +19,7 @@ packages=['releases'], install_requires=[ 'semantic_version<3.0', - 'sphinx>=1.3,<1.7', + 'sphinx>=1.3,<1.8', ], classifiers=[ 'Development Status :: 5 - Production/Stable',
