File: cythonize-post-clean.patch

package info (click to toggle)
sorted-nearest 0.0.41%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 328 kB
  • sloc: python: 214; sh: 20; makefile: 8
file content (31 lines) | stat: -rw-r--r-- 824 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Author: Nilesh Patra <npatra974@gmail.com>
Description: Don't cythonize while cleaning
Last-Changed: 20 July 2020
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,12 @@
 from distutils.core import setup
 from setuptools import Extension
-from Cython.Build import cythonize
+import sys
 
-
-extensions = [
+def get_extensions():
+    if "clean" in sys.argv:
+        return []
+    from Cython.Build import cythonize
+    extensions = [
     Extension(
         "sorted_nearest.src.sorted_nearest",
         ["sorted_nearest/src/sorted_nearest.pyx"],
@@ -48,6 +51,7 @@ extensions = [
         "sorted_nearest.src.tiles",
         ["sorted_nearest/src/tiles.pyx"],
     ),
-]
+    ]
+    return cythonize(extensions, language_level=3)
 
-setup(ext_modules=cythonize(extensions, language_level=3))
+setup(ext_modules=get_extensions())