twisted / pydoctor

This is pydoctor, an API documentation generator that works by static analysis.
https://pydoctor.readthedocs.io
Other
184 stars 49 forks source link

Workaround for "Source directory lacks __init__.py" #824

Closed buhtz closed 1 day ago

buhtz commented 1 day ago

I am using pydocotor for several Python projects which do fit to modern packaging standards. Now I have a very old project that currently does not fit to those standards. For example there is no init.py file in some folders. Because of that pydoctor is not satisfied and tell me Source directory lacks __init__.py.

Is there a way to workaround that until the project migrated to modern packaging standards (which will take 1 or 2 years).

This is the original project and its folder structure. https://github.com/bit-team/backintime

This is how I call pydoctor (runs in the repo's common/doc/coderef folder):

INFO    -  Run pydoctor with arguments:
    --project-name=backintime (1.5.3-dev.3e80feee)
    --project-version=1.5.3-dev.3e80feee
    --project-url=https://github.com/bit-team/backintime
    --html-viewsource-base=https://github.com/bit-team/backintime/src/branch/common
    --docformat=google
    --make-html
    --process-types
    --warnings-as-errors
    --project-base-dir=../..
    --html-output=html
    --intersphinx=https://docs.python.org/3/objects.inv
    --intersphinx=https://pandas.pydata.org/docs/objects.inv
    --intersphinx=https://seaborn.pydata.org/objects.inv
    --intersphinx=https://numpy.org/doc/stable/objects.inv
    --intersphinx=https://matplotlib.org/stable/objects.inv
    --intersphinx=https://pillow.readthedocs.io/en/stable/objects.inv
    --intersphinx=https://openpyxl.readthedocs.io/en/stable/objects.inv
    --intersphinx=https://python-docx.readthedocs.io/en/stable/objects.inv
    --intersphinx=https://webcolors.readthedocs.io/en/stable/objects.inv
    /home/user/goodCloud/my.work/bit/backintime/common
    /home/user/goodCloud/my.work/bit/backintime/qt
adding directory /home/user/goodCloud/my.work/bit/backintime/common
Source directory lacks __init__.py: /home/user/goodCloud/my.work/bit/backintime/common
tristanlatr commented 1 day ago

Hi @buhtz, for the short term the are two options:

Try these options and tell me what you think :)

Are you trying to document namespace packages? If so this should be related to #343. Any help regarding fixing this issue will be greatly appreciated.

buhtz commented 1 day ago

Thank you for your reply. It is a 15 year old project not following any known python standards. It is just a folder filled with py files. :laughing: I think it is easier to wait until I migrated to modern python packaging standards (backintime#1575).