From 660f2d354ef9d63cd7a478390780dffa0cadb80c Mon Sep 17 00:00:00 2001 From: Antonin RAFFIN Date: Mon, 3 Jul 2023 12:45:38 +0200 Subject: [PATCH] Drop python 3.7, add 3.11, update templates (#389) --- .github/ISSUE_TEMPLATE/bug_report.yml | 4 ++-- .github/ISSUE_TEMPLATE/documentation.yml | 2 +- .github/ISSUE_TEMPLATE/question.yml | 8 +++++--- .github/workflows/ci.yml | 8 ++++---- .github/workflows/trained_agents.yml | 11 ++++------- CHANGELOG.md | 17 +++++++++++++++++ docs/Makefile | 2 +- docs/conda_env.yml | 8 ++++---- docs/guide/install.rst | 2 +- pyproject.toml | 4 ++-- rl_zoo3/version.txt | 2 +- rl_zoo3/wrappers.py | 2 +- setup.py | 5 ++--- 13 files changed, 45 insertions(+), 30 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index cc16a609f..88a747985 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,5 +1,5 @@ name: "\U0001F41B Bug Report" -description: Submit a bug report to help us improve RL Baselines3 Zoo +description: If you encounter an unexpected behavior, software crash, or other bug. title: "[Bug]: bug title" labels: ["bug"] body: @@ -64,7 +64,7 @@ body: required: true - label: I have read the [RL Zoo documentation](https://rl-baselines3-zoo.readthedocs.io) required: true - - label: I have provided a minimal working example to reproduce the bug + - label: I have provided a [minimal and working](https://github.com/DLR-RM/stable-baselines3/issues/982#issuecomment-1197044014) example to reproduce the bug required: true - label: I've used the [markdown code blocks](https://help.github.com/en/articles/creating-and-highlighting-code-blocks) for both code and stack traces. required: true diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml index e982c5bcb..676176bc7 100644 --- a/.github/ISSUE_TEMPLATE/documentation.yml +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -1,5 +1,5 @@ name: "\U0001F4DA Documentation" -description: Report an issue related to RL Baselines3 Zoo documentation +description: If you want to improve the documentation by reporting errors, inconsistencies, or missing information. labels: ["documentation"] body: - type: markdown diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 4da584fec..b5701835e 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -1,5 +1,5 @@ name: "❓ Question" -description: How to ask a question regarding RL Baselines3 Zoo +description: If you have a general question about RL Baselines3 Zoo title: "[Question] question title" labels: ["question"] body: @@ -12,7 +12,9 @@ body: id: question attributes: label: ❓ Question - description: Your question. This can be e.g. questions regarding confusing or unclear behaviour of functions or a question if X can be done using rl-baselines3-zoo. Make sure to check out the documentation first. + description: | + Your question. This can be e.g. questions regarding confusing or unclear behaviour of functions or a question if X can be done using stable-baselines3. Make sure to check out the documentation first. + **Important Note: If your question is anything like "Why is my code generating this error?", you must [submit a bug report](https://github.com/DLR-RM/rl-baselines3-zoo/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml&title=%5BBug%5D%3A+bug+title) instead.** validations: required: true - type: checkboxes @@ -26,7 +28,7 @@ body: required: true - label: I have read the [RL Zoo documentation](https://rl-baselines3-zoo.readthedocs.io) required: true - - label: If code there is, it is minimal and working + - label: If code there is, it is [minimal and working](https://github.com/DLR-RM/stable-baselines3/issues/982#issuecomment-1197044014) required: true - label: If code there is, it is formatted using the [markdown code blocks](https://help.github.com/en/articles/creating-and-highlighting-code-blocks) for both code and stack traces. required: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5a9cbcda..fbf302fb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v2 with: @@ -39,7 +39,7 @@ jobs: AutoROM --accept-license --source-file Roms.tar.gz # cpu version of pytorch - faster to download - pip install torch==1.11.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu + pip install torch==1.13.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu pip install pybullet==3.2.5 # for v4 MuJoCo envs: pip install mujoco @@ -61,8 +61,8 @@ jobs: - name: Type check run: | make type - # skip mypy type check for python3.7 (last forever for some reason) - if: "!(matrix.python-version == '3.7')" + # skip pytype type check for python 3.11 (not supported) + if: "!(matrix.python-version == '3.11')" - name: Test with pytest run: | make pytest diff --git a/.github/workflows/trained_agents.yml b/.github/workflows/trained_agents.yml index 82af80c3d..ab04789cb 100644 --- a/.github/workflows/trained_agents.yml +++ b/.github/workflows/trained_agents.yml @@ -20,13 +20,13 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -40,15 +40,12 @@ jobs: AutoROM --accept-license --source-file Roms.tar.gz # cpu version of pytorch - faster to download - pip install torch==1.11.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu + pip install torch==1.13.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu pip install pybullet==3.2.5 pip install -r requirements.txt # Use headless version pip install opencv-python-headless pip install highway-env==1.8.1 - # Add support for pickle5 protocol - # TODO: remove me when dropping python 3.7 - pip install pickle5 pip install -e . - name: Check trained agents run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e3654f90..47ebcb5b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +## Release 2.1.0a0 (WIP) + +### Breaking Changes +- Dropped python 3.7 support +- SB3 now requires PyTorch 1.13+ + +### New Features +- Added python 3.11 support + +### Bug fixes + +### Documentation + +### Other + + + ## Release 2.0.0 (2023-06-22) **Gymnasium support** diff --git a/docs/Makefile b/docs/Makefile index 938bf87e1..aa65668de 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line. # For debug: SPHINXOPTS = -nWT --keep-going -vvv -SPHINXOPTS = # -W # make warnings fatal (disabled because of gym in the wrappers) +SPHINXOPTS = -W # make warnings fatal (disabled because of gym in the wrappers) SPHINXBUILD = sphinx-build SPHINXPROJ = RLZoo SOURCEDIR = . diff --git a/docs/conda_env.yml b/docs/conda_env.yml index e59a94c13..9b0c845bf 100644 --- a/docs/conda_env.yml +++ b/docs/conda_env.yml @@ -5,8 +5,8 @@ channels: dependencies: - cpuonly=1.0=0 - pip=22.3.1 - - python=3.7 - - pytorch=1.11=py3.7_cpu_0 + - python=3.8 + - pytorch=1.13=py3.8_cpu_0 - pip: - cloudpickle - opencv-python-headless @@ -14,10 +14,10 @@ dependencies: - numpy - matplotlib - sphinx_autodoc_typehints - - sphinx>=4.2 + - sphinx>=5.3,<7.0 - sphinx_rtd_theme>=1.0 - sphinx_copybutton - - sb3-contrib>=1.7.0 + - sb3-contrib>=2.0.0 - optuna - huggingface_sb3>=2.2.1 - rich diff --git a/docs/guide/install.rst b/docs/guide/install.rst index dcd5c8587..57d77164b 100644 --- a/docs/guide/install.rst +++ b/docs/guide/install.rst @@ -6,7 +6,7 @@ Installation Prerequisites ------------- -RL Zoo requires python 3.7+ and PyTorch >= 1.11 +RL Zoo requires python 3.8+ and PyTorch >= 1.13 Minimal Installation diff --git a/pyproject.toml b/pyproject.toml index f6e97b2de..bcef440d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [tool.ruff] # Same as Black. line-length = 127 -# Assume Python 3.7 -target-version = "py37" +# Assume Python 3.8 +target-version = "py38" # See https://beta.ruff.rs/docs/rules/ select = ["E", "F", "B", "UP", "C90", "RUF"] # Ignore explicit stacklevel` diff --git a/rl_zoo3/version.txt b/rl_zoo3/version.txt index 227cea215..ecaf4eea7 100644 --- a/rl_zoo3/version.txt +++ b/rl_zoo3/version.txt @@ -1 +1 @@ -2.0.0 +2.1.0a0 diff --git a/rl_zoo3/wrappers.py b/rl_zoo3/wrappers.py index 4f51d472b..c9b7810ed 100644 --- a/rl_zoo3/wrappers.py +++ b/rl_zoo3/wrappers.py @@ -131,7 +131,7 @@ class HistoryWrapper(gym.Wrapper[np.ndarray, np.ndarray, np.ndarray, np.ndarray] Stack past observations and actions to give an history to the agent. :param env: - :param horizon:Number of steps to keep in the history. + :param horizon: Number of steps to keep in the history. """ def __init__(self, env: gym.Env, horizon: int = 2): diff --git a/setup.py b/setup.py index b0dd36492..c82de4bd6 100644 --- a/setup.py +++ b/setup.py @@ -50,8 +50,7 @@ long_description=long_description, long_description_content_type="text/markdown", version=__version__, - python_requires=">=3.7", - # PyPI package information. + python_requires=">=3.8", # PyPI package information. project_urls={ "Code": "https://github.com/DLR-RM/rl-baselines3-zoo", @@ -63,10 +62,10 @@ }, classifiers=[ "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ], )