Skip to content

Commit

Permalink
Fix broken Box2D dependency in fresh install (#335)
Browse files Browse the repository at this point in the history
* Fix Box2D in fresh install (#334)

Before box2d-py 2.3.4, box2d-py works on Linux but breaks on OSX, and
Box2D-kengz works on OSX but breaks on Linux. box2d-py 2.3.4 fixes issue
on OSX and now works on both platforms, and is actively by OpenAI.

See openai/gym#1120.

* Cleanup (#334)

* Cleanup extra pip (#334)

Remove pip box2d-py in
- setup_linux.sh
- setup_osx.sh
- Dockerfile.ci

* Upgrade gym to 0.10.8 (#334)

* Remove assertion for Mujoco viewer close

This problem is resolved in #340

* Close all env

* Remove deadcode KNOWN_GYM_CLOSE_BROKEN
  • Loading branch information
naeioi authored Oct 25, 2018
1 parent ff002ba commit 8e5d4a0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 71 deletions.
8 changes: 1 addition & 7 deletions tests/helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pickle

from tests.quirks import KNOWN_GYM_CLOSE_BROKEN
from tests.quirks import KNOWN_GYM_RENDER_NOT_IMPLEMENTED


Expand Down Expand Up @@ -44,9 +43,4 @@ def step_env_with_gym_quirks(test_case,
round_trip = pickle.loads(pickle.dumps(env))
assert round_trip.env.spec == env.env.spec

if not spec.id in KNOWN_GYM_CLOSE_BROKEN:
env.close()
else:
with test_case.assertRaisesRegex(
AttributeError, "'MjViewer' object has no attribute 'finish'"):
env.close()
env.close()
64 changes: 0 additions & 64 deletions tests/quirks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,70 +21,6 @@
"Roulette-v0",
]

# openai/gym environments known to have a broken close() function.
#
# e.g.
# > gym/envs/robotics/robot_env.py", line 86, in close
# > self.viewer.finish()
# > AttributeError: 'MjViewer' object has no attribute 'finish'
# >
#
# Tests calling close() on these should verify they raise AttributeError
# ```
# with self.assertRaises(NotImplementedError):
# env.close()
# ```
#
# TODO: file a bug at openai/gym about this
KNOWN_GYM_CLOSE_BROKEN = [
# Please keep alphabetized
"Ant-v2",
"FetchPickAndPlace-v1",
"FetchPickAndPlaceDense-v1",
"FetchPush-v1",
"FetchPushDense-v1",
"FetchReach-v1",
"FetchReachDense-v1",
"FetchSlide-v1",
"FetchSlideDense-v1",
"HalfCheetah-v2",
"HandManipulateBlock-v0",
"HandManipulateBlockDense-v0",
"HandManipulateBlockFull-v0",
"HandManipulateBlockFullDense-v0",
"HandManipulateBlockRotateParallel-v0",
"HandManipulateBlockRotateParallelDense-v0",
"HandManipulateBlockRotateXYZ-v0",
"HandManipulateBlockRotateXYZDense-v0",
"HandManipulateBlockRotateZ-v0",
"HandManipulateBlockRotateZDense-v0",
"HandManipulateEgg-v0",
"HandManipulateEggDense-v0",
"HandManipulateEggFull-v0",
"HandManipulateEggFullDense-v0",
"HandManipulateEggRotate-v0",
"HandManipulateEggRotateDense-v0",
"HandManipulatePen-v0",
"HandManipulatePenDense-v0",
"HandManipulatePenFull-v0",
"HandManipulatePenFullDense-v0",
"HandManipulatePenRotate-v0",
"HandManipulatePenRotateDense-v0",
"HandReach-v0",
"HandReachDense-v0",
"Hopper-v2",
"Humanoid-v2",
"HumanoidStandup-v2",
"InvertedDoublePendulum-v2",
"InvertedPendulum-v2",
"Pusher-v2",
"Reacher-v2",
"Striker-v2",
"Swimmer-v2",
"Thrower-v2",
"Walker2d-v2",
]

KNOWN_GYM_NOT_CLOSE_VIEWER = [
# Please keep alphabetized
"gym.envs.mujoco",
Expand Down

0 comments on commit 8e5d4a0

Please sign in to comment.