diff --git a/.travis.yml b/.travis.yml index f79890dbb59e5150bd819663659561b719bf2cf4..e2c607e68206f182802933798625303b3f3d4bb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,6 @@ jobs: include: - stage: test python: "3.5" - - stage: test - python: "3.6" - - stage: test - python: "3.7" - stage: test python: "3.8" - stage: test diff --git a/CHANGELOG.md b/CHANGELOG.md index 84dbae15afd67b93effe46f2b2ccd5b6fc48e794..56d50ca9c5830421a3728bca156349e9bc362010 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ * `snakehouse` doesn't need cython and satella installed in advance * added `find_all` * made available for PyPy users -* deprecated `find_pyx` and `find_pyx_and_c` +* deprecated `find_pyx`, `find_c` and `find_pyx_and_c` # v1.4 diff --git a/snakehouse/multibuild.py b/snakehouse/multibuild.py index 3ca65d8e21ae0a2f9ded97df43e6916256f002d5..1ec2a33cdf2bb92a07077d5ff60682f8087caf95 100644 --- a/snakehouse/multibuild.py +++ b/snakehouse/multibuild.py @@ -50,19 +50,26 @@ class find_all: A directive for :class:`snakehouse.Multibuild` to locate all .pyx files, and possibly all the .c files depending on the switch - :param dir: base directory to look for files in - :param include_c_files: whether to also hook up the located .c files + :param directory: base directory to look for files in + :param include_c_files: whether to also hook up the located .c files (default False) + :param only_c_files: whether to look up only .c files (default False) """ - def __init__(self, dir: str, include_c_files: bool = False): - self.dir = dir + def __init__(self, directory: str, include_c_files: bool = False, + only_c_files: bool = False): + self.dir = directory self.include_c_files = include_c_files + self.only_c_files = only_c_files def __iter__(self): - pyx_files = find_files(self.dir, r'(.*)\.pyx', scan_subdirectories=True) - c_files = find_files(self.dir, r'(.*)\.c', scan_subdirectories=True) + if self.only_c_files: + pyx_files = [] + else: + pyx_files = find_files(self.dir, r'(.*)\.pyx', scan_subdirectories=True) + if self.include_c_files: - pyx_files = itertools.chain(pyx_files, c_files) + pyx_files = itertools.chain(pyx_files, + find_files(self.dir, r'(.*)\.c', scan_subdirectories=True)) return pyx_files diff --git a/snakehouse/requirements.py b/snakehouse/requirements.py index 80c5b8d284f9c8568c8e966880394285dbaa36c3..85eb4e8bddee486671960f6646d4871d8889847f 100644 --- a/snakehouse/requirements.py +++ b/snakehouse/requirements.py @@ -25,6 +25,7 @@ def find_c(directory_path: str) -> tp.List[str]: :param directory_path: directory to look through :return: .c files found """ + warnings.warn('This is deprecated. Use find_all instead', DeprecationWarning) return find_files(directory_path, '(.*)\\.c$', scan_subdirectories=True)