Deprecate isolated_filesystem and document its limits - #3704
Merged
Conversation
kdeldycke
force-pushed
the
deprecate-isolated-filesystem
branch
from
July 17, 2026 21:40
7afc4df to
ea8140a
Compare
kdeldycke
requested review from
Rowlando13 and
davidism
and removed request for
davidism
July 17, 2026 21:41
Member
|
Just a nit. Can you add a test of the deprecation warning? |
kdeldycke
force-pushed
the
deprecate-isolated-filesystem
branch
from
July 20, 2026 12:20
ea8140a to
c2ed414
Compare
Collaborator
Author
Ah yes, you probably missed it because it was in |
claytonlin1110
added a commit
to claytonlin1110/diffmeter
that referenced
this pull request
Jul 21, 2026
score_diff() and score_pull_request() now score files in parallel via a thread pool (--jobs, default 8; --jobs 1 disables it). Biggest win is --pr mode, dominated by network round-trips: measured 25s -> 7s on a real 10-file PR (pallets/click#3704), with byte-identical output between sequential and concurrent runs. Before adding any of that, fixed a real hazard it would have introduced: languages.get_parser() cached tree-sitter Parser objects in a process-wide @lru_cache, so every thread would share and call .parse() on the *same* Parser instance -- not documented as safe for concurrent use, and would likely have meant intermittent corruption or crashes under load. Switched to a thread-local cache (confirmed the underlying library returns a fresh Parser per call, so each thread now gets its own). Locked in with a test that forces two distinct OS threads via threading.Thread directly, since a naive ThreadPoolExecutor-based version of that test can silently reuse one idle worker for both calls and pass for the wrong reason.
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 is an attempt to deprecate
isolated_filesystemfrom theCliRunner. It has been discussed in #3501.In addition to the deprecation, I added some explicit documentation about thread-safety as discussed in #3501. I used our own usage of
pytest-xdistas a good example to follow.All occurrences of
isolated_filesystemin our own test suite have been removed and we are now relying on Pytest'stmp_path.I also inaugurated the
docs/upgrade-guides.mdsection introduced a while ago by @Rowlando13 .This PR closes #3700.