Python3: API Documentation generator

Tim Diels limyreth at gmail.com
Sun Oct 24 18:01:41 CEST 2010


On 27/09/2010 20:44, Ken Watford wrote:
> On Mon, Sep 27, 2010 at 1:15 PM, Tim Diels<limyreth at gmail.com>  wrote:
>> On 27/09/2010 09:02, Chris Rebert wrote:
>>> On Sun, Sep 26, 2010 at 11:56 PM, Tim Diels<farkmor at gmail.com>    wrote:
>>>>   Hi all
>>>>
>>>> I've just switched to python3 and it turns out my current API
>>>> documentation
>>>> generator (epydoc) no longer works. I am looking for a tool that reads
>>>> the
>>>> docstrings of all classes, ... in my project and turns it into HTML
>>>> documentation.
>>> Sphinx (http://sphinx.pocoo.org/ ) is the new gold standard. You'll
>>> want to enable the `autodoc` extension:
>>> http://sphinx.pocoo.org/ext/autodoc.html
>>>
>>> Cheers,
>>> Chris
>>> --
>>> http://blog.rebertia.com
>> I tried, but it fails to run through python code that's not backwards
>> compatible with older python versions.
>>
>> It fails with: ...autodoc can't import/find module 'pytilities', it reported
>> error: "invalid syntax (overload.py, line 55)"...
>>
>> This is line 55 (runs in python3, not in python):
>> def process_args(self, *args, kwargs={})
>>
> As far as I'm aware, autodoc works by importing the modules and then
> reading doctext straight from the __doc__ attributes.
> So the module in question has to import correctly in whatever
> interpreter Sphinx is using. You probably need to install Sphinx with
> python3 to get it to use the right interpreter. If you're using
> easy_install or pip, check if you have an easy_install-3.1 or pip-3.1
> (or similar) script installed.

Sorry for the late reaction, but I still have trouble getting sphinx to 
work with python3.

I downloaded the latest version at PyPI:
http://pypi.python.org/pypi/Sphinx/1.0.4

Ran:
python3 setup.py

And it failed with a syntax error at line 50 which happens to be an 
old-styled print statement stating it requires at least py2.4.

I'd find it odd that the python3 documentation would refer to sphinx as 
a good tool if the tool wouldn't support it, so am I downloading the 
wrong package or ...?

Thanks in advance

Greetings

Tim



More information about the Python-list mailing list