Skip to content

Commit

Permalink
Fix docs changelog build logic
Browse files Browse the repository at this point in the history
  • Loading branch information
BobDotCom committed Nov 1, 2022
1 parent dccf1b7 commit 591c5c0
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,21 @@
"""
)

with open(new_changelog) as fr:
if fr.read() != CHANGELOG_TEXT: # Only write if it's changed to avoid recompiling
with open(new_changelog, "w") as fw:
fw.write(CHANGELOG_TEXT)
# Only write if it's changed to avoid recompiling the docs
def write_new():
with open(new_changelog, "w") as fw:
fw.write(CHANGELOG_TEXT)


try:
c_file = open(new_changelog)
except FileNotFoundError:
write_new()
else:
if c_file.read() != CHANGELOG_TEXT:
write_new()
c_file.close()


# 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
Expand Down

0 comments on commit 591c5c0

Please sign in to comment.