diff --git a/CHANGES.md b/CHANGES.md index c709e53..f6b654c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,8 +2,9 @@ ## 0.3.4 (unreleased) - -- Nothing changed yet. +- Fix failing docs build (#32) +- Use Miniforge instead of Mambaforge in CI (#31) +- Make a landing page for the examples (#30) ## 0.3.3 (2024-08-17) diff --git a/docs/requirements.txt b/docs/requirements.txt index d76b099..e4fc6d8 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ -sphinx +sphinx >=8 recommonmark pandoc diff --git a/docs/source/conf.py b/docs/source/conf.py index 490b498..3e4386e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,35 +1,60 @@ -# Configuration file for the Sphinx documentation builder. -# +""" conf.py + Configuration file for the Sphinx documentation builder. + + isort:skip_file +""" + # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- +# import sys +# sys.path.insert(0, os.path.abspath('.')) +import datetime + # 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 os -# import sys -# sys.path.insert(0, os.path.abspath('.')) -import datetime +import os +import pathlib +import re + +import packaging + -import pkg_resources +def get_version_from_file(path): + with open(path) as fp: + match = re.search(r'__version__\s*=\s*[\'"]([^\'"]+)[\'"]', fp.read()) + if match: + version = match.group(1) + else: + raise ValueError(f"version string not found ({path})") + return packaging.version.Version(version) + + +src_dir = os.path.abspath( + os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, "bmi_geotiff") +) +# sys.path.insert(0, src_dir) +docs_dir = pathlib.Path(__file__).parent +version_file = os.path.join(src_dir, "_version.py") # The master toctree document. master_doc = "index" - # -- Project information ----------------------------------------------------- project = "bmi-geotiff" author = "Community Surface Dynamics Modeling System" -version = pkg_resources.get_distribution("bmi_geotiff").version -release = version this_year = datetime.date.today().year copyright = f"{this_year}, {author}" +v = get_version_from_file(version_file) +version = f"{v.major}.{v.minor}" +release = v.public # -- General configuration --------------------------------------------------- diff --git a/environment.yml b/environment.yml index f2ca7fd..d440bfa 100644 --- a/environment.yml +++ b/environment.yml @@ -15,12 +15,12 @@ dependencies: - pytest-datadir - coveralls - bmi-tester - - sphinx + - sphinx >=8 - recommonmark - pandoc - notebook - matplotlib - cartopy - - build + - python-build - twine - zest.releaser diff --git a/pyproject.toml b/pyproject.toml index 1df46e2..c428b24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ dev = [ "nox", ] build = [ - "build", + "python-build", "twine", "zest.releaser" ]