Message ID | 1472657372-21039-2-git-send-email-markus.heiser@darmarit.de (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from <linux-media-owner@vger.kernel.org>) id 1bf7Sj-0006Jm-NT; Wed, 31 Aug 2016 15:30:01 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.84_2/mailfrontend-7) with esmtp id 1bf7Sh-0000yE-24; Wed, 31 Aug 2016 17:30:01 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964845AbcHaP35 (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Wed, 31 Aug 2016 11:29:57 -0400 Received: from smtp2.goneo.de ([85.220.129.33]:37480 "EHLO smtp2.goneo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934320AbcHaP3z (ORCPT <rfc822;linux-media@vger.kernel.org>); Wed, 31 Aug 2016 11:29:55 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp2.goneo.de (Postfix) with ESMTP id 5199023F59E; Wed, 31 Aug 2016 17:29:53 +0200 (CEST) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -2.79 X-Spam-Level: X-Spam-Status: No, score=-2.79 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=0.110, BAYES_00=-1.9] autolearn=unavailable Received: from smtp2.goneo.de ([127.0.0.1]) by localhost (smtp2.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IaDG3bAtp6zU; Wed, 31 Aug 2016 17:29:43 +0200 (CEST) Received: from ubu1604.fritz.box (dyndsl-095-033-012-111.ewe-ip-backbone.de [95.33.12.111]) by smtp2.goneo.de (Postfix) with ESMTPSA id 3766A241849; Wed, 31 Aug 2016 17:29:43 +0200 (CEST) From: Markus Heiser <markus.heiser@darmarit.de> To: Jonathan Corbet <corbet@lwn.net> Cc: Markus Heiser <markus.heiser@darmarIT.de>, Mauro Carvalho Chehab <mchehab@infradead.org>, Jani Nikula <jani.nikula@intel.com>, Linux Media Mailing List <linux-media@vger.kernel.org>, linux-doc@vger.kernel.org Subject: [PATCH 1/3] doc-rst:c-domain: fix sphinx version incompatibility Date: Wed, 31 Aug 2016 17:29:30 +0200 Message-Id: <1472657372-21039-2-git-send-email-markus.heiser@darmarit.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472657372-21039-1-git-send-email-markus.heiser@darmarit.de> References: <1472657372-21039-1-git-send-email-markus.heiser@darmarit.de> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.8.31.152117 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1900_1999 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, IN_REP_TO 0, LEGITIMATE_NEGATE 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, MULTIPLE_REAL_RCPTS 0, REFERENCES 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CC_NAME 0, __CC_NAME_DIFF_FROM_ACC 0, __CC_REAL_NAMES 0, __CP_URI_IN_BODY 0, __FROM_DOMAIN_IN_ANY_CC2 0, __FROM_DOMAIN_IN_RCPT 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __HTTPS_URI 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __MULTIPLE_URI_TEXT 0, __REFERENCES 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NAME 0, __TO_NAME_DIFF_FROM_ACC 0, __TO_REAL_NAMES 0, __URI_IN_BODY 0, __URI_NO_WWW 0, __URI_NS , __URI_WITH_PATH 0' |
Commit Message
Markus Heiser
Aug. 31, 2016, 3:29 p.m. UTC
From: Markus Heiser <markus.heiser@darmarIT.de> The self.indexnode's tuple has changed in sphinx version 1.4, from a former 4 element tuple to a 5 element tuple. https://github.com/sphinx-doc/sphinx/commit/e6a5a3a92e938fcd75866b4227db9e0524d58f7c Signed-off-by: Markus Heiser <markus.heiser@darmarIT.de> --- Documentation/sphinx/cdomain.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
Comments
On Wed, 31 Aug 2016 17:29:30 +0200 Markus Heiser <markus.heiser@darmarit.de> wrote: > + if major >= 1 and minor < 4: > + # indexnode's tuple changed in 1.4 > + # https://github.com/sphinx-doc/sphinx/commit/e6a5a3a92e938fcd75866b4227db9e0524d58f7c > + self.indexnode['entries'].append( > + ('single', indextext, targetname, '')) > + else: > + self.indexnode['entries'].append( > + ('single', indextext, targetname, '', None)) So this doesn't seem right. We'll get the four-entry tuple behavior with 1.3 and the five-entry behavior with 1.4...but what happens when 2.0 comes out? Did you want maybe: if major == 1 and minor < 4: ? (That will fail on 0.x, but we've already stated that we don't support below 1.2). jon -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Am 06.09.2016 um 14:19 schrieb Jonathan Corbet <corbet@lwn.net>: > On Wed, 31 Aug 2016 17:29:30 +0200 > Markus Heiser <markus.heiser@darmarit.de> wrote: > >> + if major >= 1 and minor < 4: >> + # indexnode's tuple changed in 1.4 >> + # https://github.com/sphinx-doc/sphinx/commit/e6a5a3a92e938fcd75866b4227db9e0524d58f7c >> + self.indexnode['entries'].append( >> + ('single', indextext, targetname, '')) >> + else: >> + self.indexnode['entries'].append( >> + ('single', indextext, targetname, '', None)) > > So this doesn't seem right. We'll get the four-entry tuple behavior with > 1.3 and the five-entry behavior with 1.4...but what happens when 2.0 > comes out? > > Did you want maybe: > > if major == 1 and minor < 4: > > ? Ups, yes you are right. Should I send a new patch .. or could you fix it? -- Markus -- > > (That will fail on 0.x, but we've already stated that we don't support > below 1.2). > > jon -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, 6 Sep 2016 14:24:11 +0200
Markus Heiser <markus.heiser@darmarit.de> wrote:
> Should I send a new patch .. or could you fix it?
Please just regenerate the series and I'll apply it.
Thanks,
jon
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, 06 Sep 2016, Jonathan Corbet <corbet@lwn.net> wrote: > On Wed, 31 Aug 2016 17:29:30 +0200 > Markus Heiser <markus.heiser@darmarit.de> wrote: > >> + if major >= 1 and minor < 4: >> + # indexnode's tuple changed in 1.4 >> + # https://github.com/sphinx-doc/sphinx/commit/e6a5a3a92e938fcd75866b4227db9e0524d58f7c >> + self.indexnode['entries'].append( >> + ('single', indextext, targetname, '')) >> + else: >> + self.indexnode['entries'].append( >> + ('single', indextext, targetname, '', None)) > > So this doesn't seem right. We'll get the four-entry tuple behavior with > 1.3 and the five-entry behavior with 1.4...but what happens when 2.0 > comes out? > > Did you want maybe: > > if major == 1 and minor < 4: > > ? > > (That will fail on 0.x, but we've already stated that we don't support > below 1.2). Is there a way to check the number of entries expected in the tuples instead of trying to match the version? BR, Jani.
Am 06.09.2016 um 15:34 schrieb Jani Nikula <jani.nikula@intel.com>: > On Tue, 06 Sep 2016, Jonathan Corbet <corbet@lwn.net> wrote: >> On Wed, 31 Aug 2016 17:29:30 +0200 >> Markus Heiser <markus.heiser@darmarit.de> wrote: >> >>> + if major >= 1 and minor < 4: >>> + # indexnode's tuple changed in 1.4 >>> + # https://github.com/sphinx-doc/sphinx/commit/e6a5a3a92e938fcd75866b4227db9e0524d58f7c >>> + self.indexnode['entries'].append( >>> + ('single', indextext, targetname, '')) >>> + else: >>> + self.indexnode['entries'].append( >>> + ('single', indextext, targetname, '', None)) >> >> So this doesn't seem right. We'll get the four-entry tuple behavior with >> 1.3 and the five-entry behavior with 1.4...but what happens when 2.0 >> comes out? >> >> Did you want maybe: >> >> if major == 1 and minor < 4: >> >> ? >> >> (That will fail on 0.x, but we've already stated that we don't support >> below 1.2). > > Is there a way to check the number of entries expected in the tuples > instead of trying to match the version? Sadly not, the dissection of the tuple is spread around the source :( Sphinx has some more of these tuples with fixed length (remember conf.py, the latex_documents settings) where IMHO hash/value pairs (dicts) are more suitable. -- Markus -- > BR, > Jani. > -- > Jani Nikula, Intel Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Em Tue, 6 Sep 2016 17:10:53 +0200 Markus Heiser <markus.heiser@darmarit.de> escreveu: > Am 06.09.2016 um 15:34 schrieb Jani Nikula <jani.nikula@intel.com>: > > > On Tue, 06 Sep 2016, Jonathan Corbet <corbet@lwn.net> wrote: > >> On Wed, 31 Aug 2016 17:29:30 +0200 > >> Markus Heiser <markus.heiser@darmarit.de> wrote: > >> > >>> + if major >= 1 and minor < 4: > >>> + # indexnode's tuple changed in 1.4 > >>> + # https://github.com/sphinx-doc/sphinx/commit/e6a5a3a92e938fcd75866b4227db9e0524d58f7c > >>> + self.indexnode['entries'].append( > >>> + ('single', indextext, targetname, '')) > >>> + else: > >>> + self.indexnode['entries'].append( > >>> + ('single', indextext, targetname, '', None)) > >> > >> So this doesn't seem right. We'll get the four-entry tuple behavior with > >> 1.3 and the five-entry behavior with 1.4...but what happens when 2.0 > >> comes out? > >> > >> Did you want maybe: > >> > >> if major == 1 and minor < 4: > >> > >> ? > >> > >> (That will fail on 0.x, but we've already stated that we don't support > >> below 1.2). > > > > Is there a way to check the number of entries expected in the tuples > > instead of trying to match the version? > > Sadly not, the dissection of the tuple is spread around the source :( > > Sphinx has some more of these tuples with fixed length (remember > conf.py, the latex_documents settings) where IMHO hash/value pairs > (dicts) are more suitable. Well, the LaTeX stuff at conf.py seems to have a new field on version 1.4.x. At least, our config has: # (source start file, name, description, authors, manual section). but 1.4.x docs mentions another tuple: toctree_only. Regards, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Am 06.09.2016 um 17:55 schrieb Mauro Carvalho Chehab <mchehab@infradead.org>: ... >> Sphinx has some more of these tuples with fixed length (remember >> conf.py, the latex_documents settings) where IMHO hash/value pairs >> (dicts) are more suitable. > > Well, the LaTeX stuff at conf.py seems to have a new field on version > 1.4.x. At least, our config has: > > # (source start file, name, description, authors, manual section). > > but 1.4.x docs mentions another tuple: toctree_only. Hmm, as far as I can see, toctree_only is supported since Release 0.3 (May 6, 2008): https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.old#L1025 But is was implemented optional (from the beginning): https://github.com/sphinx-doc/sphinx/blame/master/sphinx/builders/latex.py#L104 -- Markus -- > > Regards, > Mauro > -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/Documentation/sphinx/cdomain.py b/Documentation/sphinx/cdomain.py index 9eb714a..66816ae 100644 --- a/Documentation/sphinx/cdomain.py +++ b/Documentation/sphinx/cdomain.py @@ -29,11 +29,15 @@ u""" from docutils.parsers.rst import directives +import sphinx from sphinx.domains.c import CObject as Base_CObject from sphinx.domains.c import CDomain as Base_CDomain __version__ = '1.0' +# Get Sphinx version +major, minor, patch = map(int, sphinx.__version__.split(".")) + def setup(app): app.override_domain(CDomain) @@ -85,8 +89,14 @@ class CObject(Base_CObject): indextext = self.get_index_text(name) if indextext: - self.indexnode['entries'].append(('single', indextext, - targetname, '', None)) + if major >= 1 and minor < 4: + # indexnode's tuple changed in 1.4 + # https://github.com/sphinx-doc/sphinx/commit/e6a5a3a92e938fcd75866b4227db9e0524d58f7c + self.indexnode['entries'].append( + ('single', indextext, targetname, '')) + else: + self.indexnode['entries'].append( + ('single', indextext, targetname, '', None)) class CDomain(Base_CDomain):