Skip to content

Exclude _frozenlist.cpp from bdists/wheels#649

Merged
bdraco merged 5 commits intoaio-libs:masterfrom
musicinmybrain:no-cpp-source-in-wheel
Jun 2, 2025
Merged

Exclude _frozenlist.cpp from bdists/wheels#649
bdraco merged 5 commits intoaio-libs:masterfrom
musicinmybrain:no-cpp-source-in-wheel

Conversation

@musicinmybrain
Copy link
Copy Markdown
Contributor

@musicinmybrain musicinmybrain commented May 5, 2025

The Cython-generated C++ source file is quite large (about 500K uncompressed, when everything else in the bdist is under 200K on x86_64), and is not really useful at runtime. On x86_64, this change shrinks the compressed .whl file from 131K to 59K.

What do these changes do?

Exclude *.cpp files from binary distributions such as wheels: specifically, this affects _frozenlist.cpp, which is generated by Cython from _frozenlist.pyx. The .pyx file is still included in the wheels.

Are there changes in behavior for the user?

The .cpp file is not used at runtime, and even for debugging the .pyx file should be much more useful, since the .cpp file is dense, verbose, generated code.

Related issue number

N/A

Checklist

  • I think the code is well written
  • Unit tests for the changes exist N/A
  • Documentation reflects the changes N/A, I think
  • If you provide code modifications, please add yourself to CONTRIBUTORS.txt N/A, too trivial
    • The format is <Name> <Surname>.
    • Please keep the list in alphabetical order, the file is sorted by name.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

The Cython-generated C++ source file is quite large (about 500K, when
everything else in the bdist is under 200K), and is not really useful at
runtime.
Improve formatting and add attribution.

Co-authored-by: J. Nick Koston <nick+github@koston.org>
Copy link
Copy Markdown
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

@bdraco
Copy link
Copy Markdown
Member

bdraco commented May 5, 2025

One last thing. bdists needs to be added to https://github.com/aio-libs/frozenlist/blob/master/docs/spelling_wordlist.txt

@bdraco
Copy link
Copy Markdown
Member

bdraco commented May 5, 2025

Thanks. Will merge next time we are going to do a release

@bdraco bdraco merged commit c87f2d6 into aio-libs:master Jun 2, 2025
45 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants