Skip to content

feat(build): publish a source distribution without Node.js - #3295

Merged
Dmitry Gozman (dgozman) merged 2 commits into
microsoft:mainfrom
dgozman:fix-3036
Oct 29, 2026
Merged

Dmitry Gozman (dgozman) merged 2 commits into
microsoft:mainfrom
dgozman:fix-3036

Conversation

@dgozman

@dgozman Dmitry Gozman (dgozman) commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Playwright for Python publishes only platform wheels, one per OS and CPU, because each wheel bundles the Node.js binary that runs the driver. There is no source distribution (sdist). Poetry's installer.no-binary = :all: (and pip's --no-binary :all:) rejects every wheel and looks for an sdist, so poetry add playwright fails with "Unable to find installation candidates". The same happens on platforms we have no wheel for.

  • The release now publishes an sdist next to the eight wheels. The sdist carries the driver (the playwright-core package) without the Node.js binary; the bundle is built from .upstream/ like the platform ones, with scripts/build_driver.py any. Everything else in it is the same.
  • A wheel built from the sdist is py3-none-any, so it installs anywhere. pip and poetry still prefer the platform wheel when one is allowed, so nothing changes for the installs of today.
  • An install from the sdist runs with a system Node.js: set PLAYWRIGHT_NODEJS_PATH to its executable, as the docs describe. Without it, the client says "This installation of Playwright does not include Node.js. Set PLAYWRIGHT_NODEJS_PATH pointing to Node.js executable." When the executable does not launch, the client says "Cannot launch Node.js executable at : ", for both the CLI and the API.
  • tests/test_installation.py gets test_install_sdist: a clean venv, pip install of the sdist, the two error messages, then a Chromium launch with the system Node.js. A new sdist job of CI runs it.

Fixes microsoft/playwright#43599
See also #3036

The release publishes a sdist next to the platform wheels. The sdist carries the
"any" driver bundle, built from .upstream/ like the others but without the Node.js
binary. A wheel built from it is py3-none-any and runs with the Node.js of
PLAYWRIGHT_NODEJS_PATH. The client says so when the bundled Node.js is missing,
and names the executable when the driver does not launch.
- The wheel jobs run test_install only; the sdist job runs test_install_sdist.
  Each job builds the one artifact its test installs.
- The sdist job builds the wheel first, so that the checkout has a driver
  with Node.js for install-deps.
- The client subprocesses of the tests run from tmp_path, so that they import
  the installed package and not the checkout.
- The sdist test installs with --no-binary :all:, the pip form of poetry's
  installer.no-binary policy of the report.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@dgozman
Dmitry Gozman (dgozman) merged commit 6f6823d into microsoft:main Oct 29, 2026
30 of 36 checks passed
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.

[Bug]: Installation fails if binary distributions are prohibited

2 participants