From 9fbd45b35fa9111f8409556eb65b9ee664d2b58c Mon Sep 17 00:00:00 2001 From: Jamie Lennox Date: Tue, 4 Oct 2016 16:30:44 +1100 Subject: [PATCH] Fix docs building As part of review [1] the openstack build system assumes the layout of the docs directories to be doc/build. This is not what requests-mock was producing. Fix the docs building directories to make it work with the build system again. [1] Icb0c02dc5b6f7b5e248e0df6d6093c29535b08f3 Closes-Bug: #1630114 Change-Id: Iea93ecfb0506d5ccd0b79ad35f5677797fadf730 --- .gitignore | 2 +- {docs => doc}/Makefile | 0 {docs => doc}/api/modules.rst | 0 {docs => doc}/api/requests_mock.rst | 0 {docs => doc}/make.bat | 0 {docs => doc/source}/adapter.rst | 0 {docs => doc/source}/conf.py | 17 +++-------------- {docs => doc/source}/contrib.rst | 0 {docs => doc/source}/fixture.rst | 0 {docs => doc/source}/history.rst | 0 {docs => doc/source}/index.rst | 0 {docs => doc/source}/knownissues.rst | 0 {docs => doc/source}/matching.rst | 0 {docs => doc/source}/mocker.rst | 0 {docs => doc/source}/overview.rst | 0 doc/source/readme.rst | 1 + {docs => doc/source}/response.rst | 0 docs/readme.rst | 1 - setup.cfg | 5 +++++ 19 files changed, 10 insertions(+), 16 deletions(-) rename {docs => doc}/Makefile (100%) rename {docs => doc}/api/modules.rst (100%) rename {docs => doc}/api/requests_mock.rst (100%) rename {docs => doc}/make.bat (100%) rename {docs => doc/source}/adapter.rst (100%) rename {docs => doc/source}/conf.py (93%) rename {docs => doc/source}/contrib.rst (100%) rename {docs => doc/source}/fixture.rst (100%) rename {docs => doc/source}/history.rst (100%) rename {docs => doc/source}/index.rst (100%) rename {docs => doc/source}/knownissues.rst (100%) rename {docs => doc/source}/matching.rst (100%) rename {docs => doc/source}/mocker.rst (100%) rename {docs => doc/source}/overview.rst (100%) create mode 100644 doc/source/readme.rst rename {docs => doc/source}/response.rst (100%) delete mode 100644 docs/readme.rst diff --git a/.gitignore b/.gitignore index 8144590..e851b8f 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,7 @@ output/*.html output/*/index.html # Sphinx -docs/_build +doc/build .testrepository diff --git a/docs/Makefile b/doc/Makefile similarity index 100% rename from docs/Makefile rename to doc/Makefile diff --git a/docs/api/modules.rst b/doc/api/modules.rst similarity index 100% rename from docs/api/modules.rst rename to doc/api/modules.rst diff --git a/docs/api/requests_mock.rst b/doc/api/requests_mock.rst similarity index 100% rename from docs/api/requests_mock.rst rename to doc/api/requests_mock.rst diff --git a/docs/make.bat b/doc/make.bat similarity index 100% rename from docs/make.bat rename to doc/make.bat diff --git a/docs/adapter.rst b/doc/source/adapter.rst similarity index 100% rename from docs/adapter.rst rename to doc/source/adapter.rst diff --git a/docs/conf.py b/doc/source/conf.py similarity index 93% rename from docs/conf.py rename to doc/source/conf.py index c9185da..eebbd45 100755 --- a/docs/conf.py +++ b/doc/source/conf.py @@ -15,19 +15,8 @@ import sys, os import pbr.version -# 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.abspath('.')) - -# Get the project root dir, which is the parent dir of this -cwd = os.getcwd() -project_root = os.path.dirname(cwd) - -# Insert the project root dir as the first element in the PYTHONPATH. -# This lets us ensure that the source package is imported, and that its -# version is used. -sys.path.insert(0, project_root) +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), + '..', '..'))) import requests_mock # noqa @@ -141,7 +130,7 @@ html_theme = 'default' # 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 = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/docs/contrib.rst b/doc/source/contrib.rst similarity index 100% rename from docs/contrib.rst rename to doc/source/contrib.rst diff --git a/docs/fixture.rst b/doc/source/fixture.rst similarity index 100% rename from docs/fixture.rst rename to doc/source/fixture.rst diff --git a/docs/history.rst b/doc/source/history.rst similarity index 100% rename from docs/history.rst rename to doc/source/history.rst diff --git a/docs/index.rst b/doc/source/index.rst similarity index 100% rename from docs/index.rst rename to doc/source/index.rst diff --git a/docs/knownissues.rst b/doc/source/knownissues.rst similarity index 100% rename from docs/knownissues.rst rename to doc/source/knownissues.rst diff --git a/docs/matching.rst b/doc/source/matching.rst similarity index 100% rename from docs/matching.rst rename to doc/source/matching.rst diff --git a/docs/mocker.rst b/doc/source/mocker.rst similarity index 100% rename from docs/mocker.rst rename to doc/source/mocker.rst diff --git a/docs/overview.rst b/doc/source/overview.rst similarity index 100% rename from docs/overview.rst rename to doc/source/overview.rst diff --git a/doc/source/readme.rst b/doc/source/readme.rst new file mode 100644 index 0000000..a6210d3 --- /dev/null +++ b/doc/source/readme.rst @@ -0,0 +1 @@ +.. include:: ../../README.rst diff --git a/docs/response.rst b/doc/source/response.rst similarity index 100% rename from docs/response.rst rename to doc/source/response.rst diff --git a/docs/readme.rst b/docs/readme.rst deleted file mode 100644 index 72a3355..0000000 --- a/docs/readme.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../README.rst diff --git a/setup.cfg b/setup.cfg index 349021d..acafbc5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,6 +24,11 @@ test_suite = requests_mock.tests [files] packages = requests_mock +[build_sphinx] +all_files = 1 +build-dir = doc/build +source-dir = doc/source + [wheel] universal = 1