[DPDK-KMODS] doc: allow external build

Message ID 7bda955f729dd450e5cd63e93962df37de4ee91b.1605890459.git.anatoly.burakov@intel.com (mailing list archive)
State Rejected, archived
Headers
Series [DPDK-KMODS] doc: allow external build |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed

Commit Message

Anatoly Burakov Nov. 20, 2020, 4:41 p.m. UTC
  Currently, when building sphinx documentation, the build will only
succeed if being run from the build system, because the conf.py script
expects DPDK_VERSION environment variable to be set, and crashes if it
is not.

However, there are certain external tools (such as sphinx documentation
preview extensions for certain IDE's) that use live preview and thus
rely on running their own sphinx commands. In these cases, it is useful
to permit building sphinx documentation without specifying the
DPDK_VERSION environment variable. The version string is the only thing
preventing manual sphinx build commands from working.

Fix the conf.py to use "None" as a version string in cases when
DPDK_VERSION environment variable is not set.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 doc/guides/conf.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Anatoly Burakov Nov. 20, 2020, 4:48 p.m. UTC | #1
On 20-Nov-20 4:41 PM, Anatoly Burakov wrote:
> Currently, when building sphinx documentation, the build will only
> succeed if being run from the build system, because the conf.py script
> expects DPDK_VERSION environment variable to be set, and crashes if it
> is not.
> 
> However, there are certain external tools (such as sphinx documentation
> preview extensions for certain IDE's) that use live preview and thus
> rely on running their own sphinx commands. In these cases, it is useful
> to permit building sphinx documentation without specifying the
> DPDK_VERSION environment variable. The version string is the only thing
> preventing manual sphinx build commands from working.
> 
> Fix the conf.py to use "None" as a version string in cases when
> DPDK_VERSION environment variable is not set.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Apologies, something went wrong with my automation...
  

Patch

diff --git a/doc/guides/conf.py b/doc/guides/conf.py
index 9de490e1c4..aceeb62a4f 100644
--- a/doc/guides/conf.py
+++ b/doc/guides/conf.py
@@ -36,7 +36,7 @@ 
 html_show_copyright = False
 highlight_language = 'none'
 
-release = environ['DPDK_VERSION']
+release = environ.setdefault('DPDK_VERSION', "None")
 version = release
 
 master_doc = 'index'