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

Strip tests from numpy and pandas #150

Merged
merged 2 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions package/python-numpy/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ config BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
default y if BR2_sh
default y if BR2_x86_64

config BR2_PACKAGE_PYTHON_NUMPY_TESTS
bool "numpy.tests"
help
Include test files.
Selecting this option adds about 2.5 MB to the target file
system.

config BR2_PACKAGE_PYTHON_NUMPY
bool "python-numpy"
depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
Expand Down
8 changes: 8 additions & 0 deletions package/python-numpy/python-numpy.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,13 @@ endef
# in the staging area.
PYTHON_NUMPY_INSTALL_STAGING = YES

ifneq ($(BR2_PACKAGE_PYTHON_NUMPY_TESTS),y)
define PYTHON_NUMPY_REMOVE_TESTS
find $(TARGET_DIR)/usr/lib/python*/site-packages/numpy/ \
-name tests -prune -exec rm -rf {} \;
endef
PYTHON_NUMPY_POST_INSTALL_TARGET_HOOKS += PYTHON_NUMPY_REMOVE_TESTS
endif

$(eval $(python-package))
$(eval $(host-python-package))
7 changes: 7 additions & 0 deletions package/python-pandas/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ config BR2_PACKAGE_PYTHON_PANDAS
and statistics.

http://pandas.pydata.org

config BR2_PACKAGE_PYTHON_PANDAS_TESTS
bool "pandas.tests"
help
Include test files.
Selecting this option adds about 7.0 MB to the target file
system.
7 changes: 7 additions & 0 deletions package/python-pandas/python-pandas.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ PYTHON_PANDAS_SETUP_TYPE = setuptools
PYTHON_PANDAS_LICENSE = BSD
PYTHON_PANDAS_LICENSE_FILES = LICENSE

ifneq ($(BR2_PACKAGE_PYTHON_PANDAS_TESTS),y)
define PYTHON_PANDAS_REMOVE_TESTS
rm -rf $(TARGET_DIR)/usr/lib/python*/site-packages/pandas/tests
endef
PYTHON_PANDAS_POST_INSTALL_TARGET_HOOKS += PYTHON_PANDAS_REMOVE_TESTS
endif

$(eval $(python-package))