From 82d6ab24b5d1efa3523edfd581bdb4b7a79b1aa1 Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Sun, 1 Sep 2024 19:41:14 +0200 Subject: [PATCH 1/2] Reduce core dependencies, split in optional dependencies --- README.md | 11 +++++++++++ pyproject.toml | 29 +++++++++++++++++++---------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d7dd0faf206..062dd44500e 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,17 @@ To install our latest pre-release (3.0.0 alpha), run: ``` bash pip install -U --pre mesa ``` +With Mesa 3.0, we don't install all our dependencies anymore by default. +```bash +# You can customize the additional dependencies you need, if you want. Available are: +pip install -U --pre mesa[network,viz] + +# This is equivalent to our recommended dependencies: +pip install -U --pre mesa[rec] + +# To install all, including developer, dependencies: +pip install -U --pre mesa[all] +``` You can also use `pip` to install the latest GitHub version: diff --git a/pyproject.toml b/pyproject.toml index edee30d161d..c1256833966 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,28 +36,37 @@ classifiers = [ ] readme = "README.md" dependencies = [ - "click", - "cookiecutter", - "matplotlib", - "networkx", "numpy", "pandas", - "solara", "tqdm", ] dynamic = ["version"] [project.optional-dependencies] +# User collections +rec = ["mesa[network,viz]"] +all = ["mesa[network,viz,dev,examples,docs]"] +# Core dependencies +network = [ + "networkx", +] +viz = [ + "matplotlib", + "solara", +] +# Dev and CI stuff dev = [ - "ruff~=0.1.1", # Update periodically - "pytest >= 4.6", + "mesa[rec]", + "ruff", + "pytest", "pytest-cov", "sphinx", "pytest-mock", ] examples = [ - "pytest >= 4.6", - "scipy" + "mesa[rec]", + "pytest", + "scipy", ] docs = [ "sphinx", @@ -65,7 +74,7 @@ docs = [ "pydata_sphinx_theme", "seaborn", "myst-nb", - "myst-parser", # Markdown in Sphinx + "myst-parser", # Markdown in Sphinx ] [project.urls] From f47e46a8701221c72ef81e97fdbd648bbdd5110c Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Thu, 26 Sep 2024 13:36:18 +0200 Subject: [PATCH 2/2] Keep cookiecutter as dev dep Think about what to do with that --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index c1256833966..28a6d0653db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,6 +62,7 @@ dev = [ "pytest-cov", "sphinx", "pytest-mock", + "cookiecutter", ] examples = [ "mesa[rec]",