<div dir="ltr">Hi Phil,<div><br></div><div>Thanks a lot for your prompt reply -- as usual!</div><div><br></div><div>What would you suggest to do in the meantime?</div><div><br></div><div>We have an automated process to create SIP files from the headers, I could introduce the signature in there.</div><div>Does it sound like the most sensible approach to you?</div><div><br></div><div>Cheers,</div><div>Denis</div></div><br><div class="gmail_quote"><div dir="ltr">Le sam. 2 déc. 2017 à 06:47, Phil Thompson <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2 Dec 2017, at 12:52 am, Denis Rouzaud <<a href="mailto:denis.rouzaud@gmail.com" target="_blank">denis.rouzaud@gmail.com</a>> wrote:<br>
><br>
> Hi all,<br>
><br>
> I am trying to build QGIS Pypthon API documentation using Sphinx.<br>
> The Python API is built using SIP and I'm wondering which approach I should consider to get full signature (and hopefully from overloaded methods too) in the doc.<br>
> I would like to try avoiding having to write down the signature myself in the docstring, and get a full automatic method (with my overloaded methods :) )<br>
><br>
> I have read here that introspection is possible (which apprently wasn't the case before)<br>
> <a href="https://stackoverflow.com/a/41245451/1548052" rel="noreferrer" target="_blank">https://stackoverflow.com/a/41245451/1548052</a><br>
> It says you can do it automatically (via Argument Clinic [0]) or manually (author's prefered way) via setting PyDoc_STRVAR.<br>
> This sounds a bit obscure to me, I tried to print __text_signature__ on my objects/methods, and always get empty string.<br>
><br>
> I read from SIP %Docstring% documentation that as soon as you define a docstrings, it will prevent SIP from generating an automatic docstring that describes the Python signature of a function or method overload [1].<br>
><br>
> Now, is there a way of still automatically create the Python signature and prepend it to the custom docstring?<br>
<br>
Sorry, no.<br>
<br>
> The only thing I can think of is to build twice, once with and once without argument -o [2] and to get a way to merge them in Sphinx or when creating the rst templates.<br>
><br>
> Or is the Argument Clinic the approach?<br>
> Anything else?<br>
<br>
I am working on documentation improvements, including better auto-generation from .sip files. This is part of the reason for separating the docs from the PyQt sources. It's a work-in-progress and subject to lots of API changes (which is why the code - sphinx extensions etc - isn't publically available yet). The next lot of major development on it will be some time in the first quarter next year.<br>
<br>
Phil</blockquote></div>