Skip to content

Commit

Permalink
Docs: Import factory after mangling sys.path
Browse files Browse the repository at this point in the history
Sphinx conf.py mangles sys.path to add the top-level directory, so that
factory_boy is available. Don’t import the package before the path has
been updated.
  • Loading branch information
francoisfreitag committed May 30, 2022
1 parent ed107a8 commit cf29849
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
import os
import sys

import factory

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.dirname(os.path.abspath('.')))

# Must be imported after the parent directory was added to sys.path for global sphinx installation.
import factory # noqa

# -- Project information -----------------------------------------------------

Expand Down

0 comments on commit cf29849

Please sign in to comment.