Skip to content

Update pylint to v4#1001

Merged
chvp merged 1 commit intomainfrom
chore/update-pylint
Apr 14, 2026
Merged

Update pylint to v4#1001
chvp merged 1 commit intomainfrom
chore/update-pylint

Conversation

@chvp
Copy link
Copy Markdown
Member

@chvp chvp commented Apr 14, 2026

The two work-arounds for pylint issues in our codebase could be removed:

  • The linting of code importing re and using pandas dataframes now works
  • The os.devnull workaround also isn't required anymore for getting linting results.

Closes #997

@chvp chvp requested a review from Copilot April 14, 2026 09:41
@chvp chvp self-assigned this Apr 14, 2026
@chvp chvp added the chore Repository/build/dependency maintenance label Apr 14, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.0 to pylint>=4,<5.
  • Update the custom pylint_ast_checker plugin 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.devnull override) 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.

Comment thread src/backend/workers/python/papyros/papyros.py
Comment thread src/backend/workers/python/papyros/pylint_ast_checker.py Outdated
@chvp chvp force-pushed the chore/update-pylint branch from 28cfd8f to e9021ac Compare April 14, 2026 09:47
@chvp chvp force-pushed the chore/update-pylint branch from e9021ac to fd76892 Compare April 14, 2026 10:05
@chvp chvp marked this pull request as ready for review April 14, 2026 10:06
@chvp chvp requested review from TomNaessens and bmesuere April 14, 2026 10:06
@chvp chvp merged commit 8f5ac85 into main Apr 14, 2026
6 checks passed
@chvp chvp deleted the chore/update-pylint branch April 14, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Repository/build/dependency maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update pylint

3 participants