Skip to content

Commit

Permalink
Packaging with pyproject.toml (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan authored Dec 5, 2022
1 parent 90cca7c commit bc0ca6c
Show file tree
Hide file tree
Showing 18 changed files with 164 additions and 168 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: python -m pip install --upgrade setuptools wheel
- name: Build wheels
run: python setup.py sdist bdist_wheel
run: python -m pip install --upgrade pip setuptools build
- name: Build sdist and wheels
run: python -m build
- name: Store wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: dist

Expand All @@ -58,7 +58,7 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download dists
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: |
docker build -f bin/all-py.Dockerfile \
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \
Expand All @@ -23,7 +23,7 @@ jobs:
runs-on:
ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: |
docker build -f bin/necessary-py.Dockerfile \
--build-arg PYTHON_VERSION='3.10' \
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install pre-commit
- run: pre-commit --version
- run: pre-commit install
- run: pre-commit run --all-files
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- run: python -m pip install pre-commit
- run: python -m pre_commit --version
- run: python -m pre_commit install
- run: python -m pre_commit run --all-files
6 changes: 3 additions & 3 deletions gymnasium/envs/mujoco/ant_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ class AntEnv(MujocoEnv, utils.EzPickle):
| `exclude_current_positions_from_observation`| **bool** | `True`| Whether or not to omit the x- and y-coordinates from observations. Excluding the position can serve as an inductive bias to induce position-agnostic behavior in policies |
## Version History
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
* v3: support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco_py >= 1.50
* v4: All MuJoCo environments now use the MuJoCo bindings in mujoco >= 2.1.3
* v3: Support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco-py >= 1.50
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
* v0: Initial versions release (1.0.0)
"""
Expand Down
6 changes: 3 additions & 3 deletions gymnasium/envs/mujoco/half_cheetah_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ class HalfCheetahEnv(MujocoEnv, utils.EzPickle):
## Version History
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
* v3: support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco_py >= 1.50
* v4: All MuJoCo environments now use the MuJoCo bindings in mujoco >= 2.1.3
* v3: Support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco-py >= 1.50
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
* v0: Initial versions release (1.0.0)
"""
Expand Down
6 changes: 3 additions & 3 deletions gymnasium/envs/mujoco/hopper_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ class HopperEnv(MujocoEnv, utils.EzPickle):
## Version History
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
* v3: support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco_py >= 1.50
* v4: All MuJoCo environments now use the MuJoCo bindings in mujoco >= 2.1.3
* v3: Support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco-py >= 1.50
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
* v0: Initial versions release (1.0.0)
"""
Expand Down
6 changes: 3 additions & 3 deletions gymnasium/envs/mujoco/humanoid_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ class HumanoidEnv(MujocoEnv, utils.EzPickle):
## Version History
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
* v3: support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco_py >= 1.50
* v4: All MuJoCo environments now use the MuJoCo bindings in mujoco >= 2.1.3
* v3: Support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco-py >= 1.50
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
* v0: Initial versions release (1.0.0)
"""
Expand Down
6 changes: 3 additions & 3 deletions gymnasium/envs/mujoco/humanoidstandup_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ class HumanoidStandupEnv(MujocoEnv, utils.EzPickle):
## Version History
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
* v3: support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco_py >= 1.50
* v4: All MuJoCo environments now use the MuJoCo bindings in mujoco >= 2.1.3
* v3: Support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco-py >= 1.50
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
* v0: Initial versions release (1.0.0)
"""
Expand Down
6 changes: 3 additions & 3 deletions gymnasium/envs/mujoco/inverted_double_pendulum_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ class InvertedDoublePendulumEnv(MujocoEnv, utils.EzPickle):
## Version History
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
* v3: support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco_py >= 1.50
* v4: All MuJoCo environments now use the MuJoCo bindings in mujoco >= 2.1.3
* v3: Support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco-py >= 1.50
* v1: max_time_steps raised to 1000 for robot based tasks (including inverted pendulum)
* v0: Initial versions release (1.0.0)
"""
Expand Down
6 changes: 3 additions & 3 deletions gymnasium/envs/mujoco/inverted_pendulum_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ class InvertedPendulumEnv(MujocoEnv, utils.EzPickle):
## Version History
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
* v3: support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco_py >= 1.50
* v4: All MuJoCo environments now use the MuJoCo bindings in mujoco >= 2.1.3
* v3: Support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco-py >= 1.50
* v1: max_time_steps raised to 1000 for robot based tasks (including inverted pendulum)
* v0: Initial versions release (1.0.0)
"""
Expand Down
4 changes: 2 additions & 2 deletions gymnasium/envs/mujoco/pusher_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ class PusherEnv(MujocoEnv, utils.EzPickle):
## Version History
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
* v2: All continuous control environments now use mujoco_py >= 1.50
* v4: All MuJoCo environments now use the MuJoCo bindings in mujoco >= 2.1.3
* v2: All continuous control environments now use mujoco-py >= 1.50
* v1: max_time_steps raised to 1000 for robot based tasks (not including reacher, which has a max_time_steps of 50). Added reward_threshold to environments.
* v0: Initial versions release (1.0.0)
"""
Expand Down
4 changes: 2 additions & 2 deletions gymnasium/envs/mujoco/reacher_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class ReacherEnv(MujocoEnv, utils.EzPickle):
## Version History
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
* v2: All continuous control environments now use mujoco_py >= 1.50
* v4: All MuJoCo environments now use the MuJoCo bindings in mujoco >= 2.1.3
* v2: All continuous control environments now use mujoco-py >= 1.50
* v1: max_time_steps raised to 1000 for robot based tasks (not including reacher, which has a max_time_steps of 50). Added reward_threshold to environments.
* v0: Initial versions release (1.0.0)
"""
Expand Down
6 changes: 3 additions & 3 deletions gymnasium/envs/mujoco/swimmer_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ class SwimmerEnv(MujocoEnv, utils.EzPickle):
## Version History
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
* v3: support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco_py >= 1.50
* v4: All MuJoCo environments now use the MuJoCo bindings in mujoco >= 2.1.3
* v3: Support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco-py >= 1.50
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
* v0: Initial versions release (1.0.0)
"""
Expand Down
6 changes: 3 additions & 3 deletions gymnasium/envs/mujoco/walker2d_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ class Walker2dEnv(MujocoEnv, utils.EzPickle):
## Version History
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
* v3: support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco_py >= 1.50
* v4: All MuJoCo environments now use the MuJoCo bindings in mujoco >= 2.1.3
* v3: Support for `gymnasium.make` kwargs such as `xml_file`, `ctrl_cost_weight`, `reset_noise_scale`, etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
* v2: All continuous control environments now use mujoco-py >= 1.50
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
* v0: Initial versions release (1.0.0)
"""
Expand Down
111 changes: 111 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,113 @@
# Package ######################################################################

[build-system]
requires = ["setuptools >= 61.0.0"]
build-backend = "setuptools.build_meta"

[project]
name = "gymnasium"
description = "A standard API for reinforcement learning and a diverse set of reference environments (formerly Gym)."
readme = "README.md"
requires-python = ">= 3.7"
authors = [{ name = "Farama Foundation", email = "[email protected]" }]
license = { text = "MIT License" }
keywords = ["Reinforcement Learning", "game", "RL", "AI", "gymnasium"]
classifiers = [
"Development Status :: 4 - Beta", # change to `5 - Production/Stable` when ready
"License :: OSI Approved :: MIT License",
"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",
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
]
dependencies = [
"numpy >=1.21.0",
"jax-jumpy >=0.2.0",
"cloudpickle >=1.2.0",
"importlib-metadata >=4.8.0; python_version < '3.10'",
"typing-extensions >=4.3.0; python_version == '3.7'",
"gymnasium-notices >=0.0.1",
"shimmy >=0.1.0,<1.0",
]
dynamic = ["version"]

[project.optional-dependencies]
# Update dependencies in `all` if any are added or removed
atari = ["shimmy[atari] >=0.1.0,<1.0"]
accept-rom-license = ["autorom[accept-rom-license] ~=0.4.2"]
box2d = ["box2d-py ==2.3.5", "pygame ==2.1.3.dev8", "swig ==4.*"]
classic-control = ["pygame ==2.1.3.dev8"]
classic_control = ["pygame ==2.1.3.dev8"] # kept for backward compatibility
mujoco-py = ["mujoco-py >=2.1,<2.2"]
mujoco_py = ["mujoco-py >=2.1,<2.2"] # kept for backward compatibility
mujoco = ["mujoco >=2.3.0", "imageio >=2.14.1"]
toy-text = ["pygame ==2.1.3.dev8"]
toy_text = ["pygame ==2.1.3.dev8"] # kept for backward compatibility
jax = ["jax ==0.3.20", "jaxlib ==0.3.20"]
other = [
"lz4 >=3.1.0",
"opencv-python >=3.0",
"matplotlib >=3.0",
"moviepy >=1.0.0",
"tensorflow >=2.1.0",
"torch >=1.0.0",
]
all = [
# All dependencies above except accept-rom-license
# NOTE: No need to manually remove the duplicates, setuptools automatically does that.
# atari
"shimmy[atari] >=0.1.0,<1.0",
# box2d
"box2d-py ==2.3.5",
"pygame ==2.1.3.dev8",
"swig ==4.*",
# classic-control
"pygame ==2.1.3.dev8",
# mujoco-py
"mujoco-py >=2.1,<2.2",
# mujoco
"mujoco >=2.3.0",
"imageio >=2.14.1",
# toy-text
"pygame ==2.1.3.dev8",
# jax
"jax ==0.3.20",
"jaxlib ==0.3.20",
# other
"lz4 >=3.1.0",
"opencv-python >=3.0",
"matplotlib >=3.0",
"moviepy >=1.0.0",
"tensorflow >=2.1.0",
"torch >=1.0.0",
]
testing = ["pytest ==7.1.3"]

[project.urls]
Homepage = "https://farama.org"
Repository = "https://github.com/Farama-Foundation/Gymnasium"
Documentation = "https://gymnasium.farama.org"
"Bug Report" = "https://github.com/Farama-Foundation/Gymnasium/issues"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
include = ["gymnasium", "gymnasium.*"]

[tool.setuptools.package-data]
gymnasium = [
"envs/mujoco/assets/*.xml",
"envs/classic_control/assets/*.png",
"envs/toy_text/font/*.ttf",
"envs/toy_text/img/*.png",
"py.typed",
]

# Linters and Test tools #######################################################

[tool.black]
Expand All @@ -7,6 +117,7 @@ safe = true
atomic = true
profile = "black"
src_paths = ["gymnasium", "tests", "docs/scripts"]
extra_standard_library = ["typing_extensions"]
indent = 4
lines_after_imports = 2
multi_line_output = 3
Expand Down
15 changes: 0 additions & 15 deletions requirements.txt

This file was deleted.

Loading

0 comments on commit bc0ca6c

Please sign in to comment.