diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ce00f0..eba6ca8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,17 +33,13 @@ jobs: arch: aarch64 - os: windows-2022 arch: AMD64 - - os: macos-13 - arch: x86_64 - macosx_deployment_target: "13.0" - cmake_osx_architectures: x86_64 - os: macos-14 arch: arm64 macosx_deployment_target: "14.0" cmake_osx_architectures: arm64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up QEMU if: runner.os == 'Linux' && matrix.arch == 'aarch64' @@ -55,7 +51,7 @@ jobs: if: runner.os == 'Windows' uses: msys2/setup-msys2@v2 with: - msystem: MINGW64 + msystem: mingw64 path-type: inherit install: >- mingw-w64-x86_64-gcc-fortran @@ -71,7 +67,7 @@ jobs: run: bash scripts/build_lib.sh - name: Build wheels - uses: pypa/cibuildwheel@v2.22.0 + uses: pypa/cibuildwheel@v3.2.1 env: CIBW_ARCHS: ${{ matrix.arch }} CIBW_ENVIRONMENT_MACOS: @@ -79,7 +75,7 @@ jobs: MACOSX_DEPLOYMENT_TARGET='${{ matrix.macosx_deployment_target }}' CMAKE_OSX_ARCHITECTURES='${{ matrix.cmake_osx_architectures }}' - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 with: name: cibw-wheels-${{ matrix.os }}-${{ matrix.arch }} path: ./wheelhouse/*.whl @@ -88,12 +84,12 @@ jobs: name: Build source distribution runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Build sdist run: pipx run build --sdist - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 with: name: cibw-sdist path: dist/*.tar.gz @@ -108,7 +104,7 @@ jobs: # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v6 with: # unpacks all CIBW artifacts into dist/ pattern: cibw-* diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fd211b7..f8be6f4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,21 +15,22 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.9", "3.13"] # run lower and upper versions + python-version: ["3.10", "3.14"] # run lower and upper versions steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Setup Python ${{ matrix.python-version }} - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v7 with: python-version: ${{ matrix.python-version }} + activate-environment: "true" - name: Install MinGW-w64 tools (Windows) if: runner.os == 'Windows' uses: msys2/setup-msys2@v2 with: - msystem: MINGW64 + msystem: mingw64 path-type: inherit install: >- mingw-w64-x86_64-gcc-fortran diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0189f88..b6ca9e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,14 +3,14 @@ ci: exclude: \.grb$ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-yaml - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.3 + rev: v0.14.10 hooks: - # Run the linter. - - id: ruff + # Run the linter + - id: ruff-check args: [ --fix ] - # Run the formatter. + # Run the formatter - id: ruff-format diff --git a/BUILD.md b/BUILD.md index 7c1fe1d..39a2473 100644 --- a/BUILD.md +++ b/BUILD.md @@ -26,6 +26,7 @@ Or manually with these steps: ```bash meson setup builddir # options meson compile -C builddir +meson install -C builddir ``` After it is compiled, install to the Python module using: diff --git a/etc/environment.yml b/etc/environment.yml index c364160..c6c351f 100644 --- a/etc/environment.yml +++ b/etc/environment.yml @@ -3,7 +3,7 @@ name: pypestutils channels: - conda-forge - - defaults + - nodefaults dependencies: - appdirs diff --git a/examples/exploring_lowlevel_pypestutils_functions.ipynb b/examples/exploring_lowlevel_pypestutils_functions.ipynb index 05d2a63..c15decc 100644 --- a/examples/exploring_lowlevel_pypestutils_functions.ipynb +++ b/examples/exploring_lowlevel_pypestutils_functions.ipynb @@ -446,9 +446,9 @@ "metadata": {}, "outputs": [], "source": [ - "usite = hdsdf.site.unique()\n", + "usite = hdsdf.site.unique().tolist()\n", "usite.sort()\n", - "usite_dict = {s: c for s, c in zip(usite, np.arange(usite.shape[0], dtype=int))}\n", + "usite_dict = {s: c for s, c in zip(usite, np.arange(len(usite), dtype=int))}\n", "hdsdf.loc[:, \"isite\"] = hdsdf.site.apply(lambda x: usite_dict[x])\n", "hdsdf.isite\n", "hdsdf.sort_values(by=[\"isite\", \"time\"], inplace=True)\n", diff --git a/pypestutils/helpers.py b/pypestutils/helpers.py index ea1e9f4..668fd9e 100644 --- a/pypestutils/helpers.py +++ b/pypestutils/helpers.py @@ -167,9 +167,9 @@ def mod2obs_mf6( print("WARNING: replacing existing 'totim' column in observation dataframe") obsdf.loc[:, "totim"] = obsdf.datetime.apply(lambda x: x - start_datetime).dt.days - usite = obsdf.site.unique() + usite = obsdf.site.unique().tolist() usite.sort() - usite_dict = {s: c for s, c in zip(usite, np.arange(usite.shape[0], dtype=int))} + usite_dict = {s: c for s, c in zip(usite, np.arange(len(usite), dtype=int))} obsdf.loc[:, "isite"] = obsdf.site.apply(lambda x: usite_dict[x]) obsdf.sort_values(by=["isite", "totim"], inplace=True) diff --git a/pypestutils/version.py b/pypestutils/version.py index d1ceb79..7ee132c 100644 --- a/pypestutils/version.py +++ b/pypestutils/version.py @@ -1,4 +1,4 @@ """Package version.""" # This is the only place to update version -__version__ = "0.3.0" +__version__ = "0.3.1.dev0" diff --git a/pyproject.toml b/pyproject.toml index 3138831..ea80e58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,25 +12,24 @@ authors = [ readme = "README.md" description = "PEST utilities for MODFLOW" keywords = ["PEST", "MODFLOW", "groundwater", "model"] -license = {text = "Unlicense"} +license = "Unlicense" classifiers = [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Science/Research", - "License :: OSI Approved :: The Unlicense (Unlicense)", "Operating System :: Unix", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Programming Language :: Fortran", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Scientific/Engineering :: Hydrology", ] -requires-python = ">=3.9" +requires-python = ">=3.10" dependencies = [ "numpy", "pandas", @@ -59,7 +58,7 @@ version = {attr = "pypestutils.version.__version__"} include = ["pypestutils", "pypestutils.*"] [tool.cibuildwheel] -build = "cp39-*" +build = "cp310-*" build-verbosity = 3 repair-wheel-command = "python scripts/repair_wheel.py -w {dest_dir} {wheel}" test-requires = "tox" diff --git a/scripts/build_lib.sh b/scripts/build_lib.sh index d364245..8c18257 100755 --- a/scripts/build_lib.sh +++ b/scripts/build_lib.sh @@ -4,11 +4,14 @@ set -e # always run from top of repo cd $(dirname $0)/.. + +echo "Running $0 for \$OSTYPE=$OSTYPE ..." + # this needs bash case "$OSTYPE" in - darwin*) libname=lib/libpestutils.dylib ;; + darwin*) libname=lib/libpestutils.dylib && export LDFLAGS="$LDFLAGS -Wl,-ld_classic";; linux*) libname=lib/libpestutils.so ;; - msys* ) libname=bin/pestutils.dll ;; + msys*|cygwin ) libname=bin/pestutils.dll ;; *) echo "unknown \$OSTYPE: $OSTYPE" && exit 1 ;; esac diff --git a/tox.ini b/tox.ini index cf671ab..3986d54 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] requires = tox>=4 -env_list = py{39,310,311,312,313} +env_list = py{310,311,312,313,314} [testenv] description = run unit tests