From f34b94a1b941df894a6c87332a34fa9718a565e0 Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Thu, 7 Nov 2024 21:45:02 +0000 Subject: [PATCH] fix support for py39 Ica6524895e38e1e54ae3207a1e58a97f53481a12 addressed Sphinx 8.x warnings related to representing paths as strings on python 3.9 we clamp sphinx to <8 because 8.0.0 bumps the min python to 3.10 this change bumps the sphinx version check from >= 7.0 to >=8.0 to aling it with the versions we use on py3.9 Change-Id: I62784d7ea2a7c3bee4727bc4bc05d22699f7bbc7 --- openstackdocstheme/page_context.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openstackdocstheme/page_context.py b/openstackdocstheme/page_context.py index 7c7d8ab1..b262b58c 100644 --- a/openstackdocstheme/page_context.py +++ b/openstackdocstheme/page_context.py @@ -80,9 +80,11 @@ def _get_last_updated(app, pagename): # Strip the prefix from the filename so the git command recognizes # the file as part of the current repository. - if sphinx.version_info >= (7, 0): + # NOTE(sean-k-mooney): on python 3.9 we clamp sphinx to <8 + # app.builder.env.srcdir is a string on py39 + if sphinx.version_info >= (8, 0): src_file = str(full_src_file.relative_to(app.builder.env.srcdir)) - else: # Sphinx < 7.0 + else: # Sphinx < 8.0 src_file = full_src_file[len(str(app.builder.env.srcdir)) :].lstrip( '/' )