# setup.py import setuptools import glob import os # You can load existing pyproject.toml configuration if needed, # or just define the extension directly here. # Example: Finding C++ sources dynamically cpp_sources = glob.glob("mediawiki-php-wikidiff2/src/lib/*.cpp", recursive=True) # Finds all .cpp files in src and subdirs cpp_sources += ["pywikidiff2/pywikidiff2.cpp"] # Filter out test files or other unwanted files if necessary # cpp_sources = [f for f in cpp_sources if not "test" in f] my_extension = setuptools.Extension( "pywikidiff2", sources=cpp_sources, include_dirs=[], extra_compile_args=["-Wall", "-std=c++17", "-fPIC","-lthai","-lstdc++", "-O3"], extra_link_args=["-lthai", "-lstdc++","-fPIC"], language="c++", ) setuptools.setup( # Load metadata from pyproject.toml # (requires setuptools>=61.0 for declarative config) # This setup() call essentially acts as a wrapper ext_modules=[my_extension], )