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

Convert existing Gym spec to Gymnasium #506

Closed
wants to merge 16 commits into from
147 changes: 139 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,147 @@
## ALE
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

## ALE
ale
build
doc/examples/*Example

## Generic

# Emacs temp files
*~
.*
Expand All @@ -20,15 +156,10 @@ doc/examples/*Example
*.o
*.d

# Compiled Dynamic libraries
*.so

# Compiled Static libraries
*.lai
*.la
*.a

# Python
*.pyc

*.egg-info/
3 changes: 2 additions & 1 deletion examples/python-interface/python_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# ALE provided in examples/sharedLibraryInterfaceExample.cpp
import sys
from random import randrange
from ale_py import ALEInterface, SDL_SUPPORT

from ale_py import SDL_SUPPORT, ALEInterface

if len(sys.argv) < 2:
print(f"Usage: {sys.argv[0]} rom_file")
Expand Down
3 changes: 2 additions & 1 deletion examples/python-interface/python_example_with_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# ALE provided in doc/examples/sharedLibraryInterfaceWithModesExample.cpp
import sys
from random import randrange
from ale_py import ALEInterface, SDL_SUPPORT

from ale_py import SDL_SUPPORT, ALEInterface

if len(sys.argv) < 2:
print(f"Usage: {sys.argv[0]} rom_file")
Expand Down
2 changes: 1 addition & 1 deletion examples/python-rom-package/roms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
import pathlib
import sys

if sys.version_info >= (3, 9):
import importlib.resources as resources
Expand Down
106 changes: 0 additions & 106 deletions md5.txt

This file was deleted.

28 changes: 5 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,27 @@ classifiers = [
]
dependencies = [
"numpy",
"gymnasium",
"importlib-metadata>=4.10.0; python_version < '3.10'",
"importlib-resources; python_version < '3.9'",
"typing-extensions; python_version < '3.11'"
"typing-extensions; python_version < '3.11'",
]
dynamic = ["version"]

[project.optional-dependencies]
test = [
"pytest>=7.0",
"gym~=0.23",
]

[project.urls]
homepage = "https://github.com/mgbellemare/Arcade-Learning-Environment"
documentation = "https://github.com/mgbellemare/Arcade-Learning-Environment/tree/master/docs"
changelog = "https://github.com/mgbellemare/Arcade-Learning-Environment/blob/master/CHANGELOG.md"

[project.scripts]
ale-import-roms = "ale_py.scripts.import_roms:main"

[project.entry-points."gym.envs"]
ALE = "ale_py.gym:register_gym_envs"
__internal__ = "ale_py.gym:register_legacy_gym_envs"

[tool.setuptools]
packages = [
"ale_py",
"ale_py.roms",
"ale_py.env",
"ale_py.scripts"
]
package-dir = {ale_py = "src/python", gym = "src/gym"}
package-data = {"ale_py" = ["py.typed", "*.pyi", "**/*.pyi"], "ale_py.roms" = ["*.bin", "md5.txt"]}
packages = ["ale_py", "ale_py.roms"]
package-dir = {ale_py = "src/python"}
package-data = {"ale_py" = ["py.typed", "*.pyi", "**/*.pyi"], "ale_py.roms" = ["*.bin", "md5.json"]}

[tool.pytest.ini_options]
minversion = "7.0"
Expand All @@ -79,12 +67,6 @@ skip = ["*-win32", "*i686", "pp*", "*-musllinux*"]

build-frontend = "build"

# Test configuration
# test-extras = ["test"]
# TODO(jfarebro): Temporarily use upstream Gym until v26 release.
test-requires = ["pytest", "git+https://github.com/openai/gym#egg=gym"]
test-command = "pytest {project}"

# vcpkg manylinux images
manylinux-x86_64-image = "ghcr.io/jessefarebro/manylinux2014_x86_64-vcpkg"

Expand Down
Loading
Loading