-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
58 lines (51 loc) · 1.5 KB
/
setup.py
File metadata and controls
58 lines (51 loc) · 1.5 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from setuptools import setup, find_packages
from pybind11.setup_helpers import Pybind11Extension, build_ext
import os
# --- SAFE README READING ---
# This block checks multiple common filenames and handles errors gracefully.
# If no readme is found, it defaults to an empty string instead of crashing.
long_description = ""
possible_readmes = ["README.md", "readme.md", "README.txt"]
for f in possible_readmes:
if os.path.exists(f):
try:
with open(f, "r", encoding="utf-8") as file:
long_description = file.read()
break
except:
pass
# ---------------------------
# Define the C++ extension
ext_modules = [
Pybind11Extension(
"libbbf._bbf",
[
"src/bindings.cpp",
"src/libbbf.cpp",
"src/xxhash.cpp"
],
include_dirs=["src"],
cxx_std=17,
),
]
setup(
name="libbbf",
version="0.3.0",
author="EF1500",
author_email="rosemilovelockofficial@proton.me",
description="Bound Book Format (BBF) tools and bindings",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/ef1500/libbbf",
packages=find_packages(),
ext_modules=ext_modules,
cmdclass={"build_ext": build_ext},
entry_points={
"console_scripts": [
"cbx2bbf=libbbf.cbx2bbf:main",
"bbf2cbx=libbbf.bbf2cbx:main",
],
},
zip_safe=False,
python_requires=">=3.11",
)