Contributors mailing list archives

contributors@odoo-community.org

Avatar

Re: Odoo automatic code documentation

by
Sunflower IT, Tom Blauwendraat
- 24/06/2021 08:59:42

Hi Joerg

when using an Odoo installation framework such as Doodba or Waft, the package "odoo" is installed in the (virtual) environment at the end, making it available to everything that runs in the venv.

Am sure that it can also be achieved easily without using those frameworks, using 'pip install' directly, but I didn't try...

https://github.com/Tecnativa/doodba/blob/master/build.d/700-odoo-install

Tom


Op 6/24/21 om 10:42 AM schreef Joerg Lorenz:
Hi Guys, today we are asking for your insightfullness.
Our quest:  how the python code of odoo can be automatically documented from the code itself. 

But the approach with the various toos that there are fails:  

We have tested: 
  • pdoc, a simple Python 3 command line tool and library to auto-generate API documentation for Python modules. Supports Numpydoc / Google-style docstrings, doctests, reST directives, PEP 484 type annotations, custom templates ...

  • pdoc3, a fork of pdoc for Python 3 with support for Numpydoc / Google-style docstrings, doctests, LaTeX math, reST directives, PEP 484 type annotations, custom templates ...

  • PyDoc, a documentation browser (in HTML) and/or an off-line reference manual. Also in the standard library as pydoc.

  • pydoctor, a replacement for now inactive Epydoc, born for the needs of Twisted project.

and all of them fail.  It has to do that odoo as such is not a python module itself and thus cannot be imported. 

problem in models/res_company.py - <type 'exceptions.ImportError'>: No module named odoo

If anyone has some experience, ideas, or pointer towards a solution, it would be highly appreaciated. 

Best, Joe

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

Reference