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..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[test]" +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 bb169b6d..9259c875 100644 --- a/docs/md/install.md +++ b/docs/md/install.md @@ -8,6 +8,17 @@ Packages are [available on PyPi](https://pypi.org/project/modflow-devtools/) and pip install modflow-devtools ``` +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,pytest] +``` + ## Installing `modflow-devtools` from source To set up a `modflow-devtools` development environment, first clone the repository: @@ -16,11 +27,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]" +```shell +pip install -e . --group dev ``` ## Using `modflow-devtools` as a `pytest` plugin diff --git a/pyproject.toml b/pyproject.toml index 121b402a..f632574a 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,17 @@ models = [ "tomli", "tomli-w" ] -# prefer ecosystem to dfn/models separately -ecosystem = ["modflow-devtools[dfn,models]"] -dev = ["modflow-devtools[lint,test,docs,dfn,models]"] +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 = [ @@ -103,10 +71,9 @@ lint = [ "mypy", ] test = [ - "modflow-devtools[lint]", + "modflow-devtools[ecosystem,pytest]", # self-reference to project.optional-dependencies "coverage", "flaky", - "filelock", "meson!=0.63.0", "ninja", "numpy", @@ -116,44 +83,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,pytest]", # 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]