Skip to content

Commit

Permalink
Sphinx config fix (#458)
Browse files Browse the repository at this point in the history
* Ignore .venv directory and docs _build directory in git

We don't want those directories commited to the git repository.

Python virtual environments are often created in a .venv/ directory,
thus ignoring all .venv/ directories.

The docs/_build directory is automatically created by Sphinx when the
documentation is generated. We don't want the generated documentation
to be commited to the repository.

* Ignore .venv directory in Sphinx config

This is required because if someone stores the virtualenv in a .venv
directory (common practice) under the docs/ path, then Sphinx will try
to pickup all files under the virtualenv. This leads to a lot of errors,
performance impacts and side effects.

* Remove static HTML path from Sphinx config

There are currently no additional static files for Sphinx in place,
but there's a _static directory configured in the Sphinx docs. When
creating the Sphinx docs without an `mkdocs _static` command before,
this leads to an error.

Thus removing the _static path until we need it again.
  • Loading branch information
domibarton authored and rytilahti committed Jan 20, 2019
1 parent 07102a8 commit 6b2ce47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ __pycache__
.cache/
.mypy_cache/
.tox/
.venv/

.coverage

docs/_build/
9 changes: 7 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = [
'_build',
'Thumbs.db',
'.DS_Store',
'.venv'
]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
Expand All @@ -101,7 +106,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = []

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down

0 comments on commit 6b2ce47

Please sign in to comment.