Skip to content

Implement PEP 658: .whl.metadata files - #3981

Merged
ryanking13 merged 21 commits into
pyodide:mainfrom
juntyr:metadata
Jul 17, 2023
Merged

ryanking13 merged 21 commits into
pyodide:mainfrom
juntyr:metadata

Conversation

@juntyr

@juntyr juntyr commented Jul 6, 2023 •

Copy link
Copy Markdown
Contributor

Description

To make Simple JSON API more useful (pyodide/micropip#62, #3979), we now deploy the .whl.metadata files per PEP 658, so that Python packages manager could more easily identify dependencies.

A --metadata-files boolean option is added to the pyodide build-recipes command, which defaults to False for backward compatibility. When the option is passed alongside the --install option and without the --no_deps option, the METADATA file of each wheel file FILENAME.whl is now installed alongside in FILENAME.whl.metadata.

Fixes #3980

Checklists

  • Add a CHANGELOG entry
  • Add / update tests
  • Add new / update outdated documentation

@juntyr juntyr changed the title First steps towards extracting wheel metadata files (PEP 658) Implement PEP 658: .whl.metadata files Jul 6, 2023
@juntyr

juntyr commented Jul 6, 2023

Copy link
Copy Markdown
Contributor Author

@juntyr TODO: handle the build all case to propagate the metadata file extraction option

Comment thread pyodide-build/pyodide_build/buildpkg.py Resolved
Comment thread tools/deploy_s3.py Resolved
Comment thread pyodide-build/pyodide_build/buildpkg.py Resolved
@juntyr

juntyr commented Jul 7, 2023

Copy link
Copy Markdown
Contributor Author

@rth Thank you for your feedback! I've prototyped two possible implementations.

The first one, based on your suggestions can be seen at main...juntyr:pyodide:54c482b849846ff01e323824c4af84e2116916ba (note though that it's only 95% complete). It pushes the metadata extraction down to building the package. However, this requires quite invasive code changes. Furthermore, the interaction with installing is a bit weird. What if the package was built with extraction but is installed without metadata? What if it's the other way around?

At the moment, I prefer the second option, which you can see in the current diff. Metadata extraction is now pushed to the installation stage, which means the diff is very clean.

@rth rth 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 @juntyr ! No the current version is fine, that was just an approximate suggestion as to where to put it in the code.

Overall LGTM assuming tests pass, but since I was the one who proposed this feature it would be good to have a final review/apporval done by another maintainer.

Comment thread pyodide-build/pyodide_build/buildall.py Resolved

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

Thanks @juntyr for working on this!

Comment thread pyodide-build/pyodide_build/buildall.py Resolved

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

Thanks, @juntyr!

Comment thread pyodide-build/pyodide_build/common.py Resolved
@juntyr

juntyr commented Jul 15, 2023

Copy link
Copy Markdown
Contributor Author

Are the CLI docs autogenerated? If so, I probably don't need to update any further documentation.

juntyr and others added 20 commits July 15, 2023 06:09
@juntyr
juntyr marked this pull request as ready for review July 15, 2023 06:16
@juntyr

juntyr commented Jul 15, 2023

Copy link
Copy Markdown
Contributor Author

@ryanking13 @rth Thank you so much for your feedback! This PR should now be ready to me squashed and merged.

@ryanking13

Copy link
Copy Markdown
Member

Thanks!

Are the CLI docs autogenerated? If so, I probably don't need to update any further documentation.

Yes, it is auto-generated.

@ryanking13
ryanking13 merged commit 0980b51 into pyodide:main Jul 17, 2023
@juntyr
juntyr deleted the metadata branch July 17, 2023 12:18
@rth

rth commented Jul 17, 2023

Copy link
Copy Markdown
Member

Thanks a lot @juntyr and @ryanking13 for the review!

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.

Implement PEP 658: .whl.metadata files

3 participants