Skip to content

Do not install C sources in binary distributions #46739

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

Merged

Conversation

musicinmybrain
Copy link
Contributor

@musicinmybrain musicinmybrain commented Apr 11, 2022

With this PR, binary distributions, including wheels, no longer contain .c and .h C source files in pandas/_libs/src and pandas/_libs/tslibs/src. Shipping these sources in binary distributions doesn’t seem to have any clear benefit.

This does not affect source distributions, and Cython sources (.pyx), definition files (.pxd), and include files (.pxi) are still installed with binary distributions.

  • closes #xxxx (Replace xxxx with the Github issue number) No issue filed
  • Tests added and passed if fixing a bug or adding a new feature Not applicable
  • All code checks passed.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature. Should I do this?

This does not affect source distributions, and Cython sources (.pyx) are
still installed.
@WillAyd
Copy link
Member

WillAyd commented Apr 11, 2022

Does this make a noticeable difference in wheel size at all? Somewhat inclined to just keep them as is so that the source code stays intact

@musicinmybrain
Copy link
Contributor Author

Does this make a noticeable difference in wheel size at all? Somewhat inclined to just keep them as is so that the source code stays intact

On Python 3.10 / Linux / x86_64, for the .whl file, it saves 90kiB of 35MiB, and for the uncompressed wheel contents, it saves 452kiB of 138MiB. It’s probably negligible in the context of a package as large as Pandas.

If this isn’t merged upstream—which is fine—we’ll probably still carry the patch downstream in Fedora Linux. There are other ways for users of the python-pandas RPM package to access the C sources (source RPMs, or debuginfo/debugsource RPMs for debugging), and we tend not to want to ship .h files in a package that isn’t a -devel package.

@jreback
Copy link
Contributor

jreback commented Apr 13, 2022

does this change the sdists at all? cc @fangchenli

@jreback jreback added the Build Library building on various platforms label Apr 13, 2022
@fangchenli
Copy link
Member

does this change the sdists at all? cc @fangchenli

I checked. The .c and .h files are still in the sdist. So it probably doesn't change the sdist.

@musicinmybrain
Copy link
Contributor Author

does this change the sdists at all? cc @fangchenli

I checked. The .c and .h files are still in the sdist. So it probably doesn't change the sdist.

Correct: as mentioned in the original PR description, this affects binary distributions including wheels, but not source distributions.

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label May 14, 2022
@musicinmybrain
Copy link
Contributor Author

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

There is nothing else to be done here. The PR simply needs to be approved or rejected.

@fangchenli fangchenli removed the Stale label May 16, 2022
@jreback jreback added this to the 1.5 milestone May 16, 2022
@jreback
Copy link
Contributor

jreback commented May 16, 2022

cc @simonjayhawkins if any issues

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Jun 16, 2022
@simonjayhawkins
Copy link
Member

cc @simonjayhawkins if any issues

let's merge on green and we can then check nightlies that there are no build issues.

@simonjayhawkins simonjayhawkins merged commit 111bcbb into pandas-dev:main Jun 16, 2022
@simonjayhawkins
Copy link
Member

Thanks @musicinmybrain

yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants