diff --git a/pyproject.toml b/pyproject.toml
index 85c9183b30e..fa89e3c7a8a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -30,22 +30,6 @@ dependencies = ["numpy>=1.24", "packaging>=23.2", "pandas>=2.1"]
 [project.optional-dependencies]
 accel = ["scipy", "bottleneck", "numbagg", "numba>=0.54", "flox", "opt_einsum"]
 complete = ["xarray[accel,etc,io,parallel,viz]"]
-dev = [
-  "hypothesis",
-  "jinja2",
-  "mypy",
-  "pre-commit",
-  "pytest",
-  "pytest-cov",
-  "pytest-env",
-  "pytest-mypy-plugins",
-  "pytest-timeout",
-  "pytest-xdist",
-  "ruff>=0.8.0",
-  "sphinx",
-  "sphinx_autosummary_accessors",
-  "xarray[complete,types]",
-]
 io = [
   "netCDF4",
   "h5netcdf",
@@ -76,6 +60,25 @@ types = [
   "types-setuptools",
 ]
 
+[dependency-groups]
+dev = [
+  "hypothesis",
+  "jinja2",
+  "mypy",
+  "pre-commit",
+  "pytest",
+  "pytest-cov",
+  "pytest-env",
+  "pytest-mypy-plugins",
+  "pytest-timeout",
+  "pytest-xdist",
+  "ruff>=0.8.0",
+  "sphinx",
+  "sphinx_autosummary_accessors",
+  "xarray[complete,types]",
+
+]
+
 [project.urls]
 Documentation = "https://docs.xarray.dev"
 SciPy2015-talk = "https://www.youtube.com/watch?v=X0pAhJgySxk"