diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..334d7b526 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,39 @@ +name: Tests +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + max-parallel: 15 + matrix: + # os: [ubuntu-latest, macos-latest, windows-latest, macos-13-xlarge] + # For Apple Silicon: https://github.com/actions/runner-images/issues/8439 + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + # Exclude Python 3.8 on Windows because of resolution issues + exclude: + - os: windows-latest + python-version: '3.8' + defaults: + run: + shell: bash + steps: + - name: Check out repository + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + pip install -e '.[dev]' + + - name: Run pytest + run: pytest tests \ No newline at end of file diff --git a/jaxmarl/__init__.py b/jaxmarl/__init__.py index f35304877..5bd51201f 100644 --- a/jaxmarl/__init__.py +++ b/jaxmarl/__init__.py @@ -1,3 +1,4 @@ from .registration import make, registered_envs -__all__ = ["make", "registered_envs"] \ No newline at end of file +__all__ = ["make", "registered_envs"] +__version__ = "0.0.2" \ No newline at end of file diff --git a/jaxmarl/_version.py b/jaxmarl/_version.py deleted file mode 100644 index 3b93d0be0..000000000 --- a/jaxmarl/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.0.2" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..93d02ae08 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +include = ['jaxmarl*'] + +[tool.setuptools.dynamic] +version = {attr = "jaxmarl.__version__"} +dependencies = {file = ["requirements/requirements.txt"]} +optional-dependencies = {dev = { file = ["requirements/requirements-dev.txt"] }, qlearning = { file = ["requirements-qlearning.txt"] }} + +[project] +name = "jaxmarl" +readme = "README.md" +description = "Multi-Agent Reinforcement Learning with JAX" +authors = [ + {name = "Foerster Lab for AI Research", email = "arutherford@robots.ox.ac.uk"}, + ] +dynamic = ["version", "dependencies", "optional-dependencies"] +license = {file = "LICENSE"} +requires-python = ">=3.8" +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Software Development :: Libraries :: Python Modules", + "License :: OSI Approved :: Apache Software License", +] + +[project.urls] +"Homepage" = "https://github.com/FLAIROx/JaxMARL" +"Bug Tracker" = "https://github.com/FLAIROx/JaxMARL/issues" \ No newline at end of file diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index df2d82b8e..c8290449c 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -1,3 +1,4 @@ pytest +pygame pettingzoo>=1.23.1 tqdm>=4.65.0 \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 01e6877ba..000000000 --- a/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -from setuptools import find_packages, setup -import os -import re -from typing import List - -CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) - -with open(os.path.join(CURRENT_DIR, "README.md"), encoding="utf-8") as f: - long_description = f.read() - -def _parse_requirements(path: str) -> List[str]: - """Returns content of given requirements file.""" - with open(os.path.join(path)) as f: - return [ - line.rstrip() for line in f if not (line.isspace() or line.startswith("#")) - ] - -VERSIONFILE = "jaxmarl/_version.py" -verstrline = open(VERSIONFILE, "rt").read() -VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" -mo = re.search(VSRE, verstrline, re.M) -if mo: - verstr = mo.group(1) -else: - raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,)) -git_tar = f"https://github.com/FLAIROx/JaxMARL/archive/v{verstr}.tar.gz" - -setup( - name="jaxmarl", - version=verstr, - author="Foerster Lab for AI Research", - author_email="arutherford@robots.ox.ac.uk", - description="Multi-Agent Reinforcement Learning with JAX", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/FLAIROx/JaxMARL", - download_url=git_tar, - keywords="MARL reinforcement-learning python jax", - packages=find_packages(exclude=["baselines"]), - python_requires=">=3.8", - install_requires=_parse_requirements("requirements/requirements.txt"), - extras_require={ - "dev": _parse_requirements("requirements/requirements-dev.txt"), - "qlearning": _parse_requirements("requirements/requirements-qlearning.txt"), - }, - classifiers=[ - "Intended Audience :: Science/Research", - "Intended Audience :: Developers", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Topic :: Scientific/Engineering :: Artificial Intelligence", - "Topic :: Software Development :: Libraries :: Python Modules", - "License :: OSI Approved :: Apache Software License", - ], - include_package_data=True, - zip_safe=False, -)