Skip to content

Commit 10de3a8

Browse files
authored
Add documentation, switch to pyproject.toml and ruff (#365)
* Switch to pyproject.toml and ruff * Add basic doc * Move README to documentation * Simplify README * Add modules * Relax dependency and remove old logo * Download Atari ROMS * Upgrade SB3 * Add RTD env file * Fix RTD conda env * Fix Atari Roms download
1 parent d38ef18 commit 10de3a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1535
-425
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ body:
6161
required: true
6262
- label: I have read the [SB3 documentation](https://stable-baselines3.readthedocs.io/en/master/)
6363
required: true
64-
- label: I have read the [RL Zoo README](https://github.com/DLR-RM/rl-baselines3-zoo/blob/master/README.md)
64+
- label: I have read the [RL Zoo documentation](https://rl-baselines3-zoo.readthedocs.io)
6565
required: true
6666
- label: I have provided a minimal working example to reproduce the bug
6767
required: true

.github/ISSUE_TEMPLATE/question.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ body:
2424
required: true
2525
- label: I have read the [SB3 documentation](https://stable-baselines3.readthedocs.io/en/master/)
2626
required: true
27-
- label: I have read the [RL Zoo README](https://github.com/DLR-RM/rl-baselines3-zoo/blob/master/README.md)
27+
- label: I have read the [RL Zoo documentation](https://rl-baselines3-zoo.readthedocs.io)
2828
required: true
2929
- label: If code there is, it is minimal and working
3030
required: true

.github/workflows/ci.yml

+16-6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ jobs:
3131
- name: Install dependencies
3232
run: |
3333
python -m pip install --upgrade pip
34+
35+
# Install Atari Roms
36+
pip install autorom
37+
wget https://gist.githubusercontent.com/jjshoots/61b22aefce4456920ba99f2c36906eda/raw/00046ac3403768bfe45857610a3d333b8e35e026/Roms.tar.gz.b64
38+
base64 Roms.tar.gz.b64 --decode &> Roms.tar.gz
39+
AutoROM --accept-license --source-file Roms.tar.gz
40+
3441
pip install setuptools==65.5.0
3542
# cpu version of pytorch - faster to download
3643
pip install torch==1.11+cpu -f https://download.pytorch.org/whl/torch_stable.html
@@ -41,17 +48,20 @@ jobs:
4148
# install parking-env to test HER (pinned so it works with gym 0.21)
4249
pip install highway-env==1.5.0
4350
pip install -e .
44-
- name: Type check
51+
- name: Lint with ruff
4552
run: |
46-
make type
47-
# skip mypy type check for python3.7 (last forever for some reason)
48-
if: "!(matrix.python-version == '3.7')"
53+
make lint
4954
- name: Check codestyle
5055
run: |
5156
make check-codestyle
52-
- name: Lint with flake8
57+
- name: Build doc
5358
run: |
54-
make lint
59+
make doc
60+
- name: Type check
61+
run: |
62+
make type
63+
# skip mypy type check for python3.7 (last forever for some reason)
64+
if: "!(matrix.python-version == '3.7')"
5565
- name: Test with pytest
5666
run: |
5767
make pytest

.github/workflows/trained_agents.yml

+9
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
env:
1515
TERM: xterm-256color
1616
FORCE_COLOR: 1
17+
1718
# Skip CI if [ci skip] in the commit message
1819
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
1920
runs-on: ubuntu-latest
@@ -31,6 +32,14 @@ jobs:
3132
- name: Install dependencies
3233
run: |
3334
python -m pip install --upgrade pip
35+
36+
# Install Atari Roms
37+
pip install autorom
38+
wget https://gist.githubusercontent.com/jjshoots/61b22aefce4456920ba99f2c36906eda/raw/00046ac3403768bfe45857610a3d333b8e35e026/Roms.tar.gz.b64
39+
base64 Roms.tar.gz.b64 --decode &> Roms.tar.gz
40+
AutoROM --accept-license --source-file Roms.tar.gz
41+
42+
3443
pip install setuptools==65.5.0
3544
# cpu version of pytorch - faster to download
3645
pip install torch==1.11+cpu -f https://download.pytorch.org/whl/torch_stable.html

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ runs
1818
hub
1919
*.mp4
2020
*.json
21+
_build/
22+
2123

2224
# Setuptools distribution and build folders.
2325
/dist/

.readthedocs.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Build documentation in the docs/ directory with Sphinx
8+
sphinx:
9+
configuration: docs/conf.py
10+
11+
# Optionally build your docs in additional formats such as PDF and ePub
12+
formats: all
13+
14+
# Set requirements using conda env
15+
conda:
16+
environment: docs/conda_env.yml

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
## Release 1.8.0a2 (WIP)
1+
## Release 1.8.0a9 (WIP)
22

33
### Breaking Changes
44
- Upgraded to SB3 >= 1.8.0
55

66
### New Features
77
- Tuned hyperparameters for RecurrentPPO on Swimmer
8+
- Documentation is now built using Sphinx and hosted on read the doc
89

910
### Bug fixes
1011
- Set ``highway-env`` version to 1.5 and ``setuptools to`` v65.5 for the CI
@@ -18,6 +19,7 @@
1819
- Added support for `ruff` (fast alternative to flake8) in the Makefile
1920
- Removed Gitlab CI file
2021
- Replaced deprecated `optuna.suggest_loguniform(...)` by `optuna.suggest_float(..., log=True)`
22+
- Switched to `ruff` and `pyproject.toml`
2123

2224
## Release 1.7.0 (2023-01-10)
2325

Makefile

+14-12
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,34 @@ type: pytype mypy
1818

1919
lint:
2020
# stop the build if there are Python syntax errors or undefined names
21-
# see https://lintlyci.github.io/Flake8Rules/
22-
flake8 ${LINT_PATHS} --count --select=E9,F63,F7,F82 --show-source --statistics
23-
# exit-zero treats all errors as warnings.
24-
flake8 ${LINT_PATHS} --count --exit-zero --statistics
25-
26-
ruff:
27-
# stop the build if there are Python syntax errors or undefined names
28-
# see https://lintlyci.github.io/Flake8Rules/
21+
# see https://www.flake8rules.com/
2922
ruff ${LINT_PATHS} --select=E9,F63,F7,F82 --show-source
3023
# exit-zero treats all errors as warnings.
31-
ruff ${LINT_PATHS} --exit-zero --line-length 127
24+
ruff ${LINT_PATHS} --exit-zero
3225

3326
format:
3427
# Sort imports
3528
isort ${LINT_PATHS}
3629
# Reformat using black
37-
black -l 127 ${LINT_PATHS}
30+
black ${LINT_PATHS}
3831

3932
check-codestyle:
4033
# Sort imports
4134
isort --check ${LINT_PATHS}
4235
# Reformat using black
43-
black --check -l 127 ${LINT_PATHS}
36+
black --check ${LINT_PATHS}
4437

4538
commit-checks: format type lint
4639

40+
doc:
41+
cd docs && make html
42+
43+
spelling:
44+
cd docs && make spelling
45+
46+
clean:
47+
cd docs && make clean
48+
4749
docker: docker-cpu docker-gpu
4850

4951
docker-cpu:
@@ -66,4 +68,4 @@ test-release:
6668
python setup.py bdist_wheel
6769
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
6870

69-
.PHONY: lint format check-codestyle commit-checks doc spelling docker type pytest
71+
.PHONY: lint format check-codestyle commit-checks doc spelling docker type pytest

0 commit comments

Comments
 (0)