From f4683e04c5f63c32b660f3d275cde6e9ad042055 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl>
Date: Thu, 1 Jul 2021 17:10:38 +0200
Subject: [PATCH] 3.6 and 3.7 inexplicably hang

---
 .travis.yml                |  4 ----
 CHANGELOG.md               |  2 +-
 snakehouse/multibuild.py   | 21 ++++++++++++++-------
 snakehouse/requirements.py |  1 +
 4 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index f79890d..e2c607e 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 84dbae1..56d50ca 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 3ca65d8..1ec2a33 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 80c5b8d..85eb4e8 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)
 
 
-- 
GitLab