Skip to content

Don't raise HTTPStatusErrors on CORS errors when querying packages in a transaction - #225

Merged
ryanking13 merged 6 commits into
pyodide:mainfrom
agriyakhetarpal:don't-raise-on-404
Jun 27, 2025
Merged

Don't raise HTTPStatusErrors on CORS errors when querying packages in a transaction#225
ryanking13 merged 6 commits into
pyodide:mainfrom
agriyakhetarpal:don't-raise-on-404

Conversation

@agriyakhetarpal

@agriyakhetarpal agriyakhetarpal commented Mar 26, 2025

Copy link
Copy Markdown
Member

Description

See #223; this PR changes the behaviour to not stop at CORS errors when querying an index. This should serve as a temporary respite when installing from indices that don't add CORS headers for 404s and the like, such as Anaconda.org. Please also see scientific-python/upload-nightly-action#130 for additional context.

@agriyakhetarpal
agriyakhetarpal marked this pull request as draft March 26, 2025 18:34
@agriyakhetarpal
agriyakhetarpal marked this pull request as ready for review March 26, 2025 18:56
@agriyakhetarpal

Copy link
Copy Markdown
Member Author

@ryanking13, is this what you had in mind?

@ryanking13 ryanking13 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.

@ryanking13, is this what you had in mind?

Yes, exactly. I think you can remove HttpStatusError from the compatibility code as it is not imported anymore.

Comment thread micropip/package_index.py Outdated
@agriyakhetarpal

Copy link
Copy Markdown
Member Author

Okay, done! I have to say this is a part of micropip's code I haven't worked with or reviewed before (I think), so I'll let you comment on the specifics or if you require any more changes.

@ryanking13 ryanking13 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.

Left a minor comment. Otherwise looks good. Thanks!

Comment thread micropip/_compat/compatibility_layer.py
@ryanking13

Copy link
Copy Markdown
Member

@agriyakhetarpal Is this okay to merge? I would like to make a micropip release before the Pyodide release.

@agriyakhetarpal

Copy link
Copy Markdown
Member Author

Hi @ryanking13, yes, this is okay to merge. I was mostly waiting for you here, in case you had any more comments :D

I also added some feedback for the Anaconda.org team regarding CORS errors on HTTP exceptions in scientific-python/upload-nightly-action#130 (which is also shown above), and I linked this PR to serve additional context.

@ryanking13

ryanking13 commented Jun 27, 2025

Copy link
Copy Markdown
Member

I see. Sorry to make you wait! There is a test failure but I believe it is not related to this PR. merging.

@ryanking13
ryanking13 merged commit 1d0548b into pyodide:main Jun 27, 2025
@agriyakhetarpal
agriyakhetarpal deleted the don't-raise-on-404 branch June 27, 2025 10:20
@agriyakhetarpal agriyakhetarpal changed the title Don't raise HTTPStatusError on CORS errors when querying packages in a transaction Don't raise HTTPStatusErrors on CORS errors when querying packages in a transaction 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