diff --git a/MANIFEST.in b/MANIFEST.in index a0cea1f60a5..e07a78ea4fe 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 *~ diff --git a/pyproject.toml b/pyproject.toml index 7b7b1d6d026..7b1fe3a9db7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "projectmesa@googlegroups.com" }, +] +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 = [ diff --git a/setup.py b/setup.py deleted file mode 100644 index e33d0a776bf..00000000000 --- a/setup.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python -import re -from codecs import open - -from setuptools import find_packages, setup - -requires = [ - "click", - "cookiecutter", - "matplotlib", - "mesa_viz_tornado~=0.1.0,>=0.1.3", - "networkx", - "numpy", - "pandas", - "solara", - "tqdm", -] - -extras_require = { - "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", - ], -} - -version = "" -with open("mesa/__init__.py") as fd: - version = re.search( - r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE - ).group(1) - -with open("README.rst", "rb", encoding="utf-8") as f: - readme = f.read() - - -setup( - name="Mesa", - version=version, - description="Agent-based modeling (ABM) in Python 3+", - long_description=readme, - author="Project Mesa Team", - author_email="projectmesa@googlegroups.com", - url="https://github.com/projectmesa/mesa", - packages=find_packages(), - package_data={ - "cookiecutter-mesa": ["cookiecutter-mesa/*"], - }, - include_package_data=True, - install_requires=requires, - extras_require=extras_require, - keywords="agent based modeling model ABM simulation multi-agent", - license="Apache 2.0", - zip_safe=False, - 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", - ], - entry_points=""" - [console_scripts] - mesa=mesa.main:cli - """, - python_requires=">=3.8", -) diff --git a/tests/test_batch_run.py b/tests/test_batch_run.py index 31efb87dd2d..1557666f34f 100644 --- a/tests/test_batch_run.py +++ b/tests/test_batch_run.py @@ -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