Skip to content

Re-compress the Python Wheel package with bzip2 to shave off 7 MB.#3982

Merged
thomas11 merged 1 commit into
masterfrom
tkappler/pypi-compress
Feb 25, 2025
Merged

Re-compress the Python Wheel package with bzip2 to shave off 7 MB.#3982
thomas11 merged 1 commit into
masterfrom
tkappler/pypi-compress

Conversation

@thomas11

@thomas11 thomas11 commented Feb 24, 2025

Copy link
Copy Markdown
Contributor

The provider is currently blocked from releasing the Python SDK because the size of the Wheel package reached 100 MB, see #3977.

While we're waiting on PyPi to increase our limit (if they do), I looked into better compression. Turns out that the package is currently compressed via zip's deflate method, while the better bzip2 would also be valid.

I first tried to use bzip2 directly when building the package, but failed due to pypa/setuptools#2491. This PR instead builds the Wheel as before, then unzips it and re-zips it with bzip2.

A test run shows that it works. The package is 93.8 MB and is uploaded. It fails after upload with The use of local versions in Version(2.89.0a1740429149+ded80e4) is not allowed but that's because provider-version-action adds the local commit when it's a workflow run that's not on the main branch.

@github-actions

github-actions Bot commented Feb 24, 2025

Copy link
Copy Markdown
Contributor

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@codecov

codecov Bot commented Feb 24, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.49%. Comparing base (5fae1a9) to head (518f5b2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3982   +/-   ##
=======================================
  Coverage   57.49%   57.49%           
=======================================
  Files          82       82           
  Lines       13078    13078           
=======================================
  Hits         7519     7519           
  Misses       4984     4984           
  Partials      575      575           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thomas11 thomas11 force-pushed the tkappler/pypi-compress branch 2 times, most recently from e2da4f6 to 4f1fc10 Compare February 24, 2025 17:08
@thomas11 thomas11 force-pushed the tkappler/pypi-compress branch from 4f1fc10 to b3854a1 Compare February 24, 2025 18:22

@danielrbradley danielrbradley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like a good approach. Have downloaded the artifact and it looks okay to me too

@thomas11 thomas11 merged commit b512293 into master Feb 25, 2025
@thomas11 thomas11 deleted the tkappler/pypi-compress branch February 25, 2025 10:06
thomas11 added a commit that referenced this pull request Feb 26, 2025
thomas11 added a commit that referenced this pull request Feb 26, 2025
thomas11 added a commit that referenced this pull request Feb 26, 2025
Also reverts _"Re-compress the Python Wheel package with bzip2 to shave
off 7 MB. (#3982)"_ which didn't work because Pypi doesn't accept bzip2
even though the Wheel standard allows it.
@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v2.89.0.

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