Skip to content

Commit

Permalink
docs(release): improve release procedure documentation (#1620)
Browse files Browse the repository at this point in the history
* correct inaccuracies from earlier versions of release automation
* remove water mover performance entry from develop.tex
* rename vx.x.x-template.tex -> vx.y.z-template.tex
* describe release notes maintenance procedure
* remove unused function from build_dist.py
* reformat python scripts in distribution/
  • Loading branch information
wpbonelli authored Feb 14, 2024
1 parent b45da8b commit e31e79b
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 153 deletions.
226 changes: 116 additions & 110 deletions distribution/README.md

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion distribution/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
_is_windows = sys.platform.lower() == "win32"
_app_ext = ".exe" if _is_windows else ""
_soext = ".dll" if _is_windows else ".so"
_ostag = "win64" if _is_windows else "linux" if sys.platform.lower().startswith("linux") else "mac"
_ostag = (
"win64"
if _is_windows
else "linux" if sys.platform.lower().startswith("linux") else "mac"
)


def download_previous_version(output_path: PathLike) -> Tuple[str, Path]:
Expand Down
33 changes: 0 additions & 33 deletions distribution/build_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,39 +103,6 @@ def test_copy_sources(tmp_path):
assert (tmp_path / "utils" / "mf5to6" / "pymake").is_dir()
assert (tmp_path / "utils" / "zonebudget" / "pymake").is_dir()
assert not (tmp_path / "utils" / "idmloader").is_dir()



def build_examples(examples_repo_path: PathLike, overwrite: bool = False):
examples_repo_path = Path(examples_repo_path).expanduser().absolute()

# create examples, but don't run them
examples_path = examples_repo_path / "examples"
examples_path.mkdir(parents=True, exist_ok=True)
if not overwrite and any(get_model_paths(examples_path)):
print(f"Examples already built")
else:
print(f"Building examples")
scripts_folder = examples_repo_path / "scripts"
exclude_list = ["ex-gwf-capture.py"]
scripts = [
fname
for fname in scripts_folder.glob("*")
if fname.suffix == ".py"
and fname.stem.startswith("ex-")
and fname.stem not in exclude_list
]
for script in scripts:
argv = [
sys.executable,
script,
"--no_run",
"--no_plot",
"--destination",
examples_path,
]
print(f"running {argv} in {scripts_folder}")
run_command(argv, scripts_folder)


def setup_examples(
Expand Down
16 changes: 11 additions & 5 deletions distribution/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ def download_benchmarks(
reverse=True,
)
artifacts = [
a for a in artifacts if a["workflow_run"]["head_branch"] == "develop" # todo make configurable
a
for a in artifacts
if a["workflow_run"]["head_branch"] == "develop" # todo make configurable
]
most_recent = next(iter(artifacts), None)
print(f"Found most recent benchmarks (artifact {most_recent['id']})")
Expand Down Expand Up @@ -158,7 +160,9 @@ def build_benchmark_tex(

# download benchmark artifacts if any exist on GitHub
if not benchmarks_path.is_file():
benchmarks_path = download_benchmarks(_benchmarks_dir_path, repo_owner=repo_owner)
benchmarks_path = download_benchmarks(
_benchmarks_dir_path, repo_owner=repo_owner
)

# run benchmarks again if no benchmarks found on GitHub or overwrite requested
if overwrite or not benchmarks_path.is_file():
Expand All @@ -179,7 +183,7 @@ def build_benchmark_tex(
)
assert not ret, out + err
assert tex_path.is_file()

if (_distribution_path / f"{benchmarks_path.stem}.md").is_file():
assert (_docs_path / "ReleaseNotes" / f"{benchmarks_path.stem}.tex").is_file()

Expand Down Expand Up @@ -209,7 +213,7 @@ def build_deprecations_tex():
)
assert not ret, out + err
assert tex_path.is_file()

assert (_docs_path / "ReleaseNotes" / f"{deprecations_path.stem}.tex").is_file()


Expand Down Expand Up @@ -489,7 +493,9 @@ def build_documentation(

if not full:
# convert LaTeX to PDF
build_pdfs_from_tex(tex_paths=_dev_dist_tex_paths, output_path=output_path, overwrite=overwrite)
build_pdfs_from_tex(
tex_paths=_dev_dist_tex_paths, output_path=output_path, overwrite=overwrite
)
else:
# convert benchmarks to LaTex, running them first if necessary
build_benchmark_tex(
Expand Down
8 changes: 4 additions & 4 deletions doc/ReleaseNotes/develop.tex
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
% \item xxx
%\end{itemize}

\underline{ADVANCED STRESS PACKAGES}
\begin{itemize}
\item Refactoring of the Water Mover package in version 6.4.3 introduced a reduction in performance for GWF models with a large number of movers. The program was corrected so that performance is similar to previous versions.
%\underline{ADVANCED STRESS PACKAGES}
%\begin{itemize}
% \item
% \item xxx
% \item xxx
\end{itemize}
%\end{itemize}

%\underline{SOLUTION}
%\begin{itemize}
Expand Down
File renamed without changes.

0 comments on commit e31e79b

Please sign in to comment.