Further tweak CPPDEFINES repleacement in scanner
[scons.git] / setup.py
blob9cb37592a53709dac90d3ced06fce38b657a3ae4
1 #!python3
3 import fnmatch
4 from setuptools import setup
5 from setuptools.command.build_py import build_py as build_py_orig
7 import codecs
8 import os.path
11 def read(rel_path):
12 here = os.path.abspath(os.path.dirname(__file__))
13 with codecs.open(os.path.join(here, rel_path), 'r') as fp:
14 return fp.read()
17 exclude = ['*Tests']
20 class build_py(build_py_orig):
22 def find_package_modules(self, package, package_dir):
23 """Custom module to find package modules.
25 Will strip out any modules which match the glob patters in
26 *exclude* above
27 """
28 modules = super().find_package_modules(package, package_dir)
29 return [(pkg, mod, file, ) for (pkg, mod, file, ) in modules
30 if not any(fnmatch.fnmatchcase(mod, pat=pattern)
31 for pattern in exclude)]
33 setup(
34 cmdclass={
35 'build_py': build_py,