Skip to content

Commit 21e3fe9

Browse files
committed
Update tutorials and Readme with optional dependencies
1 parent 37f89d3 commit 21e3fe9

File tree

3 files changed

+29
-10
lines changed

3 files changed

+29
-10
lines changed

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,38 @@ can be displayed in browser windows or Jupyter.*
3030

3131
To install our latest stable release (2.3.x), run:
3232

33-
``` bash
33+
```bash
3434
pip install -U mesa
3535
```
3636

3737
To install our latest pre-release (3.0.0 alpha), run:
3838

39-
``` bash
39+
```bash
4040
pip install -U --pre mesa
4141
```
42+
With Mesa 3.0, we don't install all our dependencies anymore by default.
43+
```bash
44+
# With our recommended dependencies
45+
pip install -U --pre mesa[rec]
46+
```
47+
```bash
48+
# You can customize the dependencies you need, if you want. Available are:
49+
pip install -U --pre mesa[network,viz,data,batch]
50+
```
51+
```bash
52+
# With all, including developer, dependencies:
53+
pip install -U --pre mesa[all]
54+
```
4255

4356
You can also use `pip` to install the latest GitHub version:
4457

45-
``` bash
58+
```bash
4659
pip install -U -e git+https://github.com/projectmesa/mesa@main#egg=mesa
4760
```
4861

4962
Or any other (development) branch on this repo or your own fork:
5063

51-
``` bash
64+
```bash
5265
pip install -U -e git+https://github.com/YOUR_FORK/mesa@YOUR_BRANCH#egg=mesa
5366
```
5467

@@ -75,7 +88,7 @@ If you are a Mesa developer, first [install Docker
7588
Compose](https://docs.docker.com/compose/install/) and then, in the
7689
folder containing the Mesa Git repository, you run:
7790

78-
``` bash
91+
```bash
7992
$ docker compose up
8093
# If you want to make it run in the background, you instead run
8194
$ docker compose up -d

docs/tutorials/intro_tutorial.ipynb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@
6060
"\n",
6161
"Create and activate a [virtual environment](http://docs.python-guide.org/en/latest/dev/virtualenvs/). *Python version 3.10 or higher is required*.\n",
6262
"\n",
63-
"Install Mesa:\n",
63+
"Install Mesa with the recommended dependencies.\n",
64+
"\n",
65+
"```bash\n",
66+
"pip install --upgrade mesa[rec]\n",
67+
"```\n",
68+
"\n",
69+
"If you already have all the dependencies installed or are just updating, you can install Mesa without the recommended dependencies:\n",
6470
"\n",
6571
"```bash\n",
6672
"pip install --upgrade mesa\n",
@@ -69,7 +75,7 @@
6975
"If you want to use our newest features, you can also opt to install our latest pre-release version:\n",
7076
"\n",
7177
"```bash\n",
72-
"pip install --upgrade --pre mesa\n",
78+
"pip install --upgrade --pre mesa[rec]\n",
7379
"```\n",
7480
"\n",
7581
"Install Jupyter Notebook (optional):\n",
@@ -96,7 +102,7 @@
96102
"source": [
97103
"# SKIP THIS CELL unless running in colab\n",
98104
"\n",
99-
"%pip install --quiet mesa\n",
105+
"%pip install --quiet mesa[rec]\n",
100106
"# The exclamation points tell jupyter to do the command via the command line"
101107
]
102108
},

docs/tutorials/visualization_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
},
4242
"outputs": [],
4343
"source": [
44-
"# Install and import the latest Mesa pre-release version\n",
45-
"%pip install --quiet --upgrade --pre mesa\n",
44+
"# Install and import the latest Mesa pre-release version with the recommended dependencies\n",
45+
"%pip install --quiet --upgrade --pre mesa[rec]\n",
4646
"import mesa\n",
4747
"print(f\"Mesa version: {mesa.__version__}\")\n",
4848
"\n",

0 commit comments

Comments
 (0)