Skip to content

Commit

Permalink
Migrate setup from setup.py to pyproject.toml
Browse files Browse the repository at this point in the history
Remove Tornado external dep files from MANIFEST.in

Apply Black

pyproject.toml: Dynamically read version from __init__.py
  • Loading branch information
rht authored and tpike3 committed Nov 19, 2023
1 parent e58b4da commit 2a42f90
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 94 deletions.
5 changes: 0 additions & 5 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ include LICENSE
include HISTORY.rst
include README.rst
include setup.py
include mesa/visualization/templates/*.html
include mesa/visualization/templates/css/*
include mesa/visualization/templates/fonts/*
graft mesa/cookiecutter-mesa
graft mesa/visualization/templates/js
graft mesa/visualization/templates/external
global-exclude *.py[co]
global-exclude __pycache__
global-exclude *~
Expand Down
87 changes: 87 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,90 @@
[build-system]
requires = [
"setuptools",
"wheel",
]
build-backend = "setuptools.build_meta"

[project]
name = "Mesa"
description = "Agent-based modeling (ABM) in Python 3+"
license = { text = "Apache 2.0" }
requires-python = ">=3.8"
authors = [
{ name = "Project Mesa Team", email = "[email protected]" },
]
keywords = [
"agent",
"based",
"modeling",
"model",
"ABM",
"simulation",
"multi-agent",
]
classifiers = [
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Life",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Natural Language :: English",
]
readme = "README.rst"
dependencies = [
"click",
"cookiecutter",
"matplotlib",
"mesa_viz_tornado~=0.1.0,>=0.1.3",
"networkx",
"numpy",
"pandas",
"solara",
"tqdm",
]
dynamic = ["version"]

[project.optional-dependencies]
dev = [
"black",
"ruff~=0.1.1", # Update periodically
"coverage",
"pytest >= 4.6",
"pytest-cov",
"sphinx",
]
# Explicitly install ipykernel for Python 3.8.
# See https://stackoverflow.com/questions/28831854/how-do-i-add-python3-kernel-to-jupyter-ipython
# Could be removed in the future
docs = [
"sphinx",
"ipython",
"ipykernel",
"pydata_sphinx_theme",
"seaborn",
"myst-nb",
]

[project.urls]
homepage = "https://github.com/projectmesa/mesa"
repository = "https://github.com/projectmesa/mesa"

[project.scripts]
mesa = "mesa.main:cli"

[tool.setuptools.packages.find]
include = ["mesa*"]
exclude = ["tests*"]

[tool.setuptools.dynamic]
version = {attr = "mesa.__version__"}

[tool.ruff]
# See https://github.com/charliermarsh/ruff#rules for error code definitions.
select = [
Expand Down
88 changes: 0 additions & 88 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_batch_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(
schedule=None,
enable_agent_reporters=True,
n_agents=3,
**kwargs
**kwargs,
):
super().__init__()
self.schedule = BaseScheduler(self) if schedule is None else schedule
Expand Down

0 comments on commit 2a42f90

Please sign in to comment.