Skip to content

python27 tests#1314

Merged
pzhokhov merged 5 commits intomasterfrom
python27tests
Feb 8, 2019
Merged

python27 tests#1314
pzhokhov merged 5 commits intomasterfrom
python27tests

Conversation

@pzhokhov
Copy link
Collaborator

@pzhokhov pzhokhov commented Feb 7, 2019

add tests of bare gym (without extensions) with python2.7. Mainly ensures that there is no syntactic incompatibility with python 2.7.

deps =
pytest
pytest-forked
-e .
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because this line is -e . instead of -e .[all], the extensions (atari-py, box2d-py, mujoco-py) will not be installed, and respective tests will be skipped.

Copy link
Contributor

@robertnishihara robertnishihara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! Thanks for doing that.

@@ -1,3 +1,4 @@
# coding=UTF-8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it better to just remove the fancy symbols for this file? Also what error does this actually fix?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christopherhesse I am using Python 2.7 and fired up a fresh virtual env. I installed gym by cloning the repository and doing pip install -e .. Then I get this when trying to make the environment:

seita@machine:~/gym-test$ ipython
Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
Type "copyright", "credits" or "license" for more information.

IPython 5.8.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import gym

In [2]: gym.__version__
Out[2]: '0.11.0'

In [3]: env = gym.make('CartPole-v0')
  File "/home/seita/gym/gym/envs/classic_control/cartpole.py", line 26
    2	Pole Angle                 -24°           24°
     	                                             ^
SyntaxError: Non-ASCII character '\xc2' in file /home/seita/gym/gym/envs/classic_control/cartpole.py on line 27, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

If possible I recommend removing all the degree symbols and other stuff that is causing the error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are unicode symbols for degrees in the cartpole description (and python2 complains about it unless encoding is specified explicitly). But you make a good point, it is probably simpler to just remove those symbols. Let me see if I can do that without readability suffering too much

Copy link
Contributor

@christopherhesse christopherhesse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only one minor question.

@pzhokhov pzhokhov merged commit 07e0c98 into master Feb 8, 2019
@pzhokhov
Copy link
Collaborator Author

pzhokhov commented Feb 8, 2019

@DanielTakeshi @robertnishihara should be all clear now

zlig pushed a commit to zlig/gym that referenced this pull request Apr 24, 2020
* add py27 test environment (sans box2d and atari)

* skip mujoco tests if mujoco_py not present

* re-enable python3 tests

* remove unicode symbols

* remove more unicode symbols
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants