Repository navigation
Drop unused Rust build dependencies from Linux CI - #135
Merged
Merged
Conversation
Since the Rust extension is only built on Windows and macOS, the Linux venv no longer needs a Rust toolchain, `setuptools-rust` (already part of the `dev` group for type checking) or `PYO3_USE_ABI3_FORWARD_COMPATIBILITY`. `libudev-dev` was only needed by the Rust build and the crate no longer has any Linux dependencies.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #135 +/- ##
=======================================
Coverage 94.36% 94.36%
=======================================
Files 25 25
Lines 4362 4362
=======================================
Hits 4116 4116
Misses 246 246 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…rt before merge)" This reverts commit 3018711.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR removes unused Rust build dependencies from the Linux CI, as they're no longer needed after #128.
Now, the Rust extension is only built on Windows and macOS, so the Rust toolchain,
libudev-dev, andPYO3_USE_ABI3_FORWARD_COMPATIBILITYcan theoretically be removed for Linux. The explicit install ofsetuptools-rustis also dropped, as it's now part of thedevdependency group (whichuv syncalso installs by default, though not yet used by CI).Do note that this is optional and perhaps not something that's wanted (e.g. in case the extension should ever be built on Linux again). If so, this PR can just be closed – it was just one of the leftovers from all previous CI related PRs.
Also note that the temporary commit will be removed/reverted in a bit. It's only needed to ensure that CI still passes, but as we don't change cache keys with just the first commit, the old cache would be restored instead. If the PR is merged (without the temporary commit), the cache should perhaps just be deleted manually once, so all future commits and PRs would use the new setup.
Detailed PR description
AI-generated PR description (CLICK TO EXPAND)
Summary of changes
prepare-base: drop theSet up Rustandlibudev-devsteps, the explicitsetuptools-rustinstall (it's in thedevgroup since Addsetuptools-rusttodev#133) andPYO3_USE_ABI3_FORWARD_COMPATIBILITY.prek,pytest,pytest-esphome: droplibudev-dev.Details
After #128,
setup.pyonly adds the Rust extension when building for Windows or macOS, andsetuptools-rustis only a build requirement there. On Linux,uv pip install -e . --group devbuilds a pure-Python package without invoking cargo. The Linux CI setup still had everything the old Linux Rust build needed:Set up Rustinprepare-base): unused by the venv build now. Theprekjob'scargo fmt/check/clippyhooks never depended on it, since they run in a separate job using the runner's preinstalled Rust.setuptools-rustin the explicituv pip install -U ...: not needed for the build, and still installed through thedevgroup (Addsetuptools-rusttodev#133), which mypy needs forsetup.py.PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1: only relevant when compiling PyO3 against a newer Python than it supports.libudev-devinprepare-base,prek,pytestandpytest-esphome: it was added together with the Linux Rust build. The crate has no Linux-specific dependencies any more.libudevonly shows up inCargo.lockvia the Windows-onlyserialportdependency, andcargo tree --target x86_64-unknown-linux-gnudoesn't include it. The Python side doesn't use libudev either (serialx/udev.pyis pure Python, and port listing reads sysfs).macOS and Windows are unchanged, since they still build the extension.
Testing
This PR doesn't change any cache key, so
prepare-baserestores the venv cached ondevand skips the edited steps. To exercise them, the cache keys can be bumped in a temporary commit and reverted afterwards, like in #129.Related:
setuptools-rusttodev#133 and Includesetup.pyin CI venv and Rust extension cache keys #134