import os from pathlib import Path import shlex import shutil import sysconfig from setuptools import Extension, setup # A relocated Python may name the compiler from its original build machine. # Honor explicit compiler overrides and fall back to the host's C++ compiler. if os.name == "posix": for variable, fallback in (("CC", "cc"), ("CXX", "c++")): configured = shlex.split(sysconfig.get_config_var(variable) or "") if configured and not shutil.which(configured[0]) and shutil.which(fallback): os.environ.setdefault(variable, fallback) headers = Path(__file__).resolve().parent.parent / "include" setup( name="sincekit", version="0.1.0", description="Latest-state changefeed for independent consumer cursors", python_requires=">=3.9", py_modules=["sincekit"], ext_modules=[ Extension( "_sincekit", sources=["binding.cpp"], include_dirs=[str(headers)], depends=[str(headers / name) for name in ("sincekit.h", "sincekit_batch.h")], extra_compile_args=["/std:c++17"] if os.name == "nt" else ["-std=c++17"], language="c++", ) ], )