Page MenuHomeSoftware Heritage

deposit: apidoc generation fails on settings.production module with traceback
Closed, MigratedEdits Locked

Description

when generating documentation for swh-deposit, the following unhandled traceback makes sphinx skip the module in title:

/home/zack/dati/projects/sw-heritage/git/swh-environment/swh-deposit/docs/apidoc/swh.deposit.settings.rst:28: WARNING: autodoc: failed to import module 'swh.deposit.settings.production'; the following exception was raised:
Traceback (most recent call last):
  File "/home/zack/.local/lib/python3.6/site-packages/sphinx/ext/autodoc.py", line 658, in import_object
    __import__(self.modname)
  File "/home/zack/dati/projects/sw-heritage/git/swh-environment/swh-deposit/swh/deposit/settings/production.py", line 29, in <module>
    SECRET_KEY = private_conf['secret_key']
KeyError: 'secret_key'

Event Timeline

zack triaged this task as Normal priority.Sep 7 2018, 11:49 AM
zack created this task.
zack added a project: Documentation.

m.o:

# Remove eventual installed configuration
rm -rf ~/.config/swh/deposit/
# run the main documentation makefile target
cd $SWH_ENVIRONMENT_HOME/swh-docs/docs && make html

I was not able to reproduce up until i removed the local configuration.
Now that will be somewhat better to aim for a fix ;)

Cheers,

I'm frustrated and i feel like ranting.

That django-sphinx hell stuff is annoying.
This setup is not supposed to be loaded.

In swh-deposit/docs/conf.py, we mention the necessary use of`swh.deposit.settings.development`, not the rest already...

There, done ranting!

Trying to make the thing work now.