Skip to content

Move package entropy import patches to their own separate file#6696

Merged
hoodmane merged 1 commit intomainfrom
hoodmane/sort-import-patches
Apr 30, 2026
Merged

Move package entropy import patches to their own separate file#6696
hoodmane merged 1 commit intomainfrom
hoodmane/sort-import-patches

Conversation

@hoodmane
Copy link
Copy Markdown
Contributor

In preparation to disable them in the future.

@hoodmane hoodmane requested review from a team as code owners April 29, 2026 19:17
Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

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

I'm Bonk, and I've done a quick review of your PR.

This PR moves package-specific entropy import patches out of entropy_import_context.py into a new entropy_import_context_packages.py file, in preparation for disabling them later.

Issues

  1. Syntax error (high): import .entropy_import_context_packages on line 32 of entropy_import_context.py is invalid Python syntax. A bare import statement does not support relative imports; only from ... import ... does. This will cause a SyntaxError at runtime.

  2. Unused imports (low): The new entropy_import_context_packages.py imports wraps, get_bad_entropy_flag, and raise_unless_entropy_allowed but none of them are used in the file. These were carried over from the original file's import block.

Comment thread src/pyodide/internal/topLevelEntropy/entropy_import_context.py Outdated
Comment thread src/pyodide/internal/topLevelEntropy/entropy_import_context_packages.py Outdated
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Apr 29, 2026

Review posted on PR #6696. Here's a summary of the findings:

  1. Syntax error (high severity): import .entropy_import_context_packages on line 32 of entropy_import_context.py is invalid Python -- import doesn't support relative imports. It needs to be from . import entropy_import_context_packages. This will cause a SyntaxError at runtime.

  2. Unused imports (low severity): The new entropy_import_context_packages.py carries over wraps, get_bad_entropy_flag, and raise_unless_entropy_allowed from the original file's import block, but none of them are actually used.

All three issues have concrete suggestion comments on the PR.

github run

@hoodmane hoodmane force-pushed the hoodmane/sort-import-patches branch from 1ce6dbd to 1c68851 Compare April 29, 2026 19:35
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.55%. Comparing base (1f09441) to head (19eec75).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6696   +/-   ##
=======================================
  Coverage   66.55%   66.55%           
=======================================
  Files         402      402           
  Lines      115890   115890           
  Branches    19405    19405           
=======================================
  Hits        77131    77131           
  Misses      27188    27188           
  Partials    11571    11571           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

In preparation to disable them in the future.
@hoodmane hoodmane force-pushed the hoodmane/sort-import-patches branch from 1c68851 to 19eec75 Compare April 29, 2026 21:25
Copy link
Copy Markdown
Contributor

@ryanking13 ryanking13 left a comment

Choose a reason for hiding this comment

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

These entropy patches are quite scary, but yeah, moving these to workers-py should give us more control over them.

Comment thread src/pyodide/internal/topLevelEntropy/entropy_import_context.py
@hoodmane hoodmane merged commit b90ada0 into main Apr 30, 2026
24 checks passed
@hoodmane hoodmane deleted the hoodmane/sort-import-patches branch April 30, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants