32 lines
927 B
Python
32 lines
927 B
Python
|
|
from setuptools import setup
|
||
|
|
from setuptools.command.build_py import build_py as _build_py
|
||
|
|
from Cython.Build import cythonize
|
||
|
|
|
||
|
|
# Modules compiled to .so — exclude their .py source from the wheel
|
||
|
|
COMPILED_MODULES = {"nomyo", "SecureCompletionClient", "SecureMemory"}
|
||
|
|
|
||
|
|
|
||
|
|
class BuildPyNoPy(_build_py):
|
||
|
|
"""Skip copying .py source files for cythonized modules."""
|
||
|
|
|
||
|
|
def find_package_modules(self, package, package_dir):
|
||
|
|
modules = super().find_package_modules(package, package_dir)
|
||
|
|
return [
|
||
|
|
(pkg, mod, path)
|
||
|
|
for pkg, mod, path in modules
|
||
|
|
if not (pkg == "nomyo" and mod in COMPILED_MODULES)
|
||
|
|
]
|
||
|
|
|
||
|
|
|
||
|
|
setup(
|
||
|
|
ext_modules=cythonize(
|
||
|
|
[
|
||
|
|
"nomyo/nomyo.py",
|
||
|
|
"nomyo/SecureCompletionClient.py",
|
||
|
|
"nomyo/SecureMemory.py",
|
||
|
|
],
|
||
|
|
compiler_directives={"language_level": "3"},
|
||
|
|
),
|
||
|
|
cmdclass={"build_py": BuildPyNoPy},
|
||
|
|
)
|