Skip to content

Commit

Permalink
ci(release): reinit release notes, update dist scripts (#1283)
Browse files Browse the repository at this point in the history
* reinit release notes for next development cycle
* add --repo-owner option to build_docs.py
* use .mf6minsim model for sample mf6 output in docs
* refactor update_version.py to use packaging.version
* convert version.txt to plain text
* convert development version to v6.4.3.dev0
* include ostag in versions subbed into docs
* check dist subdirs in check_dist.py
* include meson.options in full dist
  • Loading branch information
wpbonelli authored Jul 14, 2023
1 parent 62a1e8c commit 697b889
Show file tree
Hide file tree
Showing 22 changed files with 224 additions and 370 deletions.
18 changes: 1 addition & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,23 +230,7 @@ jobs:
if: runner.os == 'Linux'
working-directory: usgslatex/usgsLaTeX
run: sudo ./install.sh --all-users

- name: Install dependencies for ex-gwf-twri example model
if: runner.os == 'Linux'
working-directory: modflow6-examples/etc
run: |
# install extra Python packages
pip install -r requirements.pip.txt
# the example model needs executables to be on the path
echo "${{ github.workspace }}/modflow6/bin" >> $GITHUB_PATH
echo "${{ github.workspace }}/modflow6/bin/downloaded" >> $GITHUB_PATH
- name: Build ex-gwf-twri example model
if: runner.os == 'Linux'
working-directory: modflow6-examples/scripts
run: python ex-gwf-twri.py


- name: Test distribution scripts
working-directory: modflow6/distribution
env:
Expand Down
39 changes: 15 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,21 +212,16 @@ jobs:
working-directory: usgslatex/usgsLaTeX
run: sudo ./install.sh --all-users

- name: Install dependencies for ex-gwf-twri example model
if: ${{ runner.os == 'Linux' && inputs.run_tests == true }}
working-directory: modflow6-examples/etc
run: |
# install extra Python packages
pip install -r requirements.pip.txt
# the example model needs executables to be on the path
echo "${{ github.workspace }}/modflow6/bin" >> $GITHUB_PATH
echo "${{ github.workspace }}/modflow6/bin/downloaded" >> $GITHUB_PATH
# - name: Install dependencies for ex-gwf-twri example model
# if: ${{ runner.os == 'Linux' && inputs.run_tests == true }}
# working-directory: modflow6-examples/etc
# run: |
# # install extra Python packages
# pip install -r requirements.pip.txt

- name: Build ex-gwf-twri example model
if: ${{ runner.os == 'Linux' && inputs.run_tests == true }}
working-directory: modflow6-examples/scripts
run: python ex-gwf-twri.py
# # the example model needs executables to be on the path
# echo "${{ github.workspace }}/modflow6/bin" >> $GITHUB_PATH
# echo "${{ github.workspace }}/modflow6/bin/downloaded" >> $GITHUB_PATH

- name: Test distribution scripts
if: ${{ inputs.run_tests == true }}
Expand Down Expand Up @@ -300,13 +295,18 @@ jobs:
fi
eval "$cmd"
- name: Update FloPy classes
working-directory: modflow6/autotest
run: python update_flopy.py

- name: Download pre-built binaries
uses: actions/download-artifact@v3
with:
name: bin-${{ runner.os }}
path: bin

- name: Install dependencies for building models
if: inputs.full == true
working-directory: modflow6-examples/etc
env:
GITHUB_TOKEN: ${{ github.token }}
Expand All @@ -324,15 +324,6 @@ jobs:

# the example model also needs mf2005
get-modflow "${{ github.workspace }}/bin" --subset mf2005,triangle,gridgen

- name: Update FloPy
working-directory: modflow6/autotest
run: python update_flopy.py

- name: Build ex-gwf-twri example model
if: inputs.full != true
working-directory: modflow6-examples/scripts
run: python ex-gwf-twri.py

- name: Build example models
if: inputs.full == true
Expand Down Expand Up @@ -365,7 +356,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
run: |
mkdir -p "${{ needs.build.outputs.distname }}/doc"
cmd="python modflow6/distribution/build_docs.py -b bin -o doc -e modflow6-examples"
cmd="python modflow6/distribution/build_docs.py -b bin -o doc"
if [[ "${{ inputs.full }}" == "true" ]]; then
cmd="$cmd --full"
fi
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: If you use this software, please cite the software itself.
type: software
title: MODFLOW 6 Modular Hydrologic Model
version: 6.4.2+
date-released: '2023-06-29'
version: 6.5.0.dev0
date-released: '2023-07-13'
doi: 10.5066/F76Q1VQV
abstract: MODFLOW 6 is an object-oriented program and framework developed to provide
a platform for supporting multiple models and multiple types of models within the
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

This is the development repository for the USGS MODFLOW 6 Hydrologic Model. The official USGS distribution is available at [USGS Release Page](https://water.usgs.gov/ogw/modflow/MODFLOW.html).

### Version 6.4.2+ (preliminary)
### Version 6.5.0.dev0 (preliminary)

[![GitHub release](https://img.shields.io/github/release/MODFLOW-USGS/modflow6.svg)](https://github.com/MODFLOW-USGS/modflow6/releases/latest)
[![MODFLOW 6 continuous integration](https://github.com/MODFLOW-USGS/modflow6/actions/workflows/ci.yml/badge.svg)](https://github.com/MODFLOW-USGS/modflow6/actions/workflows/ci.yml)
Expand Down
12 changes: 2 additions & 10 deletions autotest/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import re
import subprocess

from conftest import project_root_path

bin_path = project_root_path / "bin"


def split_nonnumeric(s):
match = re.compile("[^0-9]").search(s)
return [s[:match.start()], s[match.start():]] if match else s


def test_cli_version():
output = " ".join(
subprocess.check_output([str(bin_path / "mf6"), "-v"]).decode().split()
Expand All @@ -23,7 +17,5 @@ def test_cli_version():
)
print(version)
v_split = version.split(".")
assert len(v_split) == 3
assert all(s.isdigit() for s in v_split[:2])
sol = split_nonnumeric(v_split[2])
assert sol[0].isdigit()
assert len(v_split) >= 2
assert all(s[-1].isdigit() for s in v_split[:2])
4 changes: 2 additions & 2 deletions code.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"email": "[email protected]"
},
"laborHours": -1,
"version": "6.4.2+",
"version": "6.5.0.dev0",
"date": {
"metadataLastUpdated": "2023-06-29"
"metadataLastUpdated": "2023-07-13"
},
"organization": "U.S. Geological Survey",
"permissions": {
Expand Down
64 changes: 6 additions & 58 deletions distribution/build_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import shutil
import sys
import textwrap
from collections import namedtuple
from os import PathLike, environ
from pathlib import Path
from pprint import pprint
Expand All @@ -17,56 +16,16 @@
from modflow_devtools.misc import get_model_paths

from build_docs import build_documentation
from build_makefiles import (
build_mf6_makefile,
build_mf5to6_makefile,
build_zbud6_makefile,
)
from build_makefiles import (build_mf5to6_makefile, build_mf6_makefile,
build_zbud6_makefile)
from utils import get_project_root_path, run_command

_project_name = "MODFLOW 6"

# default paths
_project_root_path = get_project_root_path()
_version_texf_path = _project_root_path / "doc" / "version.tex"
_examples_repo_path = _project_root_path.parent / "modflow6-examples"
_examples_path = _examples_repo_path / "examples"
_build_path = _project_root_path / "builddir"
_bin_path = _project_root_path / "bin"
_docs_path = _project_root_path / "doc"
_benchmarks_path = _project_root_path / "distribution" / ".benchmarks"

# top-level directories included in distribution
_included_dir_paths = [
"bin",
"doc",
"examples",
"src",
"srcbmi",
"msvs",
"make",
"utils",
]

Makefile = namedtuple("Makefile", ["app", "src_path", "out_path"])


# makefiles included in distribution
_makefiles = [
Makefile(app="mf6", src_path=_project_root_path / "src", out_path=Path("make")),
Makefile(
app="zbud6",
src_path=_project_root_path / "utils" / "zonebudget" / "src",
out_path=Path("utils") / "zonebudget" / "make",
),
Makefile(
app="mf5to6",
src_path=_project_root_path / "utils" / "mf5to6" / "src",
out_path=Path("utils") / "mf5to6" / "make",
),
]

# system-specific filenames, extensions, etc

# OS-specific extensions
_system = platform.system()
_eext = ".exe" if _system == "Windows" else ""
_soext = ".dll" if _system == "Windows" else ".so" if _system == "Linux" else ".dylib"
Expand Down Expand Up @@ -99,8 +58,9 @@ def copy_sources(output_path: PathLike):

ignored = shutil.ignore_patterns(".DS_Store")

# copy top-level meson.build
# copy top-level meson.build and meson.options
shutil.copy(_project_root_path / "meson.build", output_path)
shutil.copy(_project_root_path / "meson.options", output_path)

# copy source folder
src_path = _project_root_path / "src"
Expand Down Expand Up @@ -232,10 +192,6 @@ def setup_examples(
print(f"Execute permission set for {script_path}")


def test_setup_examples():
pass


def build_programs_meson(
build_path: PathLike, bin_path: PathLike, overwrite: bool = False
):
Expand Down Expand Up @@ -446,13 +402,6 @@ def test_build_distribution(tmp_path, full):
default=str(_examples_repo_path),
help="Path to directory containing modflow6 example models",
)
# parser.add_argument(
# "-b",
# "--benchmarks-path",
# required=False,
# default=str(_project_root_path / "distribution" / ".benchmarks"),
# help="Path to directory containing benchmark results"
# )
parser.add_argument(
"--full",
required=False,
Expand All @@ -469,7 +418,6 @@ def test_build_distribution(tmp_path, full):
help="Recreate and overwrite existing artifacts",
)
args = parser.parse_args()

build_path = Path(args.build_path)
out_path = Path(args.output_path)
examples_repo_path = (
Expand Down
Loading

0 comments on commit 697b889

Please sign in to comment.