Skip to content

Commit

Permalink
Set version in conf.py using env var
Browse files Browse the repository at this point in the history
  • Loading branch information
scottsand-db committed Apr 29, 2024
1 parent 42f09bd commit 53b2a4a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/generate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ def main():
help="Generate the API docs")

args = parser.parse_args()

# Assert that env var _DELTA_LAKE_RELEASE_VERSION_ (used by conf.py) is set
try:
os.environ["_DELTA_LAKE_RELEASE_VERSION_"]
except KeyError:
raise KeyError(f"Environment variable _DELTA_LAKE_RELEASE_VERSION_ not set.")

docs_root_dir = os.path.dirname(os.path.realpath(__file__))
api_docs_root_dir = os.path.join(docs_root_dir, "apis")
Expand Down
9 changes: 7 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@
project = 'Delta Lake'
author = 'Delta Lake Authors'

version = '3.0.0' # Replaced by copybara
release = '3.0.0'
# generate_docs.py enforces that this is set.
version = os.environ["_DELTA_LAKE_RELEASE_VERSION_"] # Replaced by copybara
release = version

# Prevent us from shooting ourselves in the foot and unintentionally using an OLD version
# for the NEXT release.
del os.environ["_DELTA_LAKE_RELEASE_VERSION_"]

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down

0 comments on commit 53b2a4a

Please sign in to comment.