Skip to content

Conversation

@visheshrwl
Copy link

@visheshrwl visheshrwl commented Jan 3, 2026

Tried to resolve #804 #804 #1369 #1422

feat: Add Windows pip installation support

Add setup.py with CMake extension building and dependency auto-cloning
Add pyproject.toml for modern Python packaging
Add GitHub Actions CI/CD for automated wheel building
Add WINDOWS_INSTALL.md guide and test_installation.py validator
Transform complex manual Windows setup to simple 'pip install open-spiel'
Fix CMake configuration for proper pyspiel.pyd placement
Update README.md with Windows installation documentation
Enables native Windows pip installation, eliminating 20+ manual setup steps

- Add setup.py with cross-platform CMake extension building
- Add pyproject.toml for modern Python packaging (PEP 517)
- Add GitHub Actions CI for automated Windows wheel building (py3.10-3.13)
- Add WINDOWS_INSTALL.md guide and test_installation.py validator
- Transform complex manual Windows setup to simple 'pip install open-spiel'
- Fix dynamic wheel selection in test_wheel.sh for all Python versions
- Update README.md with Windows installation documentation
- Set python_requires>=3.10 to match upstream

Enables native Windows pip installation, eliminating 20+ manual setup steps
Resolves google-deepmind#804
- Use cmake --build with MSVC on Windows instead of make
- Add Windows compiler flags (/std:c++17 /utf-8 /bigobj)
- Skip C++ compiler check on Windows (CMake handles it)
- Keep Unix build path unchanged (clang++/make)
Upstream skips Python 3.13 testing on macos-15 due to a known issue
in rcfr_pytorch_test.py with NumPy strict type checking in Python 3.13.
Reverting to upstream behavior to keep PR focused on Windows pip support.
Restore upstream behavior where macOS Python 3.13 runner skips full tests
since only Python 3.14 wheel is built. This matches the upstream workaround
for Python 3.13 compatibility issues.
Changed hardcoded manylinux_2_17_x86_64 pattern to wildcard manylinux*
to support both x86_64 and aarch64 (ARM64) wheel architectures.
- Move pip installation instructions from WINDOWS_INSTALL.md to docs/windows.md as Option 1
- Remove WINDOWS_INSTALL.md (content now in docs/windows.md)
- Remove Windows install link from README.md (already linked from docs/install.md)
- Remove unnecessary root __init__.py (open_spiel/__init__.py already exists)

Addresses feedback from code review.
@lanctot
Copy link
Collaborator

lanctot commented Jan 5, 2026

Hi @visheshrwl , does this replace #1422 ?

@lanctot
Copy link
Collaborator

lanctot commented Jan 5, 2026

@visheshrwl

I'm quite impressed that you got this to work! It's been a major feature request for the past 3 years. However, there is one thing we need to discuss before I take a deeper look ifwe import this and "officially" support Windows OpenSpiel via pip.

We unfortunately don't have resources to properly support Windows (without external help). If we put up Windows pip wheels and distribute them on PyPI, that could means a spike in usage on the Windows platform and could bring about some bugs or other issues we haven't seen before. It could also lead to breakage in the future as the code changes.

Would you be willing to help fix things in the Windows wheels if/when they break?

Copy link
Collaborator

@lanctot lanctot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is test_installation.py used?

@visheshrwl
Copy link
Author

Where is test_installation.py used?

It's a standalone script I used for local Windows testing. It’s not part of any workflow and will be removed in the next PR.

- Update GitHub Actions to v6 (checkout@v6, setup-python@v6)
- Add missing core dependencies to pyproject.toml (scipy, ml-collections)
- Match version constraints from requirements.txt
- Remove unused test_installation.py

Addresses: @lanctot's review comments
@visheshrwl
Copy link
Author

@visheshrwl

I'm quite impressed that you got this to work! It's been a major feature request for the past 3 years. However, there is one thing we need to discuss before I take a deeper look ifwe import this and "officially" support Windows OpenSpiel via pip.

We unfortunately don't have resources to properly support Windows (without external help). If we put up Windows pip wheels and distribute them on PyPI, that could means a spike in usage on the Windows platform and could bring about some bugs or other issues we haven't seen before. It could also lead to breakage in the future as the code changes.

Would you be willing to help fix things in the Windows wheels if/when they break?

Hi @lanctot,

Thank you for the kind words! I'm glad I could help solve this long-standing feature request.

I absolutely understand the concern about supporting Windows long-term. Yes, I'm willing to help maintain the Windows wheels. Here's what I can commit to:

What I can do:

  • Monitor and fix Windows-specific build/CI failures
  • Debug Windows wheel issues and respond to bug reports
  • Keep the Windows build configuration updated as dependencies evolve
  • Document Windows-specific quirks or limitations

Response times:

  • Critical CI failures: I aim to address these within 48-72 hours
  • User-reported issues: within a week for investigation
  • Non-urgent improvements: as time permits

What would help me help you:

  • Tagging me on Windows-related issues
  • Being notified of major dependency/build system changes
  • Access to Windows CI logs when failures occur

Limitations:

  • I'm contributing as a community member, so there may be occasional delays during busy periods
  • For issues beyond Windows wheels (e.g., game logic bugs that just happen to appear on Windows first), I may need help from the core team

I think it would also be wise to document in the installation guide that Windows support is "community-maintained" to set appropriate user expectations.

I see this as a valuable opportunity to contribute to a project I use and learn from the codebase. I'm committed to keeping this working long-term.

Does this level of commitment work for you?

@lanctot
Copy link
Collaborator

lanctot commented Jan 5, 2026

Great, and yes that works for us, thank you!

Does this PR replace #1422?

Quick question: have you tried using the resulting wheels via a pip install on Windows? Can we please add some documentation on how to do that (via a new section at the very top of windows.md)? Once it's on PyPI will it be as simple as running pip install open-spiel like MacOS and Linux?

You don't need to make a new PR each time you make changes btw, just commit + push to this branch.

@visheshrwl
Copy link
Author

Quick question: have you tried using the resulting wheels via a pip install on Windows? Can we please add some documentation on how to do that (via a new section at the very top of windows.md)? Once it's on PyPI will it be as simple as running pip install open-spiel like MacOS and Linux?

Yes, the Windows wheels were tested via pip install on Windows using the Python launcher. Once uploaded to PyPI, installation will be identical to macOS and Linux (pip install open-spiel), provided users use the standard python.org Python distribution.

image

Does this PR replace #1422?

The code in #1426 is the refined, up-to-date version implementing Windows pip/wheel support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installation via pip failing on Windows 10/11 with "legacy-install-failure"

2 participants