Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly encode RECORD hashes #39

Merged
merged 1 commit into from
Mar 20, 2023
Merged

Conversation

dlqqq
Copy link
Contributor

@dlqqq dlqqq commented Mar 20, 2023

Description

Port of the changes in pypa/installer#141 to STB. Fixes hashes in built wheel RECORD files by correcting the hashing procedure to conform to PEP 376 specifications.

Verification

  1. Checkout this branch locally, bump the minor version in src/sphinx_theme_builder/__init__.py::__version__, and run pip install -e . from the sphinx-theme-builder repository root.

  2. Clone https://github.com/pydata/pydata-sphinx-theme

  3. Run python -m build --no-isolation from the pydata-sphinx-theme repository root

  4. Run this script from the pydata-sphinx-theme repository root and verify it does not except:

import os
from installer.sources import WheelFile

WHEEL_RELPATH = 'dist/pydata_sphinx_theme-0.13.2.dev0-py3-none-any.whl'

wheel_abspath = os.path.join(os.path.dirname(__file__), WHEEL_RELPATH)

with WheelFile.open(wheel_abspath) as source:
    source.validate_record()

Next steps

This is an upstream transitive dependency of LangChain and Jupyter AI, which are significant community efforts. A release should quickly follow upon merge.

@dlqqq
Copy link
Contributor Author

dlqqq commented Mar 20, 2023

There should also be unit tests to validate this behavior, but that should not block this PR from being merged.

@pradyunsg pradyunsg changed the title fix RECORD hashes Correctly encode RECORD hashes Mar 20, 2023
@pradyunsg pradyunsg merged commit 7f5eea8 into pradyunsg:main Mar 20, 2023
@pradyunsg
Copy link
Owner

Thanks @dlqqq! I literally had a patch for this yesterday evening, but this is good-enough. :)

@dlqqq dlqqq deleted the fix-record-hashes branch March 20, 2023 14:54
@dlqqq
Copy link
Contributor Author

dlqqq commented Mar 20, 2023

@pradyunsg Anything blocking a 0.2.0b2/0.3.0 release today?

@pradyunsg
Copy link
Owner

The lack of free time on my end. I'll try to find some. :)

@dlqqq
Copy link
Contributor Author

dlqqq commented Mar 21, 2023

@pradyunsg I understand you're busy, but do you think you could spare 10 minutes today to cut a release? Again, this is a transitive dependency of a lot of other projects in the Python ecosystem, so quick action would be appreciated 🤗

I can assist in this as well, but I'm not sure if you're comfortable with assigning me any privileges as a first-time contributor.

@dlqqq
Copy link
Contributor Author

dlqqq commented Mar 24, 2023

@pradyunsg ^?

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.

None yet

2 participants