Skip to content

Commit

Permalink
Use git stash to protect setuptools_scm from RTD.
Browse files Browse the repository at this point in the history
  • Loading branch information
trexfeathers committed Aug 24, 2022
1 parent e7bad99 commit b8a246e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ build:
# to allow setuptools-scm to correctly auto-discover the version.
- git fetch --unshallow
- git fetch --all
# Need to stash the local changes that Read the Docs makes so that
# setuptools_scm can generate the correct Iris version.
pre_install:
- git stash
post_install:
- git stash apply

conda:
environment: requirements/ci/readthedocs.yml
Expand Down
12 changes: 1 addition & 11 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,7 @@ def autolog(message):

# The version info for the project you're documenting, acts as replacement for
# |version|, also used in various other places throughout the built documents.

if on_rtd:
# Get the version string that was generated when RTD installed Iris - RTD
# later modifies Iris' source, causing setuptools_scm to advance the
# version string away from its correct value.
from iris._version import __version__

version = __version__
else:
version = get_version("scitools-iris")

version = get_version("scitools-iris")
release = version
autolog(f"Iris Version = {version}")
autolog(f"Iris Release = {release}")
Expand Down

0 comments on commit b8a246e

Please sign in to comment.