summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..d6b7783
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,25 @@
+import fnmatch
+from setuptools import setup
+from setuptools.command.build_py import build_py as build_py_orig
+
+
+exclude = ['*Tests']
+
+
+class build_py(build_py_orig):
+
+ def find_package_modules(self, package, package_dir):
+ """
+ Custom module to find package modules.
+ It will strip out any modules which match the glob patters in exclude above
+ """
+ modules = super().find_package_modules(package, package_dir)
+ return [(pkg, mod, file, ) for (pkg, mod, file, ) in modules
+ if not any(fnmatch.fnmatchcase(mod, pat=pattern)
+ for pattern in exclude)]
+
+setup(
+ cmdclass={
+ 'build_py': build_py,
+ }
+) \ No newline at end of file