From a9660c67a2f569ab618217552adcb4bb120b93de Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Sat, 15 Aug 2026 21:10:09 +1200 Subject: [PATCH 1/2] chore: remove optional dependencies used for internal development --- .github/workflows/release.yml | 4 +- DEVELOPER.md | 11 +++-- README.md | 2 +- docs/md/install.md | 11 +++-- pyproject.toml | 81 +++-------------------------------- 5 files changed, 25 insertions(+), 84 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7484199..e71d9d50 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,9 +35,7 @@ jobs: - name: Install Python dependencies run: | pip install --upgrade pip - pip install build twine - pip install . - pip install ".[lint, test]" + pip install . --group test --group build twine - name: Update version id: version diff --git a/DEVELOPER.md b/DEVELOPER.md index 8d91d627..858c098d 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -23,11 +23,16 @@ Python3.11+. This project has historically aimed to support several recent versi ## Installation -To get started, first fork and clone this repository. Then install the project and core packages as well as linting and testing dependencies: +To get started, first fork and clone this repository. Then install the project in "editable" mode, along with all of the dependencies needed for running and development: ```shell -pip install . -pip install ".[lint, test]" +pip install -e . --group dev +``` + +Developers that use a `uv` environment can "sync" the project to install the project with all dependencies: + +```shell +uv sync ``` ## Testing diff --git a/README.md b/README.md index f8479851..b69551cd 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ pip install modflow-devtools To install an optional dependency group: ```shell -pip install "modflow-devtools[test]" +pip install "modflow-devtools[ecosystem]" ``` To install from source and set up a development environment please see the [developer documentation](DEVELOPER.md). diff --git a/docs/md/install.md b/docs/md/install.md index bb169b6d..0da9702c 100644 --- a/docs/md/install.md +++ b/docs/md/install.md @@ -8,6 +8,12 @@ Packages are [available on PyPi](https://pypi.org/project/modflow-devtools/) and pip install modflow-devtools ``` +Optional dependencies required for some features can also be installed with the "ecosystem" extra: + +```shell +pip install modflow-devtools[ecosystem] +``` + ## Installing `modflow-devtools` from source To set up a `modflow-devtools` development environment, first clone the repository: @@ -16,11 +22,10 @@ To set up a `modflow-devtools` development environment, first clone the reposito git clone https://github.com/MODFLOW-ORG/modflow-devtools.git ``` -Then install the local copy as well as testing, linting, and docs dependencies: +Then install the local copy in "editable" mode, as well as dependencies needed for testing, linting, and build docs: ``` -pip install . -pip install ".[lint, test, docs]" +pip install -e . --group dev ``` ## Using `modflow-devtools` as a `pytest` plugin diff --git a/pyproject.toml b/pyproject.toml index 121b402a..175660fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,47 +39,7 @@ requires-python = ">=3.11" dynamic = ["version"] [project.optional-dependencies] -build = [ - "build", - "twine" -] -lint = [ - "codespell[toml]", - "ruff", - "mypy" -] -test = [ - "modflow-devtools[lint]", - "coverage", - "flaky", - "filelock", - "meson!=0.63.0", - "ninja", - "numpy", - "pandas", - "pytest!=8.1.0", - "pytest-cov", - "pytest-dotenv", - "pytest-xdist", - "PyYaml", - "syrupy <5.0.0" -] -docs = [ - "sphinx", - "sphinx-rtd-theme", - "myst-parser" -] -# deprecated -dfn = [ - "boltons", - "pooch", - "pyaml", - "pydantic", - "tomli", - "tomli-w" -] -# deprecated -models = [ +ecosystem = [ "boltons", "filelock", "pooch", @@ -88,9 +48,9 @@ models = [ "tomli", "tomli-w" ] -# prefer ecosystem to dfn/models separately -ecosystem = ["modflow-devtools[dfn,models]"] -dev = ["modflow-devtools[lint,test,docs,dfn,models]"] +# deprecated - prefer "ecosystem" to "dfn"/"models" separately +dfn = ["modflow-devtools[ecosystem]"] +models = ["modflow-devtools[ecosystem]"] [dependency-groups] build = [ @@ -103,10 +63,8 @@ lint = [ "mypy", ] test = [ - "modflow-devtools[lint]", "coverage", "flaky", - "filelock", "meson!=0.63.0", "ninja", "numpy", @@ -116,44 +74,19 @@ test = [ "pytest-dotenv", "pytest-xdist", "PyYaml", - "syrupy <5.0.0" + "syrupy <5.0.0", + {include-group = "lint"}, ] docs = [ "sphinx", "sphinx-rtd-theme", "myst-parser" ] -# deprecated -dfn = [ - "boltons", - "pooch", - "pyaml", - "pydantic", - "tomli", - "tomli-w" -] -# deprecated -models = [ - "boltons", - "filelock", - "pooch", - "pyaml", - "pydantic", - "tomli", - "tomli-w" -] -# prefer ecosystem to dfn/models separately -ecosystem = [ - {include-group = "dfn"}, - {include-group = "models"}, -] dev = [ + "modflow-devtools[ecosystem]", # self-reference to project.optional-dependencies {include-group = "build"}, {include-group = "lint"}, {include-group = "test"}, - {include-group = "docs"}, - {include-group = "dfn"}, - {include-group = "models"}, ] [project.urls] From d75a67a17974ef720ba6f7a638843e24bd8e5273 Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Tue, 18 Aug 2026 11:29:05 +1200 Subject: [PATCH 2/2] Add a "pytest" optional dependency, re-add "test" as a deprecated alias --- README.md | 8 ++++---- docs/md/install.md | 11 ++++++++--- pyproject.toml | 11 ++++++++++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b69551cd..3e0516c3 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,10 @@ Python development tools for MODFLOW 6 and related projects. Python3.11+, dependency-free by default. -Two main dependency groups are available, oriented around specific use cases: +Two optional dependencies are available, oriented around specific use cases: -- `test`: pytest fixtures, markers, and extensions - `ecosystem`: program/model management, definition file utilities +- `pytest`: pytest fixtures, markers, and extensions ## Installation @@ -56,10 +56,10 @@ Two main dependency groups are available, oriented around specific use cases: pip install modflow-devtools ``` -To install an optional dependency group: +To install the optional dependencies (choose one or more): ```shell -pip install "modflow-devtools[ecosystem]" +pip install "modflow-devtools[ecosystem,pytest]" ``` To install from source and set up a development environment please see the [developer documentation](DEVELOPER.md). diff --git a/docs/md/install.md b/docs/md/install.md index 0da9702c..9259c875 100644 --- a/docs/md/install.md +++ b/docs/md/install.md @@ -8,10 +8,15 @@ Packages are [available on PyPi](https://pypi.org/project/modflow-devtools/) and pip install modflow-devtools ``` -Optional dependencies required for some features can also be installed with the "ecosystem" extra: +Two optional dependencies are available, oriented around specific use cases: + +- `ecosystem`: program/model management, definition file utilities +- `pytest`: pytest fixtures, markers, and extensions + +To install the optional dependencies (choose one or more): ```shell -pip install modflow-devtools[ecosystem] +pip install modflow-devtools[ecosystem,pytest] ``` ## Installing `modflow-devtools` from source @@ -24,7 +29,7 @@ git clone https://github.com/MODFLOW-ORG/modflow-devtools.git Then install the local copy in "editable" mode, as well as dependencies needed for testing, linting, and build docs: -``` +```shell pip install -e . --group dev ``` diff --git a/pyproject.toml b/pyproject.toml index 175660fe..f632574a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,9 +48,17 @@ ecosystem = [ "tomli", "tomli-w" ] +pytest = [ + "numpy", + "pytest!=8.1.0", + "syrupy <5.0.0", +] +# optional dependencies listed below are deprecated, to be removed in version 2.x # deprecated - prefer "ecosystem" to "dfn"/"models" separately dfn = ["modflow-devtools[ecosystem]"] models = ["modflow-devtools[ecosystem]"] +# deprecated - prefer "pytest" to "test" (to be kept only as a dependency-group) +test = ["modflow-devtools[pytest]"] [dependency-groups] build = [ @@ -63,6 +71,7 @@ lint = [ "mypy", ] test = [ + "modflow-devtools[ecosystem,pytest]", # self-reference to project.optional-dependencies "coverage", "flaky", "meson!=0.63.0", @@ -83,7 +92,7 @@ docs = [ "myst-parser" ] dev = [ - "modflow-devtools[ecosystem]", # self-reference to project.optional-dependencies + "modflow-devtools[ecosystem,pytest]", # self-reference to project.optional-dependencies {include-group = "build"}, {include-group = "lint"}, {include-group = "test"},