Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce poetry #182

Merged
merged 16 commits into from
May 19, 2021
Merged
13 changes: 7 additions & 6 deletions .github/workflows/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
poetry-version: [1.1.5]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r handyrl/envs/kaggle/requirements.txt
- uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ matrix.poetry-version }}
- run: |
poetry install
- name: pytest
run: |
python -m pytest tests
poetry run python -m pytest tests
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ cd HandyRL

Then, install additional libraries (e.g. numpy, pytorch). Or run it in a virtual environment or container (e.g. Docker).
```
pip3 install -r requirements.txt
```

To use games of kaggle environments (e.g. Hungry Geese) you can install also additional dependencies.
```
pip3 install -r handyrl/envs/kaggle/requirements.txt
poetry install
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, handyrl is not a library yet and intended to use with environments under env/. And, this is a framework of training. So we don't need to care about docker and additional dependency poetry.

Additional option is:

  1. Provide both pyproject.toml and requirements.txt.
  2. Check coherence of them in CI by using https://python-poetry.org/docs/cli/#export

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#182 (comment)

We provide requirements.txt until #183 .

```


Expand Down Expand Up @@ -87,7 +82,7 @@ NOTE: [Here is the list of games implemented in HandyRL](handyrl/envs). All para
After creating the configuration, you can start training by running the following command. The trained models are saved in `models` folder every `update_episodes` described in `config.yaml`.

```
python main.py --train
poetry run python main.py --train
```


Expand All @@ -97,7 +92,7 @@ After training, you can evaluate the model against any models. The below code ev


```
python main.py --eval models/1.pth 100 4
poetry run python main.py --eval models/1.pth 100 4
```

NOTE: Default opponent AI is random agent implemented in `evaluation.py`. You can change the agent with any of your agents.
Expand Down
2 changes: 0 additions & 2 deletions handyrl/envs/kaggle/requirements.txt

This file was deleted.

Loading