Skip to content

Commit e6345d1

Browse files
authored
workflows added (#25)
- test and publish - bump version
1 parent 0aff0b1 commit e6345d1

File tree

4 files changed

+87
-9
lines changed

4 files changed

+87
-9
lines changed

.github/workflows/python-package.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [macos-latest, ubuntu-latest]
18+
python-version: [3.6, 3.7, 3.8]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install flake8 pytest
30+
pip install -e .
31+
pip install -e .[test]
32+
- name: Lint with flake8
33+
run: |
34+
# stop the build if there are Python syntax errors or undefined names
35+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38+
- name: Test with pytest
39+
run: |
40+
pytest

.github/workflows/python-publish.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
11+
jobs:
12+
deploy:
13+
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine 'readme_renderer[md]'
25+
- name: Build and publish
26+
env:
27+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29+
run: |
30+
python setup.py sdist bdist_wheel
31+
twine upload dist/*

README.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
# ma-gym
22
A collection of multi agent environments based on OpenAI gym.
33

4-
[![Build Status](https://travis-ci.com/koulanurag/ma-gym.svg?token=DM2fKnVJXEZDaszt9oHm&branch=master)](https://travis-ci.com/koulanurag/ma-gym)
4+
![Python package](https://github.com/koulanurag/ma-gym/workflows/Python%20package/badge.svg)
55

66
## Installation
7+
Using PyPI:
78
```bash
9+
pip install ma-gym
10+
```
11+
12+
Directly from source:
13+
```bash
14+
git clone https://github.com/koulanurag/ma-gym.git
815
cd ma-gym
916
pip install -e .
1017
```
@@ -48,15 +55,15 @@ Please refer to [Wiki](https://github.com/koulanurag/ma-gym/wiki/Environments) f
4855

4956
| __Checkers-v0__ | __Combat-v0__ | __Lumberjacks-v0__ |
5057
|:---:|:---:|:---:|
51-
|![Checkers-v0.gif](static/gif/Checkers-v0.gif)|![Combat-v0.gif](static/gif/Combat-v0.gif)|![Lumberjacks-v0.gif](static/gif/Lumberjacks-v0.gif)|
58+
|![Checkers-v0.gif](https://raw.githubusercontent.com/koulanurag/ma-gym/master/static/gif/Checkers-v0.gif)|![Combat-v0.gif](https://raw.githubusercontent.com/koulanurag/ma-gym/master/static/gif/Combat-v0.gif)|![Lumberjacks-v0.gif](https://raw.githubusercontent.com/koulanurag/ma-gym/master/static/gif/Lumberjacks-v0.gif)|
5259
| __PongDuel-v0__ | __PredatorPrey5x5-v0__ | __PredatorPrey7x7-v0__ |
53-
| ![PongDuel-v0.gif](static/gif/PongDuel-v0.gif) | ![PredatorPrey5x5-v0.gif](static/gif/PredatorPrey5x5-v0.gif) | ![PredatorPrey7x7-v0.gif](static/gif/PredatorPrey7x7-v0.gif) |
60+
| ![PongDuel-v0.gif](https://raw.githubusercontent.com/koulanurag/ma-gym/master/static/gif/PongDuel-v0.gif) | ![PredatorPrey5x5-v0.gif](https://raw.githubusercontent.com/koulanurag/ma-gym/master/static/gif/PredatorPrey5x5-v0.gif) | ![PredatorPrey7x7-v0.gif](https://raw.githubusercontent.com/koulanurag/ma-gym/master/static/gif/PredatorPrey7x7-v0.gif) |
5461
| __Switch2-v0__ | __Switch4-v0__ | |
55-
| ![Switch2-v0.gif](static/gif/Switch2-v0.gif) | ![Switch4-v0.gif](static/gif/Switch4-v0.gif) | |
62+
| ![Switch2-v0.gif](https://raw.githubusercontent.com/koulanurag/ma-gym/master/static/gif/Switch2-v0.gif) | ![Switch4-v0.gif](https://raw.githubusercontent.com/koulanurag/ma-gym/master/static/gif/Switch4-v0.gif) | |
5663

5764
## Testing:
5865

59-
- Install: ```pip install pytest ```
66+
- Install: ```pip install -e .[test] ```
6067
- Run: ```pytest```
6168

6269

setup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
extras['all'] = [item for group in extras.values() for item in group]
1212

1313
setup(name='ma_gym',
14-
version='0.0.1',
14+
version='0.0.4',
1515
description='A collection of multi agent environments based on OpenAI gym.',
16-
long_description=open(path.join(path.abspath(path.dirname(__file__)), 'README.md')).read(),
16+
long_description_content_type='text/markdown',
17+
long_description=open(path.join(path.abspath(path.dirname(__file__)), 'README.md'), encoding='utf-8').read(),
1718
url='https://github.com/koulanurag/ma-gym',
1819
author='Anurag Koul',
1920
author_email='[email protected]',
20-
license=open(path.join(path.abspath(path.dirname(__file__)), 'LICENSE')).read(),
21+
license='MIT License',
2122
packages=['ma_gym'],
2223
py_modules=['ma_gym'],
2324
install_requires=[
@@ -26,7 +27,6 @@
2627
'pyglet>=1.4.0,<=1.5.0',
2728
'cloudpickle>=1.2.0,<1.7.0',
2829
'gym>=0.17.0',
29-
'Pillow>=6.2.0',
3030
],
3131
extras_require=extras,
3232
tests_require=extras['test'],

0 commit comments

Comments
 (0)