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

Fix pybind11 to a specific commit on smart_holder branch #1315

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
34 changes: 20 additions & 14 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,23 @@ jobs:
[[ "${OS_TYPE}" = "Darwin" ]] && ./install.sh `which python${OS_PYTHON_VERSION}`
[[ "${OS_TYPE}" = "Linux" ]] && ./install.sh `which python3`
# These are necessary to install what is necessary for the build and for the full tests below.
${CI_PYBIN} -m pip install --upgrade pip
${CI_PYBIN} -m pip --version
[[ "${OS_TYPE}" = "Darwin" ]] && ${CI_PYBIN} -m pip install pipx
${CI_PYBIN} -m pip install --upgrade setuptools
${CI_PYBIN} -m pip install --upgrade -r requirements.txt -q
source ./open_spiel/scripts/python_extra_deps.sh ${CI_PYBIN}
${CI_PYBIN} -m pip install --no-cache-dir --upgrade $OPEN_SPIEL_PYTHON_JAX_DEPS
${CI_PYBIN} -m pip install --no-cache-dir --upgrade $OPEN_SPIEL_PYTHON_PYTORCH_DEPS
${CI_PYBIN} -m pip install --no-cache-dir --upgrade $OPEN_SPIEL_PYTHON_TENSORFLOW_DEPS
${CI_PYBIN} -m pip install --no-cache-dir --upgrade $OPEN_SPIEL_PYTHON_MISC_DEPS
${CI_PYBIN} -m pip install twine
${CI_PYBIN} -m pip install cibuildwheel==2.22.0
${CI_PYBIN} -m venv ./venv
source ./venv/bin/activate
python -m pip install --upgrade pip
python -m pip --version
[[ "${OS_TYPE}" = "Darwin" ]] && python -m pip install pipx
python -m pip install --upgrade setuptools
python -m pip install --upgrade -r requirements.txt -q
source ./open_spiel/scripts/python_extra_deps.sh python
python -m pip install --no-cache-dir --upgrade $OPEN_SPIEL_PYTHON_JAX_DEPS
python -m pip install --no-cache-dir --upgrade $OPEN_SPIEL_PYTHON_PYTORCH_DEPS
python -m pip install --no-cache-dir --upgrade $OPEN_SPIEL_PYTHON_TENSORFLOW_DEPS
python -m pip install --no-cache-dir --upgrade $OPEN_SPIEL_PYTHON_MISC_DEPS
python -m pip install twine
python -m pip install cibuildwheel==2.22.0
- name: Build sdist
run: |
source ./venv/bin/activate
pipx run build --sdist
twine check dist/*.tar.gz

Expand All @@ -104,14 +107,17 @@ jobs:
- name: Build bdist_wheel and run tests
run: |
[[ "${OS_TYPE}" = "Darwin" ]] && xcodebuild -version
${CI_PYBIN} -m cibuildwheel --output-dir wheelhouse
source ./venv/bin/activate
python -m cibuildwheel --output-dir wheelhouse
ls -l wheelhouse

# Install the built wheel and run the full tests on this host. The full
# tests include all the ones that use the machine learning libraries,
# such as Tensorflow, PyTorch, and JAX.
- name: Install bdist_wheel and full tests
run: ./open_spiel/scripts/test_wheel.sh full `pwd` ${CI_PYBIN}
run: |
source ./venv/bin/activate
./open_spiel/scripts/test_wheel.sh full `pwd` python

- uses: actions/upload-artifact@v4
with:
Expand Down
6 changes: 6 additions & 0 deletions open_spiel/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ function cached_clone() {
DIR="./pybind11"
if [[ ! -d ${DIR} ]]; then
cached_clone -b smart_holder --single-branch --depth 1 https://github.com/pybind/pybind11.git ${DIR}
# Fix to a specific commit of the v2 smart_holder branch before merge into master for v3
# See discussion on https://github.com/pybind/pybind11/pull/5542
# We will wait for Google to pull in v3 to move this to v3 as there will be nontrivial fixes involved
pushd ${DIR}
git checkout 'aed215c4d49532a1b162ea11cd96f77bd3540fed'
popd
fi

# The official https://github.com/dds-bridge/dds.git seems to not accept PR,
Expand Down
4 changes: 2 additions & 2 deletions open_spiel/scripts/python_extra_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ elif verlt $PY_VER 3.12; then
echo "Detected Python version in {3.10, 3.11}"
export OPEN_SPIEL_PYTHON_PYTORCH_DEPS="torch==2.1.0"
export OPEN_SPIEL_PYTHON_JAX_DEPS="jax==0.4.20 jaxlib==0.4.20 dm-haiku==0.0.10 optax==0.1.7 chex==0.1.84 rlax==0.1.6 distrax==0.1.4"
export OPEN_SPIEL_PYTHON_TENSORFLOW_DEPS="numpy==1.26.1 tensorflow==2.14.0 tensorflow-probability==0.22.1 tensorflow_datasets==4.9.2 keras==2.14.0"
export OPEN_SPIEL_PYTHON_TENSORFLOW_DEPS="numpy==1.26.1 tensorflow==2.14.0 tensorflow-probability==0.22.1 tensorflow_datasets==4.9.7 keras==2.14.0"
export OPEN_SPIEL_PYTHON_MISC_DEPS="IPython==5.8.0 networkx==3.2 matplotlib==3.5.2 mock==4.0.2 nashpy==0.0.19 scipy==1.11.3 testresources==2.0.1 cvxopt==1.3.1 cvxpy==1.4.1 ecos==2.0.10 osqp==0.6.2.post5 clu==0.0.6 flax==0.5.3"
else
echo "Detected Python version >= 3.12"
export OPEN_SPIEL_PYTHON_PYTORCH_DEPS="torch==2.2.2"
export OPEN_SPIEL_PYTHON_JAX_DEPS="jax==0.4.26 jaxlib==0.4.26 dm-haiku==0.0.12 optax==0.2.2 chex==0.1.86 rlax==0.1.6 distrax==0.1.5"
export OPEN_SPIEL_PYTHON_TENSORFLOW_DEPS="numpy==1.26.4 tensorflow==2.16.1 tensorflow_datasets==4.9.4 keras==3.1.1"
export OPEN_SPIEL_PYTHON_TENSORFLOW_DEPS="numpy==1.26.4 tensorflow==2.16.1 tensorflow_datasets==4.9.7 keras==3.1.1"
export OPEN_SPIEL_PYTHON_MISC_DEPS="IPython==8.23.0 networkx==3.3 matplotlib==3.8.4 mock==5.1.0 nashpy==0.0.41 scipy==1.11.4 testresources==2.0.1 cvxopt==1.3.2 cvxpy==1.4.2 ecos==2.0.13 osqp==0.6.5 clu==0.0.11 flax==0.8.2"
fi

Expand Down
Loading