forked from pool/python-WebTest
- Do not depend on pkg_resources.get_distribution and build_sphinx that is gone in Sphinx 7.0 (boo#1211051). - Add sphinx-7-fix.patch patch. OBS-URL: https://build.opensuse.org/request/show/1084285 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-WebTest?expand=0&rev=53
20 lines
755 B
Diff
20 lines
755 B
Diff
diff --git a/docs/conf.py b/docs/conf.py
|
|
index 96746bf..fed362e 100644
|
|
--- a/docs/conf.py
|
|
+++ b/docs/conf.py
|
|
@@ -59,9 +59,11 @@ copyright = '2012-%s, Ian Bicking' % thisyear
|
|
# The version info for the project you're documenting, acts as replacement for
|
|
# |version| and |release|, also used in various other places throughout the
|
|
# built documents.
|
|
-import pkg_resources
|
|
-version = pkg_resources.get_distribution(project).version
|
|
-release = version
|
|
+import pathlib
|
|
+lines = (pathlib.Path(__file__).parent.parent / 'PKG-INFO').open().readlines()
|
|
+line = lines[2]
|
|
+assert line.startswith('Version: ')
|
|
+release = line.split(':')[1].strip()
|
|
|
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
# for a list of supported languages.
|