From c400e026a3c393f90eed623264dbf9341a84902d Mon Sep 17 00:00:00 2001 From: Phil Dawson Date: Tue, 23 Apr 2019 13:59:57 +0100 Subject: setup.py: Include buildstream.testing datafiles in package_data * Remove `include_package_data=True` from setup.py * Collect datafiles for buildstream.testing by adding them to `package_data` Fixes #1008 --- setup.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 0154b4ec5..c550fdd0b 100755 --- a/setup.py +++ b/setup.py @@ -25,6 +25,8 @@ import subprocess import sys import versioneer +from pathlib import Path + ################################################################## # Python requirements @@ -117,6 +119,19 @@ def list_man_pages(): return [] +##################################################### +# List the data files needed by buildstream.testing # +##################################################### +# +# List the datafiles which need to be installed for the +# buildstream.testing package +# +def list_testing_datafiles(): + bst_dir = Path(os.path.dirname(os.path.abspath(__file__))) + data_dir = bst_dir.joinpath('buildstream', 'testing', '_sourcetests', 'project') + return [str(f) for f in data_dir.rglob('*')] + + ##################################################### # Conditional Checks # ##################################################### @@ -322,8 +337,8 @@ setup(name='BuildStream', python_requires='~={}.{}'.format(REQUIRED_PYTHON_MAJOR, REQUIRED_PYTHON_MINOR), packages=find_packages(exclude=('tests', 'tests.*')), package_data={'buildstream': ['plugins/*/*.py', 'plugins/*/*.yaml', - 'data/*.yaml', 'data/*.sh.in']}, - include_package_data=True, + 'data/*.yaml', 'data/*.sh.in', + *list_testing_datafiles()]}, data_files=[ # This is a weak attempt to integrate with the user nicely, # installing things outside of the python package itself with pip is -- cgit v1.2.1