From 5461c8dceb5d6b949a2d8edf29fdf96e6f913fae Mon Sep 17 00:00:00 2001 From: tcmetzger <39711796+tcmetzger@users.noreply.github.com> Date: Mon, 22 Apr 2024 08:41:09 -0700 Subject: [PATCH] update config for readthedocs --- .github/workflows/docs-publish.yml | 32 ------------------------------ .readthedocs.yml | 26 ++++++++++++++++++++++++ docs/source/conf.py | 13 +++++++----- docs/source/releases.json | 22 ++------------------ setup.cfg | 1 + xrspatial/_version.py | 16 +++++++++++++++ 6 files changed, 53 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/docs-publish.yml create mode 100644 .readthedocs.yml create mode 100644 xrspatial/_version.py diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml deleted file mode 100644 index de2cbb59..00000000 --- a/.github/workflows/docs-publish.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Upload Docs To Azure Blob Storage - -on: - release: - types: [published] - workflow_dispatch: - -jobs: - upload: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '3.0.100' - - name: Install dependencies - run: | - sudo apt-get -y install pandoc - python -m pip install --upgrade pip - - name: Install xarray-spatial - run: | - pip install .[doc,tests] - pip list - - name: Build docs - run: | - make -C docs html - - uses: lauchacarro/Azure-Storage-Action@v1.0 - with: - enabled-static-website: 'true' - folder: 'docs/build/html' - index-document: 'index.html' - connection-string: ${{ secrets.CONNECTION_STRING }} diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..d5743495 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,26 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.12" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/source/conf.py + +# Optional but recommended, declare the Python requirements required +# to build your documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - method: pip + path: . + extra_requirements: + - [docs, tests] diff --git a/docs/source/conf.py b/docs/source/conf.py index 14e830cb..938619d4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -8,6 +8,7 @@ # -- Path setup -------------------------------------------------------------- +from datetime import datetime import json # 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 @@ -23,7 +24,7 @@ # -- Project information ----------------------------------------------------- project = u'xarray_spatial' -copyright = u'2020-2022, makepath' +copyright = u'2020-{}, makepath'.format(datetime.now().year) author = u'makepath' version = release = xrspatial.__version__ @@ -66,7 +67,7 @@ # # 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. @@ -99,8 +100,8 @@ smv_tag_whitelist = r'^v([0-9]\.[2-9]\.[0-9])' # Load releases -with open("releases.json") as f: - releases = json.load(f) +# with open("releases.json") as f: +# releases = json.load(f) # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -109,11 +110,13 @@ html_theme_options = { "external_links": [], "github_url": "https://github.com/makepath/xarray-spatial", + "navbar_end": ["navbar-icon-links"], } html_context = { 'css_files': ['_static/css/styles.css'], - 'releases': [(release, url) for release, url in releases.items()], + # 'releases': [(release, url) for release, url in releases.items()], + "default_mode": "light", } autosummary_generate = True diff --git a/docs/source/releases.json b/docs/source/releases.json index c794fc2f..7eb4b8ca 100644 --- a/docs/source/releases.json +++ b/docs/source/releases.json @@ -1,21 +1,3 @@ { - "latest": "https://xarray-spatial.org/", - "0.3.7": "https://xarray-spatial.org/v0.3.7/index.html", - "0.3.6": "https://xarray-spatial.org/v0.3.6/index.html", - "0.3.5": "https://xarray-spatial.org/v0.3.5/index.html", - "0.3.4": "https://xarray-spatial.org/v0.3.4/index.html", - "0.3.3": "https://xarray-spatial.org/v0.3.3/index.html", - "0.3.2": "https://xarray-spatial.org/v0.3.2/index.html", - "0.3.1": "https://xarray-spatial.org/v0.3.1/index.html", - "0.3.0": "https://xarray-spatial.org/v0.3.0/index.html", - "0.2.9": "https://xarray-spatial.org/v0.2.9/index.html", - "0.2.8": "https://xarray-spatial.org/v0.2.8/index.html", - "0.2.7": "https://xarray-spatial.org/v0.2.7/index.html", - "0.2.6": "https://xarray-spatial.org/v0.2.6/index.html", - "0.2.5": "https://xarray-spatial.org/v0.2.5/index.html", - "0.2.4": "https://xarray-spatial.org/v0.2.4/index.html", - "0.2.3": "https://xarray-spatial.org/v0.2.3/index.html", - "0.2.2": "https://xarray-spatial.org/v0.2.2/index.html", - "0.2.1": "https://xarray-spatial.org/v0.2.1/index.html", - "0.2.0": "https://xarray-spatial.org/v0.2.0/index.html" -} \ No newline at end of file + "latest": "https://xarray-spatial.readthedocs.io/" +} diff --git a/setup.cfg b/setup.cfg index d36c8451..d298ae28 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,6 +34,7 @@ console_scripts = [options.extras_require] doc = + dask[dataframe] geopandas Jinja2 >=2.11 ipykernel diff --git a/xrspatial/_version.py b/xrspatial/_version.py new file mode 100644 index 00000000..288b522f --- /dev/null +++ b/xrspatial/_version.py @@ -0,0 +1,16 @@ +# file generated by setuptools_scm +# don't change, don't track in version control +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Tuple, Union + VERSION_TUPLE = Tuple[Union[int, str], ...] +else: + VERSION_TUPLE = object + +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE + +__version__ = version = '0.3.8.dev1+g27ab0c8.d20240419' +__version_tuple__ = version_tuple = (0, 3, 8, 'dev1', 'g27ab0c8.d20240419')