-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.py
More file actions
28 lines (21 loc) · 790 Bytes
/
build.py
File metadata and controls
28 lines (21 loc) · 790 Bytes
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
from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError
from setuptools import Extension
from setuptools.command.build_ext import build_ext
extensions = [
Extension("memmod.memscan", sources=["memmod/memscan.c"])
]
class BuildFailed(Exception):
pass
class ExtBuilder(build_ext):
def run(self):
try:
build_ext.run(self)
except (DistutilsPlatformError, FileNotFoundError):
pass
def build_extension(self, ext):
try:
build_ext.build_extension(self, ext)
except (CCompilerError, DistutilsExecError, DistutilsPlatformError, ValueError):
pass
def build(setup_kwargs):
setup_kwargs.update({ "ext_modules": extensions, "cmdclass": {"build_ext": ExtBuilder} })