22from pybind11 .setup_helpers import Pybind11Extension , build_ext
33import os
44
5+ # --- SAFE README READING ---
6+ # This block checks multiple common filenames and handles errors gracefully.
7+ # If no readme is found, it defaults to an empty string instead of crashing.
58long_description = ""
6- possible_readmes = ["README.md" ] # stupid bug.
9+ possible_readmes = ["README.md" , "readme.md" , "README.txt" ]
10+
711for f in possible_readmes :
812 if os .path .exists (f ):
9- with open (f , "r" , encoding = "utf-8" ) as file :
10- long_description = file .read ()
11- break
13+ try :
14+ with open (f , "r" , encoding = "utf-8" ) as file :
15+ long_description = file .read ()
16+ break
17+ except :
18+ pass
19+ # ---------------------------
1220
1321# Define the C++ extension
1422ext_modules = [
2533
2634setup (
2735 name = "libbbf" ,
28- version = "0.2.2" ,
36+ version = "0.2.3" , # Bumped version to ensure a clean release
2937 author = "EF1500" ,
3038 author_email = "rosemilovelockofficial@proton.me" ,
3139 description = "Bound Book Format (BBF) tools and bindings" ,
3240 long_description = long_description ,
3341 long_description_content_type = "text/markdown" ,
3442 url = "https://github.com/ef1500/libbbf" ,
3543
36- # This finds the 'libbbf_tools' folder
3744 packages = find_packages (),
38-
39- # This compiles the C++ code
4045 ext_modules = ext_modules ,
4146 cmdclass = {"build_ext" : build_ext },
4247
43- # This creates the command line tools 'cbx2bbf' and 'bbf2cbx'
4448 entry_points = {
4549 "console_scripts" : [
4650 "cbx2bbf=libbbf_tools.cbx2bbf:main" ,
5054
5155 zip_safe = False ,
5256 python_requires = ">=3.11" ,
53- )
57+ )
0 commit comments