Skip to content

Commit 1e19cfb

Browse files
authored
Merge branch 'main' into feature/altair-agent-tooltip
2 parents de78550 + e21a5b5 commit 1e19cfb

File tree

8 files changed

+12
-15
lines changed

8 files changed

+12
-15
lines changed

.github/workflows/build_lint.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ jobs:
3535
include:
3636
- os: ubuntu
3737
python-version: "3.12"
38-
- os: ubuntu
39-
python-version: "3.11"
4038
# Disabled for now. See https://github.com/projectmesa/mesa/issues/1253
4139
#- os: ubuntu
4240
# python-version: 'pypy-3.8'

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
rev: v3.20.0
1818
hooks:
1919
- id: pyupgrade
20-
args: [--py311-plus]
20+
args: [--py312-plus]
2121
- repo: https://github.com/pre-commit/pre-commit-hooks
2222
rev: v6.0.0 # Use the ref you want to point at
2323
hooks:

docs/tutorials/0_first_model.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"source": [
5454
"### Tutorial Setup\n",
5555
"\n",
56-
"Create and activate a [virtual environment](http://docs.python-guide.org/en/latest/dev/virtualenvs/). *Python version 3.11 or higher is required*.\n",
56+
"Create and activate a [virtual environment](http://docs.python-guide.org/en/latest/dev/virtualenvs/). *Python version 3.12 or higher is required*.\n",
5757
"\n",
5858
"Install Mesa:\n",
5959
"\n",

mesa/discrete_space/cell_collection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from collections.abc import Callable, Iterable, Mapping
2121
from functools import cached_property
2222
from random import Random
23-
from typing import TYPE_CHECKING, Generic, TypeVar
23+
from typing import TYPE_CHECKING, TypeVar
2424

2525
if TYPE_CHECKING:
2626
from mesa.discrete_space.cell import Cell
@@ -29,7 +29,7 @@
2929
T = TypeVar("T", bound="Cell")
3030

3131

32-
class CellCollection(Generic[T]):
32+
class CellCollection[T: Cell]:
3333
"""An immutable collection of cells.
3434
3535
Attributes:

mesa/discrete_space/discrete_space.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import warnings
1919
from functools import cached_property
2020
from random import Random
21-
from typing import Generic, TypeVar
21+
from typing import TypeVar
2222

2323
from mesa.agent import AgentSet
2424
from mesa.discrete_space.cell import Cell
@@ -27,7 +27,7 @@
2727
T = TypeVar("T", bound=Cell)
2828

2929

30-
class DiscreteSpace(Generic[T]):
30+
class DiscreteSpace[T: Cell]:
3131
"""Base class for all discrete spaces.
3232
3333
Attributes:

mesa/discrete_space/grid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from collections.abc import Sequence
1818
from itertools import product
1919
from random import Random
20-
from typing import Any, Generic, TypeVar
20+
from typing import Any, TypeVar
2121

2222
from mesa.discrete_space import Cell, DiscreteSpace
2323
from mesa.discrete_space.property_layer import (
@@ -56,7 +56,7 @@ def unpickle_gridcell(parent, fields):
5656
return instance
5757

5858

59-
class Grid(DiscreteSpace[T], Generic[T], HasPropertyLayers):
59+
class Grid(DiscreteSpace[T], HasPropertyLayers):
6060
"""Base class for all grid classes.
6161
6262
Attributes:

mesa/space.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
F = TypeVar("F", bound=Callable[..., Any])
6262

6363

64-
def accept_tuple_argument(wrapped_function: F) -> F:
64+
def accept_tuple_argument[F: Callable[..., Any]](wrapped_function: F) -> F:
6565
"""Decorator to allow grid methods that take a list of (x, y) coord tuples to also handle a single position.
6666
6767
Tuples are wrapped in a single-item list rather than forcing user to do it.

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66
name = "Mesa"
77
description = "Agent-based modeling (ABM) in Python"
88
license = { text = "Apache 2.0" }
9-
requires-python = ">=3.11"
9+
requires-python = ">=3.12"
1010
authors = [
1111
{ name = "Project Mesa Team", email = "[email protected]" },
1212
]
@@ -25,7 +25,6 @@ classifiers = [
2525
"Topic :: Scientific/Engineering :: Artificial Intelligence",
2626
"Intended Audience :: Science/Research",
2727
"Programming Language :: Python :: 3 :: Only",
28-
"Programming Language :: Python :: 3.11",
2928
"Programming Language :: Python :: 3.12",
3029
"Programming Language :: Python :: 3.13",
3130
"License :: OSI Approved :: Apache Software License",
@@ -98,9 +97,9 @@ path = "mesa/__init__.py"
9897

9998
[tool.ruff]
10099
# See https://github.com/charliermarsh/ruff#rules for error code definitions.
101-
# Hardcode to Python 3.11.
100+
# Hardcode to Python 3.12.
102101
# Reminder to update mesa-examples if the value below is changed.
103-
target-version = "py311"
102+
target-version = "py312"
104103
extend-exclude = ["build"]
105104

106105
[tool.ruff.lint]

0 commit comments

Comments
 (0)