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
42 changes: 35 additions & 7 deletions .github/workflows/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,53 @@ on:
push:

jobs:
pytest:
name: Run pytest
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
poetry-version: [1.1.5]
with-up-to-date-dependencies: [false, true]
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
- uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Remove the lockfile to install latest packages
if: matrix.with-up-to-date-dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r handyrl/envs/kaggle/requirements.txt
rm poetry.lock
- run: |
poetry install
- name: pytest
run: |
python -m pytest tests
poetry run python -m pytest
validate-requirements:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [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 }}
- uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- run: |
# If failed, do
# $ poetry export --without-hashes -f requirements.txt --output requirements.txt
# $ poetry export --without-hashes -f requirements.txt --output requirements-dev.txt --dev
diff <(poetry export --without-hashes -f requirements.txt | grep -v '^Warning:') requirements.txt
diff <(poetry export --without-hashes -f requirements.txt --dev | grep -v '^Warning:') requirements-dev.txt
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ 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
pip3 install -r requirements-dev.txt
```

Or equivalently, you can use [poetry](https://python-poetry.org/).

```
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
2 changes: 0 additions & 2 deletions handyrl/envs/kaggle/requirements.txt

This file was deleted.

Loading