Skip to content

Commit

Permalink
ARROW-17389: [Python] Properly exclude tests when PYARROW_INSTALL_TES…
Browse files Browse the repository at this point in the history
…TS=0 (#13904)

Authored-by: Miles Granger <[email protected]>
Signed-off-by: Joris Van den Bossche <[email protected]>
  • Loading branch information
milesgranger authored Aug 23, 2022
1 parent 9882df5 commit 8b89147
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,14 @@ def has_ext_modules(foo):

if strtobool(os.environ.get('PYARROW_INSTALL_TESTS', '1')):
packages = find_namespace_packages(include=['pyarrow*'])
exclude_package_data = {}
else:
packages = find_namespace_packages(include=['pyarrow*'],
exclude=["pyarrow.tests*"])
# setuptools adds back importable packages even when excluded.
# https://github.com/pypa/setuptools/issues/3260
# https://github.com/pypa/setuptools/issues/3340#issuecomment-1219383976
exclude_package_data = {"pyarrow": ["tests*"]}


setup(
Expand All @@ -633,6 +638,7 @@ def has_ext_modules(foo):
zip_safe=False,
package_data={'pyarrow': ['*.pxd', '*.pyx', 'includes/*.pxd']},
include_package_data=True,
exclude_package_data=exclude_package_data,
distclass=BinaryDistribution,
# Dummy extension to trigger build_ext
ext_modules=[Extension('__dummy__', sources=[])],
Expand Down

0 comments on commit 8b89147

Please sign in to comment.