Spaces:
Running
Running
Download python/setup.py from pgg-engineering/sincekit: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/pgg-engineering/sincekit/resolve/main/python/setup.py
- Command line
-
hf download hf://spaces/pgg-engineering/sincekit/python/setup.py
-
curl -L -o setup.py https://huggingface.co/spaces/pgg-engineering/sincekit/resolve/main/python/setup.py
1.18 kB
| 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++", | |
| ) | |
| ], | |
| ) | |