From ba098a8e7807af427845c960be716d1f369374c6 Mon Sep 17 00:00:00 2001 From: James Douglass Date: Fri, 27 Feb 2026 16:16:23 -0800 Subject: [PATCH] Updating how we get version information. RE:#469 --- HISTORY.rst | 3 +++ docs/source/conf.py | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index dd70a57e..3d02f3bb 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,9 @@ Unreleased Changes References to the old name and website domain have been updated to reflect this change. https://github.com/natcap/pygeoprocessing/issues/458 +* Fixing a build issue with readthedocs builds due to the deprecation of + ``pkg_resources``. + https://github.com/natcap/pygeoprocessing/issues/469 2.4.10 (2026-01-13) ------------------- diff --git a/docs/source/conf.py b/docs/source/conf.py index a06405e3..5af9a8d2 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -6,16 +6,17 @@ # -- Path setup -------------------------------------------------------------- +import datetime +import os # 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. # # import sys # sys.path.insert(0, os.path.abspath('.')) -import datetime -import os +from importlib.metadata import version + import sphinx.ext.apidoc -from pkg_resources import get_distribution # -- Project information ----------------------------------------------------- @@ -77,5 +78,5 @@ os.path.join(DOCS_SOURCE_DIR, '..', '..', 'src', 'pygeoprocessing'), ]) -release = get_distribution('pygeoprocessing').version +release = version('pygeoprocessing') version = '.'.join(release.split('.')[:2])