[py] Remove precompiled binaries from sdist #14233
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
Python sdist's should not contain precompiled binaries that are architecture specific. They should contain the sources needed to build the binaries instead.
Description
This removes the precompiled binaries from the sdist and modifies the setuptools
setup.py
to build them with setuptools-rust from source.For example in buildroot trying to compile selenium from the sdist for an arm target gives this error:
Motivation and Context
When building python selenium from source we should not use any prebuilt binaries as they will often not be able to run on the target architecture. This is especially problematic when cross compiling.
Types of changes
Checklist
PR Type
Bug fix, Enhancement
Description
_get_binary
function inselenium_manager.py
to use the compiled path forselenium-manager
if it exists.setuptools-rust
insetup.py
to handle Rust extensions.pyproject.toml
to define build system requirements for Rust integration.rust/BUILD.bazel
.Changes walkthrough 📝
selenium_manager.py
Enhance `_get_binary` to use compiled path for `selenium-manager`
py/selenium/webdriver/common/selenium_manager.py
selenium-manager
.sysconfig
to get the executable suffix._get_binary
function to use the compiled path if it exists.setup.py
Integrate `setuptools-rust` for building Rust extensions
py/setup.py
setuptools-rust
to handle Rust extensions.rust_extensions
insetup
configuration.BUILD.bazel
Update Bazel build to include Rust sources and exclude binaries
py/BUILD.bazel
pyproject.toml
in package sources.BUILD.bazel
Add file groups for Rust source files in Bazel build
rust/BUILD.bazel
pyproject.toml
Define build system requirements for Rust integration
py/pyproject.toml
setuptools
andsetuptools-rust
.build-backend
assetuptools.build_meta
.