Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 33 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: build
on:
push:
branches:
- main
- release**
- main
- release**
paths-ignore:
- '**.md'
pull_request:
Expand All @@ -24,40 +24,43 @@ concurrency:
jobs:
build:
runs-on: ${{ matrix.os }}-latest
# We need an explicit timeout because sometimes the batch_runner test never
# completes.
timeout-minutes: 6

strategy:
fail-fast: False
fail-fast: false
matrix:
os: [windows, ubuntu, macos]
python-version: ["3.13"]
python-version: ['3.13']
include:
- os: ubuntu
python-version: "3.11"
python-version: '3.11'
- os: ubuntu
python-version: "3.12"
# Disabled for now. See https://github.com/projectmesa/mesa/issues/1253
#- os: ubuntu
# python-version: 'pypy-3.8'
python-version: '3.12'

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install uv
run: pip install uv
- name: Install mesa-frames
# See https://github.com/astral-sh/uv/issues/1945
run: |
uv pip install --system .[dev]
- name: Test with pytest
run: pytest --durations=10 --cov=mesa_frames tests/ --cov-report=xml
- if: matrix.os == 'ubuntu'
name: Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install uv via GitHub Action
uses: astral-sh/setup-uv@v6

- name: Install mesa-frames + dev dependencies
run: |
# 1. Install the project itself
uv pip install --system .
# 2. Install everything under the "dev" dependency group
uv pip install --group dev --system

- name: Test with pytest
run: pytest --durations=10 --cov=mesa_frames tests/ --cov-report=xml

- if: matrix.os == 'ubuntu'
name: Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
180 changes: 97 additions & 83 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,107 +1,130 @@
# ──────────────────────────────────────────────────────────────────────────────
# Build system (unchanged)
# ──────────────────────────────────────────────────────────────────────────────
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
requires = ["hatchling"]
build-backend = "hatchling.build"


# ──────────────────────────────────────────────────────────────────────────────
# Project metadata (updated dependency versions)
# ──────────────────────────────────────────────────────────────────────────────
[project]
name = "mesa_frames"
description = "An extension to the Mesa framework which uses Polars DataFrames for enhanced performance"
authors = [
name = "mesa_frames"
description = "An extension to the Mesa framework which uses Polars DataFrames for enhanced performance"
authors = [
{ name = "Project Mesa Team", email = "projectmesa@googlegroups.com" },
{ name = "Adam Amer"},
]
license = { text = "MIT" }
readme = "README.md"
keywords = [
"simulation",
"simulation-environment",
"gis",
"simulation-framework",
"agent-based-modeling",
"complex-systems",
"spatial-models",
"mesa",
"complexity-analysis",
"modeling-agents",
"agent-based-modelling"
{ name = "Adam Amer" },
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Artificial Life",
license = { text = "MIT" }
readme = "README.md"
keywords = [
"simulation", "simulation-environment", "gis", "simulation-framework",
"agent-based-modeling", "complex-systems", "spatial-models", "mesa",
"complexity-analysis", "modeling-agents", "agent-based-modelling",
]
dependencies = [
"numpy>=2.0.2",
"pyarrow",
## polars
"polars>=1.0.0", #polars._typing (see mesa_frames.types) added in 1.0.0
#"geopolars" (currently in pre-alpha)
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Artificial Life",
]
requires-python = ">=3.11"
dynamic = [
"version"
dependencies = [
"numpy>=2.0.2",
"pyarrow>=20.0.0",
# polars._typing added in 1.0.0
"polars>=1.30.0",
]


dynamic = ["version"]

[project.urls]
Documentation = "https://projectmesa.github.io/mesa-frames"
Repository = "https://github.com/projectmesa/mesa-frames.git"

[project.optional-dependencies]
mkdocs = [
"mkdocs-material",
"mkdocs-jupyter",
"mkdocs-git-revision-date-localized-plugin",
"mkdocs-minify-plugin",
"mkdocs-include-markdown-plugin"
]
Repository = "https://github.com/projectmesa/mesa-frames.git"

sphinx = [
"sphinx",
"sphinx-rtd-theme",
"numpydoc",
"pydata-sphinx-theme",
"sphinx-copybutton",
"sphinx-design",
"autodocsumm"
]

docs = [
"mesa_frames[mkdocs, sphinx]",
# Readme Script
"perfplot",
"seaborn"
]
# ──────────────────────────────────────────────────────────────────────────────
# Dependency groups (PEP 735) – local-only, never shipped to PyPI
# ──────────────────────────────────────────────────────────────────────────────
[dependency-groups]

test = [
"pytest",
"pytest-cov",
"beartype",
"pytest>=8.3.5",
"pytest-cov>=6.1.1",
"beartype>=0.21.0",
]

docs = [
"mkdocs-material>=9.6.14",
"mkdocs-jupyter>=0.25.1",
"mkdocs-git-revision-date-localized-plugin>=1.4.7",
"mkdocs-minify-plugin>=0.8.0",
"mkdocs-include-markdown-plugin>=7.1.5",
"sphinx>=7.4.7",
"sphinx-rtd-theme>=3.0.2",
"numpydoc>=1.8.0",
"pydata-sphinx-theme>=0.16.1",
"sphinx-copybutton>=0.5.2",
"sphinx-design>=0.6.1",
"autodocsumm>=0.2.14",
"perfplot>=0.10.2",
"seaborn>=0.13.2",
]

# dev = test ∪ docs ∪ extra tooling
dev = [
"mesa_frames[test, docs]",
{ include-group = "test" },
{ include-group = "docs" },
"mesa~=2.3.4",
"numba>=0.60",
"numba>=0.60.0",
"ruff>=0.11.12",
"pre-commit>=4.2.0",
]


# ──────────────────────────────────────────────────────────────────────────────
# Hatch configuration
# ──────────────────────────────────────────────────────────────────────────────
[tool.hatch.version]
path = "mesa_frames/__init__.py"

# Ask Hatch to use uv as the installer everywhere for speed.
[tool.hatch.envs.default]
installer = "uv"

# Testing environment ‒ installs ONLY the "test" group
[tool.hatch.envs.test]
features = ["test"]
dependencies = [{ include-group = "test" }]

# Docs build environment
[tool.hatch.envs.docs]
dependencies = [{ include-group = "docs" }]

[tool.hatch.envs.dev] #Allows installing dev as virtual env
features = ["dev"]
# Dev environment (inherits uv installer)
[tool.hatch.envs.dev]
dependencies = [{ include-group = "dev" }]
env = { MESA_FRAMES_RUNTIME_TYPECHECKING = "true" }

# Wheel build – unchanged
[tool.hatch.build.targets.wheel]
packages = ["mesa_frames"]

[tool.hatch.version]
path = "mesa_frames/__init__.py"

# ──────────────────────────────────────────────────────────────────────────────
# uv configuration
# ──────────────────────────────────────────────────────────────────────────────
[tool.uv]
# Install the dev stack by default when you run `uv sync`
default-groups = ["dev"]

[tool.uv.sources]
mesa-frames = { workspace = true }


# ──────────────────────────────────────────────────────────────────────────────
# Ruff linter – unchanged
# ──────────────────────────────────────────────────────────────────────────────
[tool.ruff.lint]
select = ["D"]
ignore = ["D101", "D102", "D105"]
Expand All @@ -110,15 +133,6 @@ ignore = ["D101", "D102", "D105"]
convention = "numpy"

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D"]
"tests/*" = ["D"]
"examples/*" = ["D"]
"docs/*" = ["D"]

[tool.uv.sources]
mesa-frames = { workspace = true }

[dependency-groups]
dev = [
"mesa-frames[dev]",
]

"docs/*" = ["D"]
Loading