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

BUILD: Remove tests folder in package distribution #60606

Closed
1 task done
zhan9san opened this issue Dec 26, 2024 · 1 comment
Closed
1 task done

BUILD: Remove tests folder in package distribution #60606

zhan9san opened this issue Dec 26, 2024 · 1 comment
Labels
Build Library building on various platforms Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@zhan9san
Copy link

Installation check

Platform

macOS-15.1-x86_64-i386-64bit

Installation Method

pip install

pandas Version

2.2.3

Python Version

3.11.9

Installation Logs

I discovered that the tests folder is included in the package distribution, which I believe is not a good practice.

Consider this real scenario: I use pandas in an AWS Lambda function, where the layer size limitation is 250 MB. This means all dependencies must be smaller than this limit, necessitating a reduction in the package size.

Here is what setuptools says,

final users will end up installing not only timmins.foo, but also docs and tests.tests_foo. A simple way to fix this is to adopt the aforementioned src-layout, or make sure to properly configure the include and/or exclude accordingly.

How to reproduce it

$ pip install pandas -t test-install
$ cd test-install
$ du -sh * | sort -rh
 38M	tests
 21M	_libs
 12M	core
3.6M	io
692K	plotting
224K	_testing
208K	util
140K	__pycache__
116K	compat
112K	tseries
108K	_config
 64K	errors
 48K	conftest.py
 48K	api
 24K	pyproject.toml
 24K	_version.py
 16K	_typing.py
 12K	__init__.py
8.0K	arrays
4.0K	testing.py
4.0K	_version_meson.py

Reference

AWS Lambda limitation: 250 MB The maximum size of the contents of a deployment package, including layers and custom runtimes. (unzipped)

Python setup tool: exclude tests

@zhan9san zhan9san added Build Library building on various platforms Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 26, 2024
@WillAyd
Copy link
Member

WillAyd commented Dec 26, 2024

This is a duplicate of #30741

@WillAyd WillAyd closed this as completed Dec 26, 2024
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 Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants