Skip to content

Commit

Permalink
Fix PYTHONPATH when running nox tests, re-enable nox in Travis script…
Browse files Browse the repository at this point in the history
…, and update it to use Python 3.7.

PiperOrigin-RevId: 302706500
Change-Id: I966b1d1b54fbb7cd799b3377dfdd2150a3b564e2
  • Loading branch information
DeepMind Technologies Ltd authored and open_spiel@google.com committed Mar 24, 2020
1 parent b9b646d commit a893c45
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def get_distutils_tempdir():
)


@nox.session
@nox.session(python="3.7")
def tests(session):
session.install("-r", "requirements.txt")
session.run("python", "setup.py", "build")
session.run("python", "setup.py", "install")
session.run("python3", "setup.py", "build")
session.run("python3", "setup.py", "install")
session.cd(os.path.join("build", get_distutils_tempdir()))
session.run(
"ctest", f"-j{4*os.cpu_count()}", "--output-on-failure", external=True)
10 changes: 3 additions & 7 deletions open_spiel/scripts/travis_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ set -x

if [ ! "$TRAVIS_USE_NOX" -eq 0 ]; then
# Build and run tests using nox
#
# March 23rd, 2020: This is currently breaking Travis-CI due to
# run_python_test failing. Disabling it while we work on a fix.
#
# pip3 install nox
# nox -s tests
# exit 0
pip3 install nox
PWD=`pwd` # normally defined, but just in case!
PYTHONPATH="$PYTHONPATH:$PWD:$PWD/build:$PWD/build/python" nox -s tests
exit 0
fi

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def build_extension(self, ext):
extension_dir = os.path.abspath(
os.path.dirname(self.get_ext_fullpath(ext.name)))
cmake_args = [
"-DPython_TARGET_VERSION=3.6",
"-DPython_TARGET_VERSION=3.7",
"-DCMAKE_CXX_COMPILER=clang++",
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extension_dir}",
]
Expand Down

0 comments on commit a893c45

Please sign in to comment.