Doxygen chokes on __init__.py files

I am trying to document a python module with Doxygen - however it seems that the existence of __init__.py files is causing problems

The __init__.py files are currently empty (I tried adding comments inside it, e.g.

 ## Nothing here 

but without success). Module namespaces are not allowed on the Doxygen side. If below was my file:

 ## @package stuff # @author me # Description # # Some more description ## A class that does whatever class whatever: ## A method that does stuff def dostuff(self): pass 

He will select the lines "Description" and "A few more descriptions." Even if any of the classes in the file does not contain __init__ methods (suggested that there may be name conflicts), doxygen will not receive anything in the module.

I tried using various EXCLUDE directives in Doxyfile but nothing worked.

Has anyone encountered this problem before? When deleting __init__.py files, everything works fine, but this is a much less optimal solution.

+4
source share
1 answer

I had exactly the same problem, I found that the problem is with the package naming. The name provided must be fully qualified. Otherwise, you are creating documentation for a new package, in this case called stuff , but your class will be in an undocumented package, which, if you do not set EXTRACT_ALL to yes, will be hidden.

So, suppose your file is called stuff.py and is in a directory called mypackage along with __init__.py , then stuff.py should look something like this:

 ## @package mypackage.stuff # Description # # Some more description # @author me ## A class that does whatever class whatever: ## A method that does stuff def dostuff(self): pass ## A function that does whatever def whatever: pass 
+2
source

All Articles