Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing docs build #32

Merged
merged 6 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx
sphinx >=8
recommonmark
pandoc
45 changes: 35 additions & 10 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -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 ---------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ dependencies:
- pytest-datadir
- coveralls
- bmi-tester
- sphinx
- sphinx >=8
- recommonmark
- pandoc
- notebook
- matplotlib
- cartopy
- build
- python-build
- twine
- zest.releaser
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dev = [
"nox",
]
build = [
"build",
"python-build",
"twine",
"zest.releaser"
]
Expand Down
Loading