diff --git a/README.md b/README.md index 728f64bca..059866be6 100644 --- a/README.md +++ b/README.md @@ -150,8 +150,8 @@ software libraries, which we ship in several different ways: software rendering via OSMesa, depending on the `--define headless=...` build setting. * Python 2.7 (other versions might work, too) with NumPy, PIL. (A few - tests require a NumPy version of at least 1.8.) One test requires six - to demonstrate Python 3 compatibility. + tests require a NumPy version of at least 1.8.) Python 3 is supported + experimentally. The build rules are using a few compiler settings that are specific to GCC. If some flags are not recognized by your compiler (typically those would be diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index d45d748aa..f58b9fcc1 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -24,6 +24,7 @@ 2. The demo `:game` has a new flag `--start_index` to start at an episode index other than 0. 3. Add a console command `dm_pickup` to pick up an item identified by its `id`. +4. More Python demos and tests now work with Python 3. ## release-2018-05-15 May 2018 release diff --git a/WORKSPACE b/WORKSPACE index fa8da47b6..82e9edd57 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -75,6 +75,17 @@ new_http_archive( ], ) +new_http_archive( + name = "six_archive", + build_file = "six.BUILD", + sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a", + strip_prefix = "six-1.10.0", + urls = [ + "https://mirror.bazel.build/pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz", + "https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz", + ], +) + # TODO: Replace with hermetic build new_local_repository( name = "lua_system", diff --git a/python/tests/BUILD b/python/tests/BUILD index 6ec473454..14d8bf223 100644 --- a/python/tests/BUILD +++ b/python/tests/BUILD @@ -18,6 +18,7 @@ py_test( data = ["//:deepmind_lab.so"], imports = ["python"], main = "dmlab_module_test.py", + deps = ["@six_archive//:six"], ) py_test( diff --git a/six.BUILD b/six.BUILD new file mode 100644 index 000000000..689c55441 --- /dev/null +++ b/six.BUILD @@ -0,0 +1,13 @@ +# Description: +# Six provides simple utilities for wrapping over differences between Python 2 +# and Python 3. + +licenses(["notice"]) # MIT + +exports_files(["LICENSE"]) + +py_library( + name = "six", + srcs = ["six.py"], + visibility = ["//visibility:public"], +)