From 7a0f446406beafbe3623a87ed34cd3d608fac617 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 12:34:37 +0200 Subject: [PATCH 01/32] Switching to pyproject.toml; setup.py will remain for backwards compat --- pyproject.toml | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 3 +++ 2 files changed, 71 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..053c1b8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,68 @@ +[project] +name = "fancy_gym" +version = "1.0" +description = "Fancy Gym: Unifying interface for various RL benchmarks with support for Black Box approaches." +readme = "README.md" +authors = [ + {name = "Fabian Otto", email = "fabian.otto@uni-tuebingen.de"}, + {name = "Onur Celik", email = "celik@kit.edu"}, + {name = "Dominik Roth", email = "fancy_gym@dominik-roth.eu"}, + {name = "Hongyi Zhou", email = "hongyi.zhou@kit.edu"} +] +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "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" +] +homepage = "https://github.com/ALRhub/fancy_gym/" +repository = "https://github.com/ALRhub/fancy_gym/" + +[project.urls] +Homepage = "https://github.com/ALRhub/fancy_gym/" + +[build-system] +requires = ["setuptools>=51.0.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project.scripts] +# If you have any entry points (scripts), define them here. + +[project.dependencies] +gymnasium = ">=0.26.0" +mp_pytorch = "<=0.1.3" + +[project.optional-dependencies] +dmc = ["shimmy[dm-control]", "Shimmy==1.0.0"] +metaworld = ["metaworld @ git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439#egg=metaworld"] +box2d = ["gymnasium[box2d]>=0.26.0"] +mujoco = ["mujoco==2.3.3", "gymnasium[mujoco]>0.26.0"] +mujoco-legacy = ["mujoco-py>=2.1,<2.2", "cython<3"] +jax = ["jax>=0.4.0", "jaxlib>=0.4.0"] + +testing = [ + "pytest", + # include all the optional dependencies as well + "shimmy[dm-control]", + "Shimmy==1.0.0", + "metaworld @ git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439#egg=metaworld", + "gymnasium[box2d]>=0.26.0", + "mujoco==2.3.3", + "gymnasium[mujoco]>0.26.0", + "mujoco-py>=2.1,<2.2", + "cython<3", + "jax>=0.4.0", + "jaxlib>=0.4.0" +] + +[project.python-requires] +python_version = ">=3.7" diff --git a/setup.py b/setup.py index 1daa568..24dda38 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +# We still provide a setup.py for backwards compatability. +# But the pyproject.toml should be prefered. import itertools from pathlib import Path from typing import List @@ -48,6 +50,7 @@ setup( 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], extras_require=extras, install_requires=[ From 10038f5d731e85184c0537aa10c7ce3db487be21 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 12:34:55 +0200 Subject: [PATCH 02/32] We need to use a MANIFEST rto insure inclusion of our *.stl and *.xml files --- MANIFEST.in | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..a19bc97 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,9 @@ +# Include the README +include README.md + +# Include the license file +include LICENSE + +# Include stl and xml files from the fancy_gym/envs/mujoco directory +recursive-include fancy_gym/envs/mujoco *.stl +recursive-include fancy_gym/envs/mujoco *.xml From d10ea23b4c010ab148b973bbd2f3db50af0eff8a Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 12:41:55 +0200 Subject: [PATCH 03/32] Added Code of Conduct and Contributing guidelines to the MANIFEST --- MANIFEST.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index a19bc97..47ae90a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,8 +1,10 @@ # Include the README include README.md -# Include the license file +# Include the license, Code of Conduct and Contributing guidelines include LICENSE +include CODE_OF_CONDUCT.md +include CONTRIBUTING.md # Include stl and xml files from the fancy_gym/envs/mujoco directory recursive-include fancy_gym/envs/mujoco *.stl From a5a29176cb0fcad62d7e2267a8e207034b7fe56f Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 12:46:53 +0200 Subject: [PATCH 04/32] Add 'all' as an optional installation to the toml --- pyproject.toml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 053c1b8..4e844cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,21 +43,34 @@ mp_pytorch = "<=0.1.3" [project.optional-dependencies] dmc = ["shimmy[dm-control]", "Shimmy==1.0.0"] -metaworld = ["metaworld @ git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439#egg=metaworld"] +# PyPi does not allow external dependencies. Metaworld will have to be installed manually until Farama publishes up-to-date version of metaworld on PyPi. +#metaworld = ["metaworld @ git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439#egg=metaworld"] box2d = ["gymnasium[box2d]>=0.26.0"] mujoco = ["mujoco==2.3.3", "gymnasium[mujoco]>0.26.0"] mujoco-legacy = ["mujoco-py>=2.1,<2.2", "cython<3"] jax = ["jax>=0.4.0", "jaxlib>=0.4.0"] +all = [ + # include all the optional dependencies + "shimmy[dm-control]", + "Shimmy==1.0.0", + #"metaworld @ git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439#egg=metaworld", + "mujoco==2.3.3", + "gymnasium[box2d,mujoco]>=0.26.0", + "mujoco-py>=2.1,<2.2", + "cython<3", + "jax>=0.4.0", + "jaxlib>=0.4.0" +] + testing = [ "pytest", # include all the optional dependencies as well "shimmy[dm-control]", "Shimmy==1.0.0", - "metaworld @ git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439#egg=metaworld", - "gymnasium[box2d]>=0.26.0", + #"metaworld @ git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439#egg=metaworld", "mujoco==2.3.3", - "gymnasium[mujoco]>0.26.0", + "gymnasium[box2d,mujoco]>=0.26.0", "mujoco-py>=2.1,<2.2", "cython<3", "jax>=0.4.0", From ee573788fc47a79c34a106cb3ad792c7190ef5a9 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 12:55:32 +0200 Subject: [PATCH 05/32] Fix: pyproject.toml license needs to point to file --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4e844cb..5c96ba1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ {name = "Dominik Roth", email = "fancy_gym@dominik-roth.eu"}, {name = "Hongyi Zhou", email = "hongyi.zhou@kit.edu"} ] -license = "MIT" +license = { file = "LICENSE" } classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", From b6c67b1adc67bfe0e0b1814d66200228f967daca Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 13:04:16 +0200 Subject: [PATCH 06/32] The pyproject.toml now actually works --- pyproject.toml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5c96ba1..8a49117 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,8 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11" ] -homepage = "https://github.com/ALRhub/fancy_gym/" -repository = "https://github.com/ALRhub/fancy_gym/" + +requires-python = ">=3.7" [project.urls] Homepage = "https://github.com/ALRhub/fancy_gym/" @@ -34,12 +34,10 @@ Homepage = "https://github.com/ALRhub/fancy_gym/" requires = ["setuptools>=51.0.0", "wheel"] build-backend = "setuptools.build_meta" -[project.scripts] -# If you have any entry points (scripts), define them here. - -[project.dependencies] -gymnasium = ">=0.26.0" -mp_pytorch = "<=0.1.3" +project.dependencies = [ + "gymnasium>=0.26.0", + "mp_pytorch<=0.1.3" +] [project.optional-dependencies] dmc = ["shimmy[dm-control]", "Shimmy==1.0.0"] @@ -76,6 +74,3 @@ testing = [ "jax>=0.4.0", "jaxlib>=0.4.0" ] - -[project.python-requires] -python_version = ">=3.7" From ce779bc6fb788955c4670068938010f4a1ff66a6 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 14:55:00 +0200 Subject: [PATCH 07/32] Make mujoco (modern version) a required dependency --- pyproject.toml | 17 +++++++++-------- setup.py | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8a49117..2d2c8c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,26 +25,27 @@ classifiers = [ "Programming Language :: Python :: 3.11" ] +dependencies = [ + "mp_pytorch<=0.1.3", + "mujoco==2.3.3", + "gymnasium[mujoco]>0.26.0" +] + requires-python = ">=3.7" [project.urls] -Homepage = "https://github.com/ALRhub/fancy_gym/" +"Homepage" = "https://github.com/ALRhub/fancy_gym/" +"Bug Tracker" = "https://github.com/ALRhub/fancy_gym/issues" [build-system] -requires = ["setuptools>=51.0.0", "wheel"] +requires = ["setuptools>=61.0.0", "wheel"] build-backend = "setuptools.build_meta" -project.dependencies = [ - "gymnasium>=0.26.0", - "mp_pytorch<=0.1.3" -] - [project.optional-dependencies] dmc = ["shimmy[dm-control]", "Shimmy==1.0.0"] # PyPi does not allow external dependencies. Metaworld will have to be installed manually until Farama publishes up-to-date version of metaworld on PyPi. #metaworld = ["metaworld @ git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439#egg=metaworld"] box2d = ["gymnasium[box2d]>=0.26.0"] -mujoco = ["mujoco==2.3.3", "gymnasium[mujoco]>0.26.0"] mujoco-legacy = ["mujoco-py>=2.1,<2.2", "cython<3"] jax = ["jax>=0.4.0", "jaxlib>=0.4.0"] diff --git a/setup.py b/setup.py index 24dda38..cf2397f 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,6 @@ extras = { 'dmc': ['shimmy[dm-control]', 'Shimmy==1.0.0'], 'metaworld': ['metaworld @ git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439#egg=metaworld'], 'box2d': ['gymnasium[box2d]>=0.26.0'], - 'mujoco': ['mujoco==2.3.3', 'gymnasium[mujoco]>0.26.0'], 'mujoco-legacy': ['mujoco-py >=2.1,<2.2', 'cython<3'], 'jax': ["jax >=0.4.0", "jaxlib >=0.4.0"], } @@ -54,8 +53,9 @@ setup( ], extras_require=extras, install_requires=[ - 'gymnasium>=0.26.0', 'mp_pytorch<=0.1.3' + 'mujoco==2.3.3', + 'gymnasium[mujoco]>0.26.0'] ], packages=[package for package in find_packages( ) if package.startswith("fancy_gym")], From 6528c5d5b9bfe311282c87ca02b8dbd22be2c14e Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 14:55:15 +0200 Subject: [PATCH 08/32] Update README (Test-PyPI and dependency changes) --- README.md | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c457932..bedb5c3 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@

+ | :exclamation: Fancy Gym has recently received a major refactor, which also updated many of the used dependencies to current versions. The update has brought some breaking changes. If you want to access the old version, check out the [legacy branch](https://github.com/ALRhub/fancy_gym/tree/legacy). Find out more about what changed [here](https://github.com/ALRhub/fancy_gym/pull/75). | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -33,6 +34,32 @@ While the overarching objective of MP environments remains the learning of an op ## Installation +### Installation via pip (recommended) + +While the publication of `fancy_gym` on PyPI is still pending, you can install it from Test-PyPI. +```bash +pip install --index-url https://test.pypi.org/simple/ fancy_gym +``` + +We have a few optional dependencies. If you also want to install those use + +```bash +# to install all optional dependencies +pip install --index-url https://test.pypi.org/simple/ 'fancy_gym[all]' + +# or choose only those you want +pip install --index-url https://test.pypi.org/simple/ 'fancy_gym[dmc,box2d,mujoco-legacy,jax,testing]' +``` + +Pip can not automatically install up-to-date versions of metaworld, since they are not avaible on PyPI yet. +Install metaworld via + +```bash +pip install metaworld@git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439#egg=metaworld +``` + +### Installation from master + 1. Clone the repository ```bash @@ -54,8 +81,16 @@ pip install -e . We have a few optional dependencies. If you also want to install those use ```bash -pip install -e '.[all]' # to install all optional dependencies -pip install -e '.[dmc,metaworld,box2d,mujoco,mujoco-legacy,jax,testing]' # or choose only those you want +# to install all optional dependencies +pip install -e '.[all]' + +# or choose only those you want +pip install -e '.[dmc,box2d,mujoco-legacy,jax,testing]' +``` + +Metaworld has to be installed manually with +```bash +pip install metaworld@git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439#egg=metaworld ``` ## How to use Fancy Gym From 95a6b9cf2c26cca90ea72b5d069febc655c8e0cb Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 14:56:02 +0200 Subject: [PATCH 09/32] README: Minor cosmetic changes --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bedb5c3..a359fa5 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ -

+



- Fancy Gym + Fancy Gym

-

- + | :exclamation: Fancy Gym has recently received a major refactor, which also updated many of the used dependencies to current versions. The update has brought some breaking changes. If you want to access the old version, check out the [legacy branch](https://github.com/ALRhub/fancy_gym/tree/legacy). Find out more about what changed [here](https://github.com/ALRhub/fancy_gym/pull/75). | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 894982f77f6c40df4d0fcb2fd46d8eaf321c92d6 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 15:30:11 +0200 Subject: [PATCH 10/32] Fix typos in setup.py --- setup.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index cf2397f..65d64a3 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,6 @@ from setuptools import setup, find_packages # Environment-specific dependencies for dmc and metaworld extras = { 'dmc': ['shimmy[dm-control]', 'Shimmy==1.0.0'], - 'metaworld': ['metaworld @ git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439#egg=metaworld'], 'box2d': ['gymnasium[box2d]>=0.26.0'], 'mujoco-legacy': ['mujoco-py >=2.1,<2.2', 'cython<3'], 'jax': ["jax >=0.4.0", "jaxlib >=0.4.0"], @@ -53,9 +52,9 @@ setup( ], extras_require=extras, install_requires=[ - 'mp_pytorch<=0.1.3' + 'mp_pytorch<=0.1.3', 'mujoco==2.3.3', - 'gymnasium[mujoco]>0.26.0'] + 'gymnasium[mujoco]>0.26.0' ], packages=[package for package in find_packages( ) if package.startswith("fancy_gym")], From a5b10e11a363a71f651f9a69328fcdab509eb4f8 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 15:34:10 +0200 Subject: [PATCH 11/32] Allow gymnasium==0.26.0 --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2d2c8c2..4ad9197 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ dependencies = [ "mp_pytorch<=0.1.3", "mujoco==2.3.3", - "gymnasium[mujoco]>0.26.0" + "gymnasium[mujoco]>=0.26.0" ] requires-python = ">=3.7" diff --git a/setup.py b/setup.py index 65d64a3..f11769c 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ setup( install_requires=[ 'mp_pytorch<=0.1.3', 'mujoco==2.3.3', - 'gymnasium[mujoco]>0.26.0' + 'gymnasium[mujoco]>=0.26.0' ], packages=[package for package in find_packages( ) if package.startswith("fancy_gym")], From 0c932807960f66a50c65e650843e535739e08220 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 15:34:36 +0200 Subject: [PATCH 12/32] Improve handling of missing Metaworld --- fancy_gym/meta/__init__.py | 102 +++++++++++++++------------- fancy_gym/meta/metaworld_adapter.py | 6 +- 2 files changed, 56 insertions(+), 52 deletions(-) diff --git a/fancy_gym/meta/__init__.py b/fancy_gym/meta/__init__.py index 78ec73c..73c0a1f 100644 --- a/fancy_gym/meta/__init__.py +++ b/fancy_gym/meta/__init__.py @@ -7,56 +7,64 @@ from ..envs.registry import register from . import goal_object_change_mp_wrapper, goal_change_mp_wrapper, goal_endeffector_change_mp_wrapper, \ object_change_mp_wrapper -from . import metaworld_adapter +try: + import metaworld +except ModuleNotFoundError: + print('[FANCY GYM] Metaworld not avaible.') +else: + # Will only get executed, if import succeeds -metaworld_adapter.register_all_ML1() + from . import metaworld_adapter -ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS = {"DMP": [], "ProMP": [], "ProDMP": []} + metaworld_adapter.register_all_ML1() -# MetaWorld -_goal_change_envs = ["assembly-v2", "pick-out-of-hole-v2", "plate-slide-v2", "plate-slide-back-v2", - "plate-slide-side-v2", "plate-slide-back-side-v2"] -for _task in _goal_change_envs: - register( - id=f'metaworld/{_task}', - register_step_based=False, - mp_wrapper=goal_change_mp_wrapper.MPWrapper, - add_mp_types=['ProMP', 'ProDMP'], - ) + ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS = {"DMP": [], "ProMP": [], "ProDMP": []} -_object_change_envs = ["bin-picking-v2", "hammer-v2", "sweep-into-v2"] -for _task in _object_change_envs: - register( - id=f'metaworld/{_task}', - register_step_based=False, - mp_wrapper=object_change_mp_wrapper.MPWrapper, - add_mp_types=['ProMP', 'ProDMP'], - ) + # MetaWorld + _goal_change_envs = ["assembly-v2", "pick-out-of-hole-v2", "plate-slide-v2", "plate-slide-back-v2", + "plate-slide-side-v2", "plate-slide-back-side-v2"] + for _task in _goal_change_envs: + register( + id=f'metaworld/{_task}', + register_step_based=False, + mp_wrapper=goal_change_mp_wrapper.MPWrapper, + add_mp_types=['ProMP', 'ProDMP'], + ) -_goal_and_object_change_envs = ["box-close-v2", "button-press-v2", "button-press-wall-v2", "button-press-topdown-v2", - "button-press-topdown-wall-v2", "coffee-button-v2", "coffee-pull-v2", - "coffee-push-v2", "dial-turn-v2", "disassemble-v2", "door-close-v2", - "door-lock-v2", "door-open-v2", "door-unlock-v2", "hand-insert-v2", - "drawer-close-v2", "drawer-open-v2", "faucet-open-v2", "faucet-close-v2", - "handle-press-side-v2", "handle-press-v2", "handle-pull-side-v2", - "handle-pull-v2", "lever-pull-v2", "peg-insert-side-v2", "pick-place-wall-v2", - "reach-v2", "push-back-v2", "push-v2", "pick-place-v2", "peg-unplug-side-v2", - "soccer-v2", "stick-push-v2", "stick-pull-v2", "push-wall-v2", "reach-wall-v2", - "shelf-place-v2", "sweep-v2", "window-open-v2", "window-close-v2" - ] -for _task in _goal_and_object_change_envs: - register( - id=f'metaworld/{_task}', - register_step_based=False, - mp_wrapper=goal_object_change_mp_wrapper.MPWrapper, - add_mp_types=['ProMP', 'ProDMP'], - ) + _object_change_envs = ["bin-picking-v2", "hammer-v2", "sweep-into-v2"] + for _task in _object_change_envs: + register( + id=f'metaworld/{_task}', + register_step_based=False, + mp_wrapper=object_change_mp_wrapper.MPWrapper, + add_mp_types=['ProMP', 'ProDMP'], + ) -_goal_and_endeffector_change_envs = ["basketball-v2"] -for _task in _goal_and_endeffector_change_envs: - register( - id=f'metaworld/{_task}', - register_step_based=False, - mp_wrapper=goal_endeffector_change_mp_wrapper.MPWrapper, - add_mp_types=['ProMP', 'ProDMP'], - ) + _goal_and_object_change_envs = ["box-close-v2", "button-press-v2", "button-press-wall-v2", "button-press-topdown-v2", + "button-press-topdown-wall-v2", "coffee-button-v2", "coffee-pull-v2", + "coffee-push-v2", "dial-turn-v2", "disassemble-v2", "door-close-v2", + "door-lock-v2", "door-open-v2", "door-unlock-v2", "hand-insert-v2", + "drawer-close-v2", "drawer-open-v2", "faucet-open-v2", "faucet-close-v2", + "handle-press-side-v2", "handle-press-v2", "handle-pull-side-v2", + "handle-pull-v2", "lever-pull-v2", "peg-insert-side-v2", "pick-place-wall-v2", + "reach-v2", "push-back-v2", "push-v2", "pick-place-v2", "peg-unplug-side-v2", + "soccer-v2", "stick-push-v2", "stick-pull-v2", "push-wall-v2", "reach-wall-v2", + "shelf-place-v2", "sweep-v2", "window-open-v2", "window-close-v2" + ] + for _task in _goal_and_object_change_envs: + register( + id=f'metaworld/{_task}', + register_step_based=False, + mp_wrapper=goal_object_change_mp_wrapper.MPWrapper, + add_mp_types=['ProMP', 'ProDMP'], + ) + + _goal_and_endeffector_change_envs = ["basketball-v2"] + for _task in _goal_and_endeffector_change_envs: + register( + id=f'metaworld/{_task}', + register_step_based=False, + mp_wrapper=goal_endeffector_change_mp_wrapper.MPWrapper, + add_mp_types=['ProMP', 'ProDMP'], + ) +` \ No newline at end of file diff --git a/fancy_gym/meta/metaworld_adapter.py b/fancy_gym/meta/metaworld_adapter.py index 21dfed7..7853378 100644 --- a/fancy_gym/meta/metaworld_adapter.py +++ b/fancy_gym/meta/metaworld_adapter.py @@ -11,11 +11,7 @@ import numpy as np from fancy_gym.utils.env_compatibility import EnvCompatibility -try: - import metaworld -except Exception: - print('[FANCY GYM] Metaworld not avaible') - +import metaworld class FixMetaworldHasIncorrectObsSpaceWrapper(gym.Wrapper, gym.utils.RecordConstructorArgs): def __init__(self, env: gym.Env): From 3f0c7b73028ab7429b91db49a36098d0997eff4f Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 15:37:39 +0200 Subject: [PATCH 13/32] Removing setup.py (built pipeline prefered it over pyproject.toml causing issues) setup.py remains avaible on the legacy branch. --- setup.py | 69 -------------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index f11769c..0000000 --- a/setup.py +++ /dev/null @@ -1,69 +0,0 @@ -# We still provide a setup.py for backwards compatability. -# But the pyproject.toml should be prefered. -import itertools -from pathlib import Path -from typing import List - -from setuptools import setup, find_packages - -# Environment-specific dependencies for dmc and metaworld -extras = { - 'dmc': ['shimmy[dm-control]', 'Shimmy==1.0.0'], - 'box2d': ['gymnasium[box2d]>=0.26.0'], - 'mujoco-legacy': ['mujoco-py >=2.1,<2.2', 'cython<3'], - 'jax': ["jax >=0.4.0", "jaxlib >=0.4.0"], -} - -# All dependencies -all_groups = set(extras.keys()) -extras["all"] = list(set(itertools.chain.from_iterable( - map(lambda group: extras[group], all_groups)))) - -extras['testing'] = extras["all"] + ['pytest'] - - -def find_package_data(extensions_to_include: List[str]) -> List[str]: - envs_dir = Path("fancy_gym/envs/mujoco") - package_data_paths = [] - for extension in extensions_to_include: - package_data_paths.extend([str(path)[10:] - for path in envs_dir.rglob(extension)]) - - return package_data_paths - - -setup( - author='Fabian Otto, Onur Celik, Dominik Roth, Hongyi Zhou', - name='fancy_gym', - version='1.0', - classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: English', - 'Operating System :: OS Independent', - 'Topic :: Scientific/Engineering :: Artificial Intelligence', - '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', - ], - extras_require=extras, - install_requires=[ - 'mp_pytorch<=0.1.3', - 'mujoco==2.3.3', - 'gymnasium[mujoco]>=0.26.0' - ], - packages=[package for package in find_packages( - ) if package.startswith("fancy_gym")], - package_data={ - "fancy_gym": find_package_data(extensions_to_include=["*.stl", "*.xml"]) - }, - python_requires=">=3.7", - url='https://github.com/ALRhub/fancy_gym/', - license='MIT license', - author_email='', - description='Fancy Gym: Unifying interface for various RL benchmarks with support for Black Box approaches.' -) From 9565f7972f61069251dc965d8510bd3cac6eac75 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 15:48:19 +0200 Subject: [PATCH 14/32] removed typo --- fancy_gym/meta/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fancy_gym/meta/__init__.py b/fancy_gym/meta/__init__.py index 73c0a1f..6e95719 100644 --- a/fancy_gym/meta/__init__.py +++ b/fancy_gym/meta/__init__.py @@ -66,5 +66,4 @@ else: register_step_based=False, mp_wrapper=goal_endeffector_change_mp_wrapper.MPWrapper, add_mp_types=['ProMP', 'ProDMP'], - ) -` \ No newline at end of file + ) \ No newline at end of file From b0b58675b2f9af7699a0c7d469b507e066548534 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 15:53:41 +0200 Subject: [PATCH 15/32] Don't try to export metaworld envs, if metaworld is not installed --- fancy_gym/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fancy_gym/__init__.py b/fancy_gym/__init__.py index c3adaad..4c55a73 100644 --- a/fancy_gym/__init__.py +++ b/fancy_gym/__init__.py @@ -6,7 +6,10 @@ from .envs.registry import ALL_MOVEMENT_PRIMITIVE_ENVIRONMENTS, MOVEMENT_PRIMITI ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS = MOVEMENT_PRIMITIVE_ENVIRONMENTS_FOR_NS['dm_control'] ALL_FANCY_MOVEMENT_PRIMITIVE_ENVIRONMENTS = MOVEMENT_PRIMITIVE_ENVIRONMENTS_FOR_NS['fancy'] -ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS = MOVEMENT_PRIMITIVE_ENVIRONMENTS_FOR_NS['metaworld'] +if 'metaworld' in MOVEMENT_PRIMITIVE_ENVIRONMENTS_FOR_NS: + ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS = MOVEMENT_PRIMITIVE_ENVIRONMENTS_FOR_NS['metaworld'] +else: + ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS = 'Metaworld is not installed.' ALL_GYM_MOVEMENT_PRIMITIVE_ENVIRONMENTS = MOVEMENT_PRIMITIVE_ENVIRONMENTS_FOR_NS['gym'] From 9538c999a01d36e6f96987d19a5f9ccbd25b9923 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 16:46:45 +0200 Subject: [PATCH 16/32] Make sure the icon is always loaded from GitHub So it is also visible on PyPI --- MANIFEST.in | 3 +++ README.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 47ae90a..b1b03cf 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,3 +9,6 @@ include CONTRIBUTING.md # Include stl and xml files from the fancy_gym/envs/mujoco directory recursive-include fancy_gym/envs/mujoco *.stl recursive-include fancy_gym/envs/mujoco *.xml + +# Also shipping the most important part of fancy gym +include icon.svg diff --git a/README.md b/README.md index a359fa5..8fee031 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- +

Fancy Gym

From a50d1788b15a79fbd26a25e3e19315dee6c6b653 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 16:54:45 +0200 Subject: [PATCH 17/32] PyPI does not support GitHub-Flavored Markdown. Using HTML-Code for emojis now... --- README.md | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8fee031..4c4b274 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@

-| :exclamation: Fancy Gym has recently received a major refactor, which also updated many of the used dependencies to current versions. The update has brought some breaking changes. If you want to access the old version, check out the [legacy branch](https://github.com/ALRhub/fancy_gym/tree/legacy). Find out more about what changed [here](https://github.com/ALRhub/fancy_gym/pull/75). | +| ❗ Fancy Gym has recently received a major refactor, which also updated many of the used dependencies to current versions. The update has brought some breaking changes. If you want to access the old version, check out the [legacy branch](https://github.com/ALRhub/fancy_gym/tree/legacy). Find out more about what changed [here](https://github.com/ALRhub/fancy_gym/pull/75). | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | Built upon the foundation of [Gymnasium](https://gymnasium.farama.org/) (a maintained fork of OpenAI’s renowned Gym library) `fancy_gym` offers a comprehensive collection of reinforcement learning environments. @@ -100,7 +100,7 @@ We will only show the basics here and prepared [multiple examples](fancy_gym/exa Regular step based environments added by Fancy Gym are added into the `fancy/` namespace. -| :exclamation: Legacy versions of Fancy Gym used `fancy_gym.make(...)`. This is no longer supported and will raise an Exception on new versions. | +| ❗ Legacy versions of Fancy Gym used `fancy_gym.make(...)`. This is no longer supported and will raise an Exception on new versions. | | ----------------------------------------------------------------------------------------------------------------------------------------------- | ```python diff --git a/pyproject.toml b/pyproject.toml index 4ad9197..1de8265 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fancy_gym" -version = "1.0" +version = "1.0.2" description = "Fancy Gym: Unifying interface for various RL benchmarks with support for Black Box approaches." readme = "README.md" authors = [ From 4107704d9aead2d9dc5ad4b5d031a769e49fb4f5 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 17:01:51 +0200 Subject: [PATCH 18/32] Fix install instructions (look in both Test-PyPI & PyPI) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4c4b274..bb7e895 100644 --- a/README.md +++ b/README.md @@ -37,17 +37,17 @@ While the overarching objective of MP environments remains the learning of an op While the publication of `fancy_gym` on PyPI is still pending, you can install it from Test-PyPI. ```bash -pip install --index-url https://test.pypi.org/simple/ fancy_gym +pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple fancy_gym ``` We have a few optional dependencies. If you also want to install those use ```bash # to install all optional dependencies -pip install --index-url https://test.pypi.org/simple/ 'fancy_gym[all]' +pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple 'fancy_gym[all]' # or choose only those you want -pip install --index-url https://test.pypi.org/simple/ 'fancy_gym[dmc,box2d,mujoco-legacy,jax,testing]' +pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple 'fancy_gym[dmc,box2d,mujoco-legacy,jax,testing]' ``` Pip can not automatically install up-to-date versions of metaworld, since they are not avaible on PyPI yet. From 6fea48f6c1df524c8a3a45f14070103c2d913989 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 17:04:03 +0200 Subject: [PATCH 19/32] Increment version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1de8265..a5ecb16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fancy_gym" -version = "1.0.2" +version = "1.0.3" description = "Fancy Gym: Unifying interface for various RL benchmarks with support for Black Box approaches." readme = "README.md" authors = [ From ebb0e0067597d7f117f9d830838da3737e50171d Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 17:11:19 +0200 Subject: [PATCH 20/32] Minor changes to pyproject.toml --- pyproject.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a5ecb16..bae10fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fancy_gym" -version = "1.0.3" +version = "1.0.4" description = "Fancy Gym: Unifying interface for various RL benchmarks with support for Black Box approaches." readme = "README.md" authors = [ @@ -9,7 +9,7 @@ authors = [ {name = "Dominik Roth", email = "fancy_gym@dominik-roth.eu"}, {name = "Hongyi Zhou", email = "hongyi.zhou@kit.edu"} ] -license = { file = "LICENSE" } +license = { text = "MIT License" } classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", @@ -35,7 +35,9 @@ requires-python = ">=3.7" [project.urls] "Homepage" = "https://github.com/ALRhub/fancy_gym/" +#"Documentation" = "https://github.com/ALRhub/fancy_gym/" "Bug Tracker" = "https://github.com/ALRhub/fancy_gym/issues" +#"Repository" = "https://github.com/ALRhub/fancy_gym/" [build-system] requires = ["setuptools>=61.0.0", "wheel"] From 4051a13324344defacfc0891084b2919358c982b Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 17:47:34 +0200 Subject: [PATCH 21/32] README: GitHub ignores custom font-size; reverting to using h1 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bb7e895..74f0ccf 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -
+




- Fancy Gym + Fancy Gym

-

+ | ❗ Fancy Gym has recently received a major refactor, which also updated many of the used dependencies to current versions. The update has brought some breaking changes. If you want to access the old version, check out the [legacy branch](https://github.com/ALRhub/fancy_gym/tree/legacy). Find out more about what changed [here](https://github.com/ALRhub/fancy_gym/pull/75). | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From a7031ce3b999188dde72b64dc8e196849abdcdb0 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 12 Oct 2023 17:58:11 +0200 Subject: [PATCH 22/32] Version dump --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bae10fa..89075d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fancy_gym" -version = "1.0.4" +version = "1.0.5" description = "Fancy Gym: Unifying interface for various RL benchmarks with support for Black Box approaches." readme = "README.md" authors = [ From 0b240b9eb4b99d1458286610c6a52111b3135083 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sat, 14 Oct 2023 12:24:04 +0200 Subject: [PATCH 23/32] Define Github Action for test-PyPI publication --- .github/workflows/publish-to-test-pypi.yml | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/publish-to-test-pypi.yml diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml new file mode 100644 index 0000000..53393b4 --- /dev/null +++ b/.github/workflows/publish-to-test-pypi.yml @@ -0,0 +1,38 @@ +name: Publish Python package to TestPyPI + +on: + push: + tags: + - '*' + +jobs: + publish: + name: Publish to TestPyPI + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') # Only run on tagged commits + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install pypa/build/setuptools/twine + run: >- + python3 -m + pip install + build setuptools twine + --user + + - name: Build a binary wheel and a source tarball + run: python3 -m build + + - name: Publish to TestPyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: twine upload --repository-url https://test.pypi.org/legacy/ dist/* + From 5e63a7288251700db575ffb7d8aa48d742cc00c6 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sat, 14 Oct 2023 12:36:35 +0200 Subject: [PATCH 24/32] Version bump (to test Github Action) --- .github/workflows/publish-to-test-pypi.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 53393b4..b348845 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -33,6 +33,6 @@ jobs: - name: Publish to TestPyPI env: TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} run: twine upload --repository-url https://test.pypi.org/legacy/ dist/* diff --git a/pyproject.toml b/pyproject.toml index 89075d4..8db9546 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fancy_gym" -version = "1.0.5" +version = "1.0.6" description = "Fancy Gym: Unifying interface for various RL benchmarks with support for Black Box approaches." readme = "README.md" authors = [ From b183c002ef36a65bc9199115f7db6f4acc8a3070 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Mon, 23 Oct 2023 14:14:11 +0200 Subject: [PATCH 25/32] Provide setup.py as fallback (again) --- setup.py | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..f11769c --- /dev/null +++ b/setup.py @@ -0,0 +1,69 @@ +# We still provide a setup.py for backwards compatability. +# But the pyproject.toml should be prefered. +import itertools +from pathlib import Path +from typing import List + +from setuptools import setup, find_packages + +# Environment-specific dependencies for dmc and metaworld +extras = { + 'dmc': ['shimmy[dm-control]', 'Shimmy==1.0.0'], + 'box2d': ['gymnasium[box2d]>=0.26.0'], + 'mujoco-legacy': ['mujoco-py >=2.1,<2.2', 'cython<3'], + 'jax': ["jax >=0.4.0", "jaxlib >=0.4.0"], +} + +# All dependencies +all_groups = set(extras.keys()) +extras["all"] = list(set(itertools.chain.from_iterable( + map(lambda group: extras[group], all_groups)))) + +extras['testing'] = extras["all"] + ['pytest'] + + +def find_package_data(extensions_to_include: List[str]) -> List[str]: + envs_dir = Path("fancy_gym/envs/mujoco") + package_data_paths = [] + for extension in extensions_to_include: + package_data_paths.extend([str(path)[10:] + for path in envs_dir.rglob(extension)]) + + return package_data_paths + + +setup( + author='Fabian Otto, Onur Celik, Dominik Roth, Hongyi Zhou', + name='fancy_gym', + version='1.0', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + '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', + ], + extras_require=extras, + install_requires=[ + 'mp_pytorch<=0.1.3', + 'mujoco==2.3.3', + 'gymnasium[mujoco]>=0.26.0' + ], + packages=[package for package in find_packages( + ) if package.startswith("fancy_gym")], + package_data={ + "fancy_gym": find_package_data(extensions_to_include=["*.stl", "*.xml"]) + }, + python_requires=">=3.7", + url='https://github.com/ALRhub/fancy_gym/', + license='MIT license', + author_email='', + description='Fancy Gym: Unifying interface for various RL benchmarks with support for Black Box approaches.' +) From b277ed6477a0c35a46161d82b343af6e82a512db Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Mon, 23 Oct 2023 14:24:50 +0200 Subject: [PATCH 26/32] Adding forward looking statements to README (Install instructions based on PyPI package) --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 74f0ccf..950bd8c 100644 --- a/README.md +++ b/README.md @@ -33,21 +33,23 @@ While the overarching objective of MP environments remains the learning of an op ## Installation +We recommend installing `fancy_gym` into a virtual environments like [venv](https://docs.python.org/3/library/venv.html). 3rd party alternatives to venv like [Poetry](https://python-poetry.org/) or [Conda](https://docs.conda.io/en/latest/) can also be used. + ### Installation via pip (recommended) -While the publication of `fancy_gym` on PyPI is still pending, you can install it from Test-PyPI. +Install `fancy_gym` via ```bash -pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple fancy_gym +pip install fancy_gym ``` We have a few optional dependencies. If you also want to install those use ```bash # to install all optional dependencies -pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple 'fancy_gym[all]' +pip install 'fancy_gym[all]' # or choose only those you want -pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple 'fancy_gym[dmc,box2d,mujoco-legacy,jax,testing]' +pip install 'fancy_gym[dmc,box2d,mujoco-legacy,jax,testing]' ``` Pip can not automatically install up-to-date versions of metaworld, since they are not avaible on PyPI yet. From d138c3c1f1e1791652242256cc95342bd912dfcc Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Mon, 23 Oct 2023 14:28:26 +0200 Subject: [PATCH 27/32] README: Minor improvements --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 950bd8c..46c536b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ While the overarching objective of MP environments remains the learning of an op We recommend installing `fancy_gym` into a virtual environments like [venv](https://docs.python.org/3/library/venv.html). 3rd party alternatives to venv like [Poetry](https://python-poetry.org/) or [Conda](https://docs.conda.io/en/latest/) can also be used. -### Installation via pip (recommended) +### Installation from PyPI (recommended) Install `fancy_gym` via ```bash @@ -62,25 +62,21 @@ pip install metaworld@git+https://github.com/Farama-Foundation/Metaworld.git@d15 ### Installation from master 1. Clone the repository - ```bash git clone git@github.com:ALRhub/fancy_gym.git ``` 2. Go to the folder - ```bash cd fancy_gym ``` 3. Install with - ```bash pip install -e . ``` We have a few optional dependencies. If you also want to install those use - ```bash # to install all optional dependencies pip install -e '.[all]' From af636164a83b5c1f1356502124025dadc25b6224 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Mon, 23 Oct 2023 14:34:43 +0200 Subject: [PATCH 28/32] Version bump and update setup.py --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8db9546..7c58d24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fancy_gym" -version = "1.0.6" +version = "1.0.7" description = "Fancy Gym: Unifying interface for various RL benchmarks with support for Black Box approaches." readme = "README.md" authors = [ diff --git a/setup.py b/setup.py index f11769c..09ea286 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ def find_package_data(extensions_to_include: List[str]) -> List[str]: setup( author='Fabian Otto, Onur Celik, Dominik Roth, Hongyi Zhou', name='fancy_gym', - version='1.0', + version='1.0.7', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', From 049e45cb0907f8b841ada5d16c0401378a524742 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Mon, 23 Oct 2023 14:51:21 +0200 Subject: [PATCH 29/32] Print warning when setup.py is still used. --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 09ea286..d55fefc 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,8 @@ from typing import List from setuptools import setup, find_packages +print('[!] You are currently installing/building fancy_gym via setup.py. This is only provided for backwards-compatability. Please use the pyproject.toml instead.') + # Environment-specific dependencies for dmc and metaworld extras = { 'dmc': ['shimmy[dm-control]', 'Shimmy==1.0.0'], From be250bee5e1bc167b71c105e9dfd6a98334e7e86 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 29 Oct 2023 14:11:25 +0100 Subject: [PATCH 30/32] Add action to publish to real PyPI --- .github/workflows/publish-to-pypi.yml | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..d56e142 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,38 @@ +name: Publish Python package to PyPI + +on: + push: + tags: + - '*' + +jobs: + publish: + name: Publish to PyPI + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') # Only run on tagged commits + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install pypa/build/setuptools/twine + run: >- + python3 -m + pip install + build setuptools twine + --user + + - name: Build a binary wheel and a source tarball + run: python3 -m build + + - name: Publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: twine upload dist/* + From 11a46889d9cdccd4c21524e89d141b2a118f1315 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 29 Oct 2023 14:11:47 +0100 Subject: [PATCH 31/32] Decrement version (we will start with 01.0 on PyPI) --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7c58d24..c1be41e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fancy_gym" -version = "1.0.7" +version = "0.1.0" description = "Fancy Gym: Unifying interface for various RL benchmarks with support for Black Box approaches." readme = "README.md" authors = [ diff --git a/setup.py b/setup.py index d55fefc..62b950c 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ def find_package_data(extensions_to_include: List[str]) -> List[str]: setup( author='Fabian Otto, Onur Celik, Dominik Roth, Hongyi Zhou', name='fancy_gym', - version='1.0.7', + version='0.1.0', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', From 707ec0880836ead69915e4973d70a5c0abce358f Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 29 Oct 2023 14:21:08 +0100 Subject: [PATCH 32/32] Disable push to reakl PyPI for initial test --- .github/workflows/publish-to-pypi.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index d56e142..09665f3 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,9 +1,11 @@ name: Publish Python package to PyPI on: - push: - tags: - - '*' + # Action currently disabled to only push to TestPyPI for now + + #push: + # tags: + # - '*' jobs: publish: