Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Papyros Python worker’s linting stack to support Pylint v4, including updating the custom AST checker implementation and adjusting runtime/config workarounds previously needed in Pyodide.
Changes:
- Bump packaged dependency from
pylint<3.0.0topylint>=4,<5. - Update the custom
pylint_ast_checkerplugin to newer Pylint/Astroid APIs (only_required_for_messages,visit_call,astroid.nodes). - Simplify lint execution by removing prior Pyodide-specific workarounds (AstroidManager patch and
os.devnulloverride) and updating disabled message IDs in the rcfile.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/backend/workers/python/papyros/pylint_config.rc |
Updates disabled message IDs to match newer Pylint docstring checks and adjusts the suppression list. |
src/backend/workers/python/papyros/pylint_ast_checker.py |
Migrates custom checker implementation to updated Pylint/Astroid APIs and node classes. |
src/backend/workers/python/papyros/papyros.py |
Removes the os.devnull linting workaround in the Pyodide runner’s lint() method. |
src/backend/workers/python/papyros/linting.py |
Removes the AstroidManager module-resolution short-circuit patch previously used to avoid hangs in Pyodide. |
src/backend/workers/python/build_package.py |
Updates the packaged dependency constraint to pylint>=4,<5. |
Comments suppressed due to low confidence (1)
src/backend/workers/python/papyros/linting.py:18
- This change removes the earlier AstroidManager patch that short-circuited module resolution to avoid indefinite hangs in the single-threaded Pyodide/WASM environment. There’s no replacement safeguard here (e.g., a timeout, a version-guarded patch, or a test proving the hang is fixed in the new pylint/astroid versions), so a regression could stall the worker during linting. Please either restore a guarded workaround or add a regression test/clear evidence that pylint>=4 no longer triggers this hang in Pyodide.
from pylint.lint import Run
from pylint.reporters.text import TextReporter
PYLINT_RC_FILE = os.path.abspath("/tmp/papyros/pylint_config.rc")
PYLINT_PLUGINS = "pylint_ast_checker"
def lint(code):
# Use temporary file to prevent Astroid cache from running into issues
with NamedTemporaryFile() as tmpf:
tmpf.write(bytes(code, encoding="utf-8"))
tmpf.seek(0)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
28cfd8f to
e9021ac
Compare
e9021ac to
fd76892
Compare
TomNaessens
approved these changes
Apr 14, 2026
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.
The two work-arounds for pylint issues in our codebase could be removed:
Closes #997