Repository navigation
ci: ban sys.path edits in Python; remove all 35 - #2311
Merged
Merged
Conversation
zackees
enabled auto-merge
October 25, 2026 01:51
Closed
12 tasks done
ci/ scripts already have their own directory first on sys.path when run with uv run, and unittest discover -s ci puts ci/ there, so the 31 inserts of the ci directory were redundant. The three modules loaded from another directory (obsws from test/websocket-tier4, the recording evidence check) are imported by path with importlib instead.
zackees
force-pushed
the
ci/ban-sys-path
branch
from
October 25, 2026 01:54
ae4c1df to
dbf2611
Compare
zackees
added a commit
that referenced
this pull request
Oct 25, 2026
#2311 (now on master) bans sys.path edits; the merge group failed test_no_sys_path_edits on ci/test_deb_asset_name.py:17.
This was referenced Oct 25, 2026
zackees
added a commit
that referenced
this pull request
Oct 25, 2026
This was referenced Oct 25, 2026
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 25, 2026
…t#2330) * ci: Test that the Qt lane's unittest command imports its modules (RED) Since obs-rust#2311 no test puts ci/ on sys.path, so the Qt Frontend Linux lane's 'python -m unittest ci.test_...' fails with ModuleNotFoundError: platform_ifdef_ratchet on every frontend PR. * ci: Put ci/ on PYTHONPATH for the Qt lane's unittest command (GREEN) The real-Qt tests import their ci/ siblings (platform_ifdef_ratchet, test_settings_platform_facade) by name, which obs-rust#2311 left to the caller. Fixes the Qt Frontend Linux lane on every frontend PR.
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 25, 2026
* ci: Test that the .deb asset names its Ubuntu release (RED) Refs obs-rust#2297 * release: Name the .deb after the Ubuntu release it needs (GREEN) The asset was OBS-Studio-Rust-<ver>-linux-x86_64.deb, which reads as the Linux .deb, but dpkg-shlibdeps pins it to the build runner's Ubuntu 26.04 libraries. Name it <ver>-ubuntu-26.04-x86_64.deb from the runner's os-release, and say 26.04 only in the release body. Fixes obs-rust#2297 * ci: Import release_decision without editing sys.path (obs-rust#2311)
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.
Maintainer request: a
sys.path.insert(0, ...)usually means a script isn't run throughuv run, so it should fail lint. Part of #2294's cleanup.ci/test_no_sys_path_edits.py, which runs in./lintthrough the ci/ self-tests. It's an AST check over every tracked.py(exceptdeps/,plugins/obs-websocket/,plugins/obs-browser/) forsys.path.insert/append/extend/..., assignment, augmented assignment and slice assignment. Comments don't match, and the detector has its own test. It failed on 35 sites.ci/directory are removed. A script run withuv run ci/x.pyalready has its own directory assys.path[0], andunittest discover -s ciaddsci/. Stale# noqa: E402markers and unusedimport syslines go with them.rust/tools/benchmarks/recording.py,test/packaged-startup.pyandrust/obs-build/tests/libobs/websocket_probe.pyloadobswsandrecording_evidence_checkby file path throughimportlib../lintpasses excepttest_local_gate_probe.py, which fails on master too for hosts with soldr ≥ 0.9.41. ci: soldr 0.9.42 verdict ledger; native Dylint beside Clippy (#2293) #2309 fixes it.