Skip to content

Commit 9e611df

Browse files
github-actions[bot]wpbonellijdhughes-devmwtoewsmjreno
authored
Release 1.3.0 (#204)
* ci(release): update version to 1.2.11.dev0 * ci: fix schedule for windows (#193) * fix(requests): update available assets (#194) Add macarm.zip asset * chore: reformat Python code with line length = 88 (#198) Reformat the code with a maximum line length of 88 characters to better represent the code. See modflowpy/flopy#2362 for a related PR with rational and discussion. Also change some of Ruff's configuration: - Remove target-version, since it is automatically evaluated from pyproject.toml - Remove include so that Ruff will work globally in this repo * fix: cleanup _get_optlevel verbose param in pymake_base (#199) Co-authored-by: mjreno <[email protected]> * refactor: clean-up strings and Path related aspects, add a few Ruff rules (#200) Refactor a few semi-related aspects: - Revise strings and whitespace using a few methods with Ruff and manual edits - Revise a few aspects of pathlib.Path -- these changes are added here to shorten some string formatting, but remain consistent throughout the code base - Fix one more instance of removed verbose parameter in _get_optlevel(), similar to #199 - Apply Ruff pyupgrade (UP) rules - Apply Ruff section-underline-matches-section-length (D409) rule - Apply Ruff-specific rules (RUF) * build(deps): bump dawidd6/action-download-artifact from 6 to 7 (#201) * update for mf6.6.0 (#203) * fix fortran submodule evaluation * update sutra and mfusg_gsi versions. * update pixi version * ci(release): set version to 1.3.0 --------- Co-authored-by: wpbonelli <[email protected]> Co-authored-by: jdhughes-usgs <[email protected]> Co-authored-by: Mike Taves <[email protected]> Co-authored-by: mjreno <[email protected]> Co-authored-by: mjreno <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 516b61e commit 9e611df

38 files changed

+6653
-6485
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ jobs:
2727
matrix:
2828
include:
2929
# test latest gcc and python
30-
- {os: ubuntu-latest, FC: gcc, FC_V: 13}
31-
- {os: macos-latest, FC: gcc, FC_V: 13}
32-
- {os: windows-latest, FC: gcc, FC_V: 13}
30+
- {os: ubuntu-latest, FC: gcc, FC_V: 13, shell: bash}
31+
- {os: macos-latest, FC: gcc, FC_V: 13, shell: bash}
32+
- {os: windows-latest, FC: gcc, FC_V: 13, shell: pwsh}
3333
# test latest python and intel-classic
34-
- {os: ubuntu-latest, FC: intel-classic, FC_V: 2021.7}
35-
- {os: macos-13, FC: intel-classic, FC_V: 2021.7}
36-
- {os: windows-2019, FC: intel-classic, FC_V: 2021.7}
34+
- {os: ubuntu-latest, FC: intel-classic, FC_V: 2021.7, shell: bash}
35+
- {os: macos-13, FC: intel-classic, FC_V: 2021.7, shell: bash}
36+
- {os: windows-2019, FC: intel-classic, FC_V: 2021.7, shell: pwsh}
3737
# test latest python and previous gcc
38-
- {os: ubuntu-latest, FC: gcc, FC_V: 12}
39-
- {os: ubuntu-latest, FC: gcc, FC_V: 11}
38+
- {os: ubuntu-latest, FC: gcc, FC_V: 12, shell: bash}
39+
- {os: ubuntu-latest, FC: gcc, FC_V: 11, shell: bash}
4040
defaults:
4141
run:
42-
shell: bash
42+
shell: ${{ matrix.shell }}
4343

4444
steps:
4545
- name: Checkout repo
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup pixi
5858
uses: prefix-dev/[email protected]
5959
with:
60-
pixi-version: v0.19.1
60+
pixi-version: v0.34.0
6161
manifest-path: "pixi.toml"
6262

6363
- name: pixi post-install
@@ -91,7 +91,6 @@ jobs:
9191
9292
- name: test on Windows
9393
if: runner.os == 'Windows'
94-
shell: pwsh
9594
run: |
9695
pixi run autotest-base
9796
@@ -122,16 +121,16 @@ jobs:
122121
matrix:
123122
include:
124123
# test latest gcc and python
125-
- {os: ubuntu-latest, FC: gcc, FC_V: 13}
126-
- {os: macos-latest, FC: gcc, FC_V: 13}
127-
- {os: windows-latest, FC: gcc, FC_V: 13}
124+
- {os: ubuntu-latest, FC: gcc, FC_V: 13, shell: bash}
125+
- {os: macos-latest, FC: gcc, FC_V: 13, shell: bash}
126+
- {os: windows-latest, FC: gcc, FC_V: 13, shell: pwsh}
128127
# test latest python and intel
129-
- {os: ubuntu-latest, FC: intel-classic, FC_V: 2021.7}
130-
- {os: macos-13, FC: intel-classic, FC_V: 2021.7}
131-
- {os: windows-2019, FC: intel-classic, FC_V: 2021.7}
128+
- {os: ubuntu-latest, FC: intel-classic, FC_V: 2021.7, shell: bash}
129+
- {os: macos-13, FC: intel-classic, FC_V: 2021.7, shell: bash}
130+
- {os: windows-2019, FC: intel-classic, FC_V: 2021.7, shell: pwsh}
132131
defaults:
133132
run:
134-
shell: bash
133+
shell: ${{ matrix.shell }}
135134

136135
steps:
137136
- name: Checkout repo
@@ -149,7 +148,7 @@ jobs:
149148
- name: Setup pixi
150149
uses: prefix-dev/[email protected]
151150
with:
152-
pixi-version: v0.19.1
151+
pixi-version: v0.34.0
153152
manifest-path: "pixi.toml"
154153

155154
- name: pixi post-install
@@ -170,13 +169,13 @@ jobs:
170169
- name: Run scheduled tests
171170
run: |
172171
pixi run autotest-schedule
173-
172+
174173
- name: Upload failed test output
175174
if: failure()
176175
uses: actions/upload-artifact@v4
177176
with:
178177
name: failed-schedule-${{ matrix.os }}-${{ matrix.FC }}-${{ matrix.FC_V }}
179-
path: ./autotest/.failed
178+
path: autotest/.failed
180179

181180
- name: Print coverage report before upload
182181
run: |

.github/workflows/pymake-linting-install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup pixi
2727
uses: prefix-dev/[email protected]
2828
with:
29-
pixi-version: v0.19.1
29+
pixi-version: v0.34.0
3030
manifest-path: "pixi.toml"
3131

3232
- name: Lint

.github/workflows/pymake-requests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Setup pixi
3434
uses: prefix-dev/[email protected]
3535
with:
36-
pixi-version: v0.19.1
36+
pixi-version: v0.34.0
3737
manifest-path: "pixi.toml"
3838

3939
- name: pixi post-install

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
pip install ".[test]"
121121
122122
- name: Download artifacts
123-
uses: dawidd6/action-download-artifact@v6
123+
uses: dawidd6/action-download-artifact@v7
124124

125125
- name: Draft release
126126
env:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Python package for building MODFLOW-based programs from source files.
44

5-
### Version 1.2.10
5+
### Version 1.3.0
66

77
[![PyPI Version](https://img.shields.io/pypi/v/mfpymake.png)](https://pypi.python.org/pypi/mfpymake)
88
[![Anaconda Version](https://anaconda.org/conda-forge/mfpymake/badges/version.svg)](https://anaconda.org/conda-forge/mfpymake)

autotest/ci_setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import os
2-
import pathlib as pl
32
import shutil
3+
from pathlib import Path
44

55
from modflow_devtools.misc import get_model_paths
66

77
import pymake
88

9-
temp_pth = pl.Path("temp")
10-
if not temp_pth.exists():
11-
temp_pth.mkdir()
9+
temp_pth = Path("temp")
10+
temp_pth.mkdir(exist_ok=True)
1211
mf6_exdir = temp_pth / "mf6examples"
1312
if mf6_exdir.is_dir():
1413
shutil.rmtree(mf6_exdir)

autotest/test_build.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,7 @@ def test_build(function_tmpdir, target: str) -> None:
6161
pm.inplace = True
6262
fc = os.environ.get("FC", "gfortran")
6363
assert (
64-
pymake.build_apps(
65-
target,
66-
pm,
67-
verbose=True,
68-
clean=False,
69-
)
70-
== 0
64+
pymake.build_apps(target, pm, verbose=True, clean=False) == 0
7165
), f"could not compile {target}"
7266

7367

@@ -80,13 +74,7 @@ def test_meson_build(function_tmpdir, target: str) -> None:
8074
pymake.linker_update_environment(cc=cc, fc=fc)
8175
with set_dir(function_tmpdir):
8276
assert (
83-
pymake.build_apps(
84-
target,
85-
verbose=True,
86-
clean=False,
87-
meson=True,
88-
)
89-
== 0
77+
pymake.build_apps(target, verbose=True, clean=False, meson=True) == 0
9078
), f"could not compile {target}"
9179

9280

autotest/test_cli_cmds.py

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import os
2-
import pathlib as pl
32
import subprocess
3+
from pathlib import Path
44
from platform import system
5+
from textwrap import dedent
56

67
import pytest
78
from flaky import flaky
@@ -47,13 +48,7 @@ def run_cli_cmd(cmd: list) -> None:
4748
@pytest.mark.parametrize("target", targets)
4849
def test_make_program(function_tmpdir, target: str) -> None:
4950
with set_dir(function_tmpdir):
50-
cmd = [
51-
"make-program",
52-
target,
53-
"--appdir",
54-
str(function_tmpdir),
55-
"--verbose",
56-
]
51+
cmd = ["make-program", target, "--appdir", ".", "--verbose"]
5752
run_cli_cmd(cmd)
5853

5954

@@ -62,28 +57,15 @@ def test_make_program(function_tmpdir, target: str) -> None:
6257
@pytest.mark.base
6358
def test_make_program_double(function_tmpdir) -> None:
6459
with set_dir(function_tmpdir):
65-
cmd = [
66-
"make-program",
67-
"mf2005",
68-
"--double",
69-
"--verbose",
70-
"--appdir",
71-
str(function_tmpdir),
72-
]
60+
cmd = ["make-program", "mf2005", "--double", "--verbose", "--appdir", "."]
7361
run_cli_cmd(cmd)
7462

7563

7664
@pytest.mark.dependency(name="make_program_all")
7765
@pytest.mark.schedule
7866
def test_make_program_all(module_tmpdir) -> None:
7967
with set_dir(module_tmpdir):
80-
cmd = [
81-
"make-program",
82-
":",
83-
"--appdir",
84-
str(module_tmpdir / "all"),
85-
"--verbose",
86-
]
68+
cmd = ["make-program", ":", "--appdir", ".", "--verbose"]
8769
run_cli_cmd(cmd)
8870

8971

@@ -93,13 +75,13 @@ def test_make_program_all(module_tmpdir) -> None:
9375
@pytest.mark.parametrize("meson", meson_parm)
9476
def test_mfpymake(function_tmpdir, meson: bool) -> None:
9577
with set_dir(function_tmpdir):
96-
src = (
97-
"program hello\n"
98-
+ " ! This is a comment line; it is ignored by the compiler\n"
99-
+ " print *, 'Hello, World!'\n"
100-
+ "end program hello\n"
101-
)
102-
src_file = pl.Path("src/hello.f90")
78+
src = dedent("""\
79+
program hello
80+
! This is a comment line; it is ignored by the compiler
81+
print *, 'Hello, World!'
82+
end program hello
83+
""")
84+
src_file = Path("src/hello.f90")
10385
src_file.parent.mkdir(parents=True, exist_ok=True)
10486
with open(src_file, "w") as f:
10587
f.write(src)

autotest/test_gridgen.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import pathlib as pl
21
import subprocess
32
from os import environ
3+
from pathlib import Path
44
from platform import system
55

66
import pytest
@@ -11,7 +11,7 @@
1111

1212

1313
@pytest.fixture(scope="module")
14-
def target(module_tmpdir) -> pl.Path:
14+
def target(module_tmpdir) -> Path:
1515
name = TARGET_NAME
1616
ext = ".exe" if system() == "Windows" else ""
1717
return module_tmpdir / f"{name}{ext}"
@@ -23,7 +23,7 @@ def prog_data(target) -> dict:
2323

2424

2525
@pytest.fixture(scope="module")
26-
def workspace(module_tmpdir, prog_data) -> pl.Path:
26+
def workspace(module_tmpdir, prog_data) -> Path:
2727
return module_tmpdir / prog_data.dirname
2828

2929

@@ -42,11 +42,7 @@ def pm(module_tmpdir, target) -> pymake.Pymake:
4242

4343
def run_command(args, cwd):
4444
p = subprocess.Popen(
45-
args,
46-
shell=False,
47-
stdout=subprocess.PIPE,
48-
stderr=subprocess.STDOUT,
49-
cwd=cwd,
45+
args, shell=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=cwd
5046
)
5147
for line in p.stdout.readlines():
5248
print(line.decode().strip())

autotest/test_mf2005.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,5 @@ def test_mf2005(namefile, workspace, target):
9191
if not (example_ws / namefile).is_file():
9292
pytest.skip(f"{namefile} does not exist")
9393

94-
success, _ = flopy.run_model(
95-
target, namefile, model_ws=example_ws, silent=False
96-
)
94+
success, _ = flopy.run_model(target, namefile, model_ws=example_ws, silent=False)
9795
assert success, f"could not run {namefile} with {target}"

0 commit comments

Comments
 (0)