Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove nox #1192

Merged
merged 10 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,25 @@ jobs:
# Most current platform.
- os: ubuntu-22.04
OS_PYTHON_VERSION: "3.11"
TRAVIS_USE_NOX: 0
DEFAULT_OPTIONAL_DEPENDENCY: "ON"
BUILD_SHARED_LIB: "OFF"
OPEN_SPIEL_BUILD_WITH_ORTOOLS: "OFF"
OPEN_SPIEL_BUILD_WITH_ORTOOLS_DOWNLOAD_URL: ""
# Standard (most current) platforms and versions.
- os: ubuntu-22.04
OS_PYTHON_VERSION: "3.10"
TRAVIS_USE_NOX: 0
DEFAULT_OPTIONAL_DEPENDENCY: "ON"
BUILD_SHARED_LIB: "OFF"
OPEN_SPIEL_BUILD_WITH_ORTOOLS: "ON"
OPEN_SPIEL_BUILD_WITH_ORTOOLS_DOWNLOAD_URL: "https://github.com/google/or-tools/releases/download/v9.6/or-tools_amd64_ubuntu-22.04_cpp_v9.6.2534.tar.gz"
- os: ubuntu-22.04
OS_PYTHON_VERSION: "3.10"
TRAVIS_USE_NOX: 0
DEFAULT_OPTIONAL_DEPENDENCY: "OFF"
BUILD_SHARED_LIB: "OFF"
OPEN_SPIEL_BUILD_WITH_ORTOOLS: "OFF"
OPEN_SPIEL_BUILD_WITH_ORTOOLS_DOWNLOAD_URL: ""
- os: macos-12
OS_PYTHON_VERSION: "3.9"
TRAVIS_USE_NOX: 0
DEFAULT_OPTIONAL_DEPENDENCY: "OFF"
BUILD_SHARED_LIB: "OFF"
OPEN_SPIEL_BUILD_WITH_ORTOOLS: "OFF"
Expand All @@ -45,7 +41,6 @@ jobs:
- os: ubuntu-20.04
OS_PYTHON_VERSION: "3.9"
DEFAULT_OPTIONAL_DEPENDENCY: "ON"
TRAVIS_USE_NOX: 0
BUILD_SHARED_LIB: "ON"
OPEN_SPIEL_BUILD_WITH_ORTOOLS: "OFF"
OPEN_SPIEL_BUILD_WITH_ORTOOLS_DOWNLOAD_URL: ""
Expand All @@ -57,7 +52,6 @@ jobs:
OPEN_SPIEL_ENABLE_TENSORFLOW: ON
OPEN_SPIEL_ENABLE_PYTHON_MISC: ON
OS_PYTHON_VERSION: ${{ matrix.OS_PYTHON_VERSION }}
TRAVIS_USE_NOX: ${{ matrix.TRAVIS_USE_NOX }}
DEFAULT_OPTIONAL_DEPENDENCY: ${{ matrix.DEFAULT_OPTIONAL_DEPENDENCY }}
OPEN_SPIEL_BUILD_WITH_JULIA: ${{ matrix.OPEN_SPIEL_BUILD_WITH_JULIA }}
BUILD_SHARED_LIB: ${{ matrix.BUILD_SHARED_LIB }}
Expand Down
5 changes: 1 addition & 4 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ issue.
Currently there are three installation methods:

1. building from the source code and editing `PYTHONPATH`.
2. using `pip install` to build and testing using
[nox](https://nox.thea.codes/en/stable/).
2. using `pip install`.
3. installing via [Docker](https://www.docker.com).

## Summary
Expand Down Expand Up @@ -136,8 +135,6 @@ In a nutshell:

```bash
python3 -m pip install .
lanctot marked this conversation as resolved.
Show resolved Hide resolved
python3 -m pip install nox
nox -s tests
```

Optionally, use `pip install -e` to install in
Expand Down
47 changes: 0 additions & 47 deletions noxfile.py

This file was deleted.

11 changes: 4 additions & 7 deletions open_spiel/scripts/build_and_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,11 @@ function execute_export_graph {

# Build / install everything and run tests (C++, Python, optionally Julia).
if [[ $ARG_build_with_pip == "true" ]]; then
# TODO(author2): We probably want to use `python3 -m pip install .` directly
# and skip the usage of nox.
${PYBIN} -m pip install nox

if nox -s tests; then
echo -e "\033[32mAll tests passed. Nicely done!\e[0m"
${PYBIN} -m pip install .
if ctest -j$TEST_NUM_PROCS --output-on-failure ../open_spiel; then
print_tests_passed
else
echo -e "\033[31mAt least one test failed.\e[0m"
print_tests_failed
exit 1
fi
else
Expand Down
15 changes: 5 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,9 @@ def build_extension(self, ext):
subprocess.check_call(
["cmake", ext.sourcedir] + cmake_args, cwd=self.build_temp,
env=env)
if os.environ.get("OPEN_SPIEL_BUILD_ALL") is not None:
# Build everything (necessary for nox tests)
subprocess.check_call(["make", f"-j{os.cpu_count()}"],
cwd=self.build_temp,
env=env)
else:
# Build only pyspiel (for pip package)
subprocess.check_call(["make", "pyspiel", f"-j{os.cpu_count()}"],

# Build only pyspiel (for pip package)
subprocess.check_call(["make", "pyspiel", f"-j{os.cpu_count()}"],
cwd=self.build_temp,
env=env)

Expand All @@ -119,8 +114,8 @@ def _parse_line(s):
return requirement.strip()


# Get the requirements from file. During nox tests, this is in the current
# directory, but when installing from pip it is in the parent directory
# Get the requirements from file.
# When installing from pip it is in the parent directory
req_file = ""
if os.path.exists("requirements.txt"):
req_file = "requirements.txt"
Expand Down
9 changes: 0 additions & 9 deletions travis.yml.old
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ matrix:
dist: bionic # Ubuntu 18.04.2 LTS released on 26 April 2018
env:
- OS_PYTHON_VERSION=3.6
- TRAVIS_USE_NOX=0
- CC=/usr/local/clang-7.0.0/bin/clang
- CXX=/usr/local/clang-7.0.0/bin/clang++
- os: linux
dist: focal # Ubuntu 20.04 LTS
env:
- OS_PYTHON_VERSION=3.8
- TRAVIS_USE_NOX=0
- CC=/usr/bin/clang
- CXX=/usr/bin/clang++
# Build and run tests with all optional dependencies, including building a
Expand All @@ -43,7 +41,6 @@ matrix:
env:
- OS_PYTHON_VERSION=3.8
- DEFAULT_OPTIONAL_DEPENDENCY="ON"
- TRAVIS_USE_NOX=0
- CC=/usr/bin/clang
- CXX=/usr/bin/clang++
- BUILD_SHARED_LIB="ON"
Expand All @@ -54,32 +51,26 @@ matrix:
osx_image: xcode10.3 # macOS 10.14 (Mojave), release on March 25, 2019.
env:
- DEFAULT_OPTIONAL_DEPENDENCY="ON"
- TRAVIS_USE_NOX=0

## Tests using PIP
# Build and run tests without all optional dependencies (default behavior) and
# use nox
- os: linux
dist: focal # Ubuntu 20.04 LTS
env:
- OS_PYTHON_VERSION=3.8
- TRAVIS_USE_NOX=1
- CC=/usr/bin/clang
- CXX=/usr/bin/clang++
# Ubuntu 18.04
- os: linux
dist: bionic # Ubuntu 18.04
env:
- OS_PYTHON_VERSION=3.6
- TRAVIS_USE_NOX=1
- CC=/usr/local/clang-7.0.0/bin/clang
- CXX=/usr/local/clang-7.0.0/bin/clang++
# Build and test on MacOS. We use a single target, with all dependencies and
# use nox.
- os: osx
osx_image: xcode10.3 # macOS 10.14 (Mojave), release on March 25, 2019.
env:
- TRAVIS_USE_NOX=1

script:
- pwd
Expand Down
Loading