From ece04490613643821baf1c3ebe875ceb1d0c86e3 Mon Sep 17 00:00:00 2001 From: elliottower Date: Sun, 16 Jul 2023 16:31:51 -0400 Subject: [PATCH] Test python 3.11 functionality --- .github/workflows/build-test.yml | 2 +- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- setup.py | 3 +-- shimmy/openai_gym_compatibility.py | 8 +------- shimmy/openspiel_compatibility.py | 1 + 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 4ede52c4..3cda091e 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -9,7 +9,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 - run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cac0c8dd..16b4c8b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,7 +38,7 @@ repos: rev: v2.32.0 hooks: - id: pyupgrade - args: ["--py37-plus"] + args: ["--py38-plus"] - repo: local hooks: - id: pyright diff --git a/pyproject.toml b/pyproject.toml index 96cb5b10..59888971 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ strict = [ ] typeCheckingMode = "basic" -pythonVersion = "3.7" +pythonVersion = "3.8" pythonPlatform = "All" enableTypeIgnoreComments = true # This is required as the CI pre-commit does not download the module (i.e. numpy, pygame, box2d) diff --git a/setup.py b/setup.py index dcdfffc8..5d9a171a 100644 --- a/setup.py +++ b/setup.py @@ -69,13 +69,12 @@ def get_version(): long_description=long_description, long_description_content_type="text/markdown", keywords=["Reinforcement Learning", "game", "RL", "AI"], - python_requires=">=3.7", + python_requires=">=3.8", packages=find_packages(), install_requires=["numpy>=1.18.0", "gymnasium>=0.27.0"], tests_require=extras["testing"], extras_require=extras, classifiers=[ - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/shimmy/openai_gym_compatibility.py b/shimmy/openai_gym_compatibility.py index cab5578d..3758adf2 100644 --- a/shimmy/openai_gym_compatibility.py +++ b/shimmy/openai_gym_compatibility.py @@ -3,7 +3,7 @@ from __future__ import annotations import sys -from typing import Any +from typing import Any, Protocol, runtime_checkable import gymnasium from gymnasium import error @@ -25,12 +25,6 @@ convert_to_terminated_truncated_step_api, ) -if sys.version_info >= (3, 8): - from typing import Protocol, runtime_checkable -else: - from typing_extensions import Protocol, runtime_checkable - - try: import gym import gym.wrappers diff --git a/shimmy/openspiel_compatibility.py b/shimmy/openspiel_compatibility.py index cba18856..cca221bd 100644 --- a/shimmy/openspiel_compatibility.py +++ b/shimmy/openspiel_compatibility.py @@ -1,3 +1,4 @@ +# pyright: reportGeneralTypeIssues=false """Wrapper to convert an OpenSpiel environment into a pettingzoo compatible environment.""" from __future__ import annotations