Skip to content

fix: api should not ignore installed, only CLI#1056

Merged
henryiii merged 4 commits into
pypa:mainfrom
henryiii:henryiii/fix/api
Apr 29, 2026
Merged

fix: api should not ignore installed, only CLI#1056
henryiii merged 4 commits into
pypa:mainfrom
henryiii:henryiii/fix/api

Conversation

@henryiii

@henryiii henryiii commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Description

Our recent change broke pyodide-build, which is manually using our API and pre-installing some dependencies that are patched for pyodide. This is a proposed fix, which keeps the API explicit (users need to opt-in with fresh=True), but our CLI opts into it.

When asking copilot CLI to do the fix, it also suggested --reinstall for uv to match pip's behavior. I haven't worked out yet if that's the best thing here, but that might not hurt to have.

🤖 Assisted-by: Copilot:GPT-5.4

Changelog

  • Added changelog fragment: docs/changelog/<pr_number>.<type>.rst
    • Types: feature, bugfix, doc, removal, misc
    • Example: 123.feature.rst containing Add custom backend support - by :user:`yourname`

Checklist

  • Tests pass locally (tox)
  • Code follows project style (tox -e fix)
  • Type checks pass (tox -e type)
  • Documentation builds (tox -e docs)

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Assisted-by: Copilot:GPT-5.4
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@henryiii

Copy link
Copy Markdown
Contributor Author

A few points to consider in review:

  • Do we want to backport this for a 1.4.x release, or just release 1.5 (Python 3.8 has been dropped)
  • Do we want to add --reinstall for uv (current state)?

@henryiii henryiii marked this pull request as ready for review April 29, 2026 15:16
@gaborbernat

Copy link
Copy Markdown
Collaborator

I'm alright to release a new version without backporting, personally.

@layday

layday commented Apr 29, 2026

Copy link
Copy Markdown
Member

I'm not sure about this. I would prefer to drop --ignore-installed than muddy the interface with a parameter that'll probably see no use outside of pyodide. Unless a good solution for PYTHONPATH can be found, I would rather simply mention it as a caveat in the docs. The DefaultIsolatedEnv could also notify the user that dependencies might fail to install if it detects that PYTHONPATH is set.

@henryiii

Copy link
Copy Markdown
Contributor Author

This does drop --ignore-installed from programmatic use (unless you know about this parameter), and makes sure only the CLI uses it, where we do control what is happening. I feel like it's a good balance between keeping python -m build working and keeping third party usage of our API stable.

How about we make this parameter private for now, and only make it public if someone needs it? That gives us the ability to solve this another way in the future, while still fixing pyodide and keeping previous fix (which seems to be working, at least no one has complained).

Comment thread src/build/env.py Outdated
@layday

layday commented Apr 29, 2026

Copy link
Copy Markdown
Member

How about we make this parameter private for now, and only make it public if someone needs it? That gives us the ability to solve this another way in the future, while still fixing pyodide and keeping previous fix (which seems to be working, at least no one has complained).

That's a good idea - let's do it that way.

Assisted-by: OpenCode:qwen3.6:27b-coding-nvfp4
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@henryiii henryiii requested a review from layday April 29, 2026 19:28
@henryiii henryiii changed the title fix: api should be explicit fix: api should not ignore installed, only CLI Apr 29, 2026
@henryiii henryiii merged commit 776f702 into pypa:main Apr 29, 2026
59 checks passed
@henryiii henryiii deleted the henryiii/fix/api branch April 29, 2026 20:54
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