Skip to content

Commit

Permalink
Add comments to explain extra deps and clarify requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
lanctot committed Apr 20, 2021
1 parent 4c79d68 commit 554a86f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
5 changes: 3 additions & 2 deletions open_spiel/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if(Python3_VERSION VERSION_LESS "3.6.0")
"Python found ${Python3_VERSION} < 3.6.0")
endif()

# Detext the Python ML frameworks.
# Detect the Python ML frameworks.
if (OPEN_SPIEL_ENABLE_JAX STREQUAL AUTO)
message(NOTICE "OPEN_SPIEL_ENABLE_JAX set to AUTO. Detecting Jax...")
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/find_jax.sh ${Python3_EXECUTABLE}
Expand Down Expand Up @@ -142,7 +142,8 @@ if (BUILD_WITH_GAMUT)
endif()


# Python tests to run.
# Python tests to run. Start with all the core tests here first, then
# conditionally add other tests based on what has been enabled/detected.
set(PYTHON_TESTS ${PYTHON_TESTS}
../integration_tests/api_test.py
../integration_tests/playthrough_test.py
Expand Down
11 changes: 11 additions & 0 deletions open_spiel/scripts/python_extra_deps.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/usr/bin/env bash

# These are extra packages that are not strictly required to run the OpenSpiel
# Python API, but are required by certain algorithms or tools. Packages here
# are for testing purposes: they are not installed by any of the install
# scripts, and are referred to only in the testing scripts run on GitHub, so
# they must installed separately. The versions are pinned to ensure that tests
# are covering only those versions supported by the algorithms that use them,
# but could work for other versions too.
#
# To enable specific tests, please use the environment variables found in
# scripts/global_variables.sh
export OPEN_SPIEL_PYTHON_JAX_DEPS="jax==0.2.7 jaxlib==0.1.57 dm-haiku==0.0.3 optax==0.0.2 chex==0.0.3"
export OPEN_SPIEL_PYTHON_PYTORCH_DEPS="torch==1.7.0"
export OPEN_SPIEL_PYTHON_TENSORFLOW_DEPS="tensorflow==2.4.1 tensorflow-probability<0.8.0,>=0.7.0"
Expand Down
17 changes: 10 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# The single source of truth for the OpenSpiel pip dependencies.
# The core OpenSpiel pip dependencies.
#
# Note that we purposely exclude python packages used by some of the python
# algorithms or tools, as we want to keep only the dependencies absolutely
# necessary to use the python API. However, when testing using continuous
# integration like GitHub Actions, we install several more to ensure the
# proper tests are included. See open_spiel/scripts/python_extra_deps.sh
# for extra packages and their versions.
# Note that there are optional python packages used by some of the python
# algorithms or tools in OpenSpiel that are purposelty excluded (e.g.
# cvxopt, nashpy, matplotlib etc.) This is because we want to keep only
# the dependencies that are absolutely necessary to use the Python API.
#
# However, when testing using continuous integration like GitHub Actions,
# we install several more packages to ensure the proper tests are
# included. See open_spiel/scripts/python_extra_deps.sh for the extra
# packages and their versions we use for testing purposes.
pip >= 20.0.2
attrs >= 19.3.0
absl-py >= 0.10.0
Expand Down

0 comments on commit 554a86f

Please sign in to comment.