Skip to content

Commit

Permalink
Merge pull request #4 from climateintelligence/fix-docs-on-rtd
Browse files Browse the repository at this point in the history
Fix docs on rtd
  • Loading branch information
nilshempelmann authored Nov 17, 2023
2 parents 35c528a + 32bcaaf commit d68bf7b
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10"]
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
Expand All @@ -32,8 +32,8 @@ jobs:
run: make test
- name: Lint with flake8 ⚙️
run: make lint
if: matrix.python-version == 3.7
if: matrix.python-version == 3.8
- name: Build docs 🏗️
run: make docs
if: false
if: matrix.python-version == 3.8

19 changes: 4 additions & 15 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# fail_on_warning might generate hard to fix error, in this case it can be
# disabled but this also means those errors will fail silently, choose wisely.
fail_on_warning: false

# Build documentation with MkDocs
#mkdocs:
Expand All @@ -24,20 +21,12 @@ build:
os: ubuntu-22.04
tools:
python: "mambaforge-22.9"
# python: "3.12"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

conda:
environment: environment.yml
environment: environment-docs.yml

# Optionally set the version of Python and requirements required to build your docs
python:
install:
- method: pip
path: .
extra_requirements:
- dev
# python:
# install:
# - requirements: requirements_docs.txt

60 changes: 45 additions & 15 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,52 @@
# To avoid having to install these and burst memory limit on ReadTheDocs.
# List of all tested working mock imports from all birds so new birds can
# inherit without having to test which work which do not.
autodoc_mock_imports = ["numpy", "xarray", "fiona", "rasterio", "shapely",
"osgeo", "geopandas", "pandas", "statsmodels",
"affine", "rasterstats", "spotpy", "matplotlib",
"scipy", "unidecode", "gdal", "sentry_sdk", "dask",
"numba", "parse", "siphon", "sklearn", "cftime",
"netCDF4", "bottleneck", "ocgis", "geotiff", "geos",
"hdf4", "hdf5", "zlib", "pyproj", "proj", "cartopy",
"scikit-learn", "cairo"]
autodoc_mock_imports = [
"numpy",
"xarray",
"fiona",
"rasterio",
"shapely",
"osgeo",
"geopandas",
"pandas",
"statsmodels",
"affine",
"rasterstats",
"spotpy",
"matplotlib",
"scipy",
"unidecode",
"gdal",
"sentry_sdk",
"dask",
"numba",
"parse",
"siphon",
"sklearn",
"cftime",
"netCDF4",
"bottleneck",
"ocgis",
"geotiff",
"geos",
"hdf4",
"hdf5",
"zlib",
"pyproj",
"proj",
"cartopy",
"scikit-learn",
"cairo",
]

# Monkeypatch constant because the following are mock imports.
# Only works if numpy is actually installed and at the same time being mocked.
#import numpy
#numpy.pi = 3.1416
# import numpy
# numpy.pi = 3.1416

# We are using mock imports in readthedocs, so probably safer to not run the notebooks
nbsphinx_execute = 'never'
nbsphinx_execute = "never"

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand All @@ -89,16 +119,16 @@
# the built documents.
#
# The short X.Y version.
version = albatross.__version__
version = "0.1.0"
# The full version, including alpha/beta/rc tags.
release = albatross.__version__
release = "0.1.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -112,7 +142,7 @@
todo_include_todos = False

# Suppress "WARNING: unknown mimetype for ..." when building EPUB.
suppress_warnings = ['epub.unknown_project_files']
suppress_warnings = ["epub.unknown_project_files"]

# Avoid "configuration.rst:4:duplicate label configuration, other instance in configuration.rst"
autosectionlabel_prefix_document = True
Expand Down
1 change: 1 addition & 0 deletions environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ dependencies:
- sphinx
- nbsphinx
- ipython
- pandoc

0 comments on commit d68bf7b

Please sign in to comment.