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
This commit is contained in:
Sean Mooney 2024-11-07 21:45:02 +00:00
parent 052ed8e119
commit f34b94a1b9

View File

@ -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(
'/'
)