Skip to content

Commit

Permalink
only build changes.rst when parsing changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
tybug committed Oct 29, 2024
1 parent 21502ba commit 9880b85
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tooling/src/hypothesistooling/projects/hypothesispython.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,21 @@ def has_source_changes():
return tools.has_changes([PYTHON_SRC])


def build_docs(builder="html"):
def build_docs(*, builder="html", only=[]):
# See https://www.sphinx-doc.org/en/stable/man/sphinx-build.html
# (unfortunately most options only have the short flag version)
tools.scripts.pip_tool(
"sphinx-build",
"-W",
"--keep-going",
"-T",
"-E",
"-b",
builder,
"docs",
"docs/_build/" + builder,
*[
"sphinx-build",
"-W",
"-T",
"-E",
"-b",
builder,
"docs",
"docs/_build/" + builder,
*only,
],
cwd=HYPOTHESIS_PYTHON,
)

Expand Down Expand Up @@ -189,7 +191,7 @@ def upload_distribution():

# Construct plain-text + markdown version of this changelog entry,
# with link to canonical source.
build_docs(builder="text")
build_docs(builder="text", only=["docs/changes.rst"])
textfile = os.path.join(HYPOTHESIS_PYTHON, "docs", "_build", "text", "changes.txt")
with open(textfile, encoding="utf-8") as f:
lines = f.readlines()
Expand Down

0 comments on commit 9880b85

Please sign in to comment.