Skip to content

Commit

Permalink
Update tutorials and Readme with optional dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutH committed Sep 20, 2024
1 parent 37f89d3 commit 21e3fe9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,38 @@ can be displayed in browser windows or Jupyter.*

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

``` bash
```bash
pip install -U mesa
```

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

``` bash
```bash
pip install -U --pre mesa
```
With Mesa 3.0, we don't install all our dependencies anymore by default.
```bash
# With our recommended dependencies
pip install -U --pre mesa[rec]
```
```bash
# You can customize the dependencies you need, if you want. Available are:
pip install -U --pre mesa[network,viz,data,batch]
```
```bash
# With all, including developer, dependencies:
pip install -U --pre mesa[all]
```

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

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

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

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

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

``` bash
```bash
$ docker compose up
# If you want to make it run in the background, you instead run
$ docker compose up -d
Expand Down
12 changes: 9 additions & 3 deletions docs/tutorials/intro_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@
"\n",
"Create and activate a [virtual environment](http://docs.python-guide.org/en/latest/dev/virtualenvs/). *Python version 3.10 or higher is required*.\n",
"\n",
"Install Mesa:\n",
"Install Mesa with the recommended dependencies.\n",
"\n",
"```bash\n",
"pip install --upgrade mesa[rec]\n",
"```\n",
"\n",
"If you already have all the dependencies installed or are just updating, you can install Mesa without the recommended dependencies:\n",
"\n",
"```bash\n",
"pip install --upgrade mesa\n",
Expand All @@ -69,7 +75,7 @@
"If you want to use our newest features, you can also opt to install our latest pre-release version:\n",
"\n",
"```bash\n",
"pip install --upgrade --pre mesa\n",
"pip install --upgrade --pre mesa[rec]\n",
"```\n",
"\n",
"Install Jupyter Notebook (optional):\n",
Expand All @@ -96,7 +102,7 @@
"source": [
"# SKIP THIS CELL unless running in colab\n",
"\n",
"%pip install --quiet mesa\n",
"%pip install --quiet mesa[rec]\n",
"# The exclamation points tell jupyter to do the command via the command line"
]
},
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/visualization_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
},
"outputs": [],
"source": [
"# Install and import the latest Mesa pre-release version\n",
"%pip install --quiet --upgrade --pre mesa\n",
"# Install and import the latest Mesa pre-release version with the recommended dependencies\n",
"%pip install --quiet --upgrade --pre mesa[rec]\n",
"import mesa\n",
"print(f\"Mesa version: {mesa.__version__}\")\n",
"\n",
Expand Down

0 comments on commit 21e3fe9

Please sign in to comment.