Skip to content

MAINT Inject compat layer to Transaction - #213

Merged
ryanking13 merged 3 commits into
pyodide:mainfrom
ryanking13:compat-inject-transaction
Jun 27, 2025
Merged

MAINT Inject compat layer to Transaction#213
ryanking13 merged 3 commits into
pyodide:mainfrom
ryanking13:compat-inject-transaction

Conversation

@ryanking13

Copy link
Copy Markdown
Member

Related: #112

Another PR that removes direct ._compat import from child classes and functions. No functional changes are included.

@agriyakhetarpal agriyakhetarpal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, @ryanking13! The code changes LGTM. Could you please elaborate on the (immediate) further ideas after this PR? If I understand correctly, the idea in this PR has been to isolate the transactions better, based on the environment micropip is running in. I apologise that this PR has gone stale, in case your plans evade your memory!

Comment thread micropip/package_index.py
Comment on lines +268 to +270
*,
# TODO: instead of passing this as a parameter, it should be a class attribute
compat_layer: type[CompatibilityLayer],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree with the comment. Could you please open a issue to track it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks. I opened an issue to track the progress (#237). Not just for this comment but for overall refactoring for the compatibility layer.

@ryanking13

Copy link
Copy Markdown
Member Author

Thanks for the question @agriyakhetarpal! The goal for these PRs is to remove the global compatibility layer and make it a dependency of the PackageManager class. By doing that,

  1. Users can use their custom compatibility layer to modify the behavior of micropip. Ideally, it makes it possible using micropip in non-pyodide environment as well.
  2. We can get rid of _compat_not_in_pyodide.py from the wheel. We can remove it or use it in test files only.

@agriyakhetarpal

Copy link
Copy Markdown
Member

Thanks for the explanation! That makes sense to me.

@ryanking13
ryanking13 merged commit d31dc66 into pyodide:main Jun 27, 2025
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.

2 participants