Skip to content

Commit

Permalink
open-source release
Browse files Browse the repository at this point in the history
  • Loading branch information
RuanJohn committed Nov 23, 2022
0 parents commit aa3b5df
Show file tree
Hide file tree
Showing 32 changed files with 784,818 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
per-file-ignores = __init__.py:F401
max-line-length = 88
extend-ignore = E203, W503
exclude = docs/*
max-complexity = 15
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## What?
[Describe what was changed and reference relevant issue.]
## Why?
[Describe why the change was made.]
## How?
[Describe how the change was made i.e. describe technically what the change does.]
## Extra
[Any extra information.]
27 changes: 27 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: format_and_test

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
test-ubuntu:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
docker-image: ["python:3.8"]
steps:
- name: Checkout marl_eval
uses: actions/checkout@v2
- name: Check format and types
run: |
docker run --mount "type=bind,src=$(pwd),dst=/tmp/marl_eval" \
-w "/tmp/marl_eval" --rm ${{ matrix.docker-image }} /bin/bash bash_scripts/check_format.sh
- name: Run tests in docker
run: |
docker run --mount "type=bind,src=$(pwd),dst=/tmp/marl_eval" \
-w "/tmp/marl_eval" --rm ${{ matrix.docker-image }} /bin/bash bash_scripts/tests.sh
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: pypi

on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.x"
- name: Install dependencies
run: |
pip install --upgrade pip setuptools twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist
twine upload dist/*
149 changes: 149 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# VSCode
.vscode/

# Dummy json data
*_data.json
processed_*.json

# Images
*.png
!return_performance_profile.png

# Plots folder
plots

# csv data
*.csv

# latex tabular data
*latex.txt
83 changes: 83 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Pre-commit hooks for repo.

# Packages:
# pre-commit: General pre-commits for formatting.
# black: Python code strict formatting.
# pyupgrade: Upgrade syntax for newer versions of the language.
# isort: Sorts imports.
# flake8: Checks code follows PEP8 standard.
# mypy: Static typing.
# conventional-pre-commit: commit format checker.
# blacken-docs: Checks docs follow black format standard.
# pydocstyle: Checking docstring style.
# interrogate: Checks docstring code coverage.

default_stages: [commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude_types: [image]
- id: check-merge-conflict
- id: debug-statements
- id: mixed-line-ending
- id: check-yaml

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
exclude_types: [image]

- repo: https://github.com/asottile/pyupgrade
rev: v2.10.0
hooks:
- id: pyupgrade

- repo: https://github.com/timothycrosley/isort
rev: 5.7.0
hooks:
- id: isort

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.2
hooks:
- id: flake8
additional_dependencies: [flake8-isort]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.941
hooks:
- id: mypy
exclude: ^docs/
args: [--config-file=mypy.ini]

- repo: https://github.com/compilerla/conventional-pre-commit
rev: v1.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]


- repo: https://github.com/asottile/blacken-docs
rev: v1.8.0
hooks:
- id: blacken-docs
additional_dependencies: [black==20.8b1]

- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
name: Checking docstring style.
args: ["--convention=google","--add-ignore=D100,D202,D101,D415"]

- repo: https://github.com/econchick/interrogate
rev: 1.4.0
hooks:
- id: interrogate
name: Checking docstring code coverage.
args: ["--config=pyproject.toml","marl_eval"]
pass_filenames: false
44 changes: 44 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# How to Contribute

We'd love to accept your patches and contributions to this project as it will take the joint efforts of the MARL community to ensure that the evaluation standard is raised! There are
just a few small guidelines you need to follow.

## Installing MARL-eval for developement

To develop features for marl-eval, clone the repository and install all the dependencies as follows:

```bash
git clone https://github.com/instadeepai/marl-eval.git
pip install -e .
```

## Installing Pre-Commit Hooks and Testing Dependencies

Install the pre-commit hooks and testing dependencies:
```bash
pip install .[testing_formatting]
pre-commit install
pre-commit install -t commit-msg
```
You can run all the pre-commit hooks on all files as follows:
```bash
pre-commit run --all-files
```

## Naming Conventions
### Branch Names
We name our feature and bugfix branches as follows - `feature/[BRANCH-NAME]`, `bugfix/[BRANCH-NAME]` or `maintenance/[BRANCH-NAME]`. Please ensure `[BRANCH-NAME]` is hyphen delimited.
### Commit Messages
We follow the conventional commits [standard](https://www.conventionalcommits.org/en/v1.0.0/).

## Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

## Community Guidelines

This project follows
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
Loading

0 comments on commit aa3b5df

Please sign in to comment.