-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
35 lines (28 loc) · 1.06 KB
/
setup.py
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
32
33
34
35
import os
from glob import glob
from setuptools import find_namespace_packages, setup
from setuptools.command.build_py import build_py as _build_py
# From https://github.com/pypa/setuptools/pull/1574
class build_py(_build_py):
def find_package_modules(self, package, package_dir):
modules = super().find_package_modules(package, package_dir)
patterns = self._get_platform_patterns(
self.exclude_package_data,
package,
package_dir,
)
excluded_module_files = []
for pattern in patterns:
excluded_module_files.extend(glob(pattern))
for f in excluded_module_files:
for module in modules:
if module[2] == f:
modules.remove(module)
return modules
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
packages=find_namespace_packages(),
exclude_package_data={"": ["configuration.py", "django-admin.py", "build/*"]},
include_package_data=True,
cmdclass={"build_py": build_py},
)