-
Notifications
You must be signed in to change notification settings - Fork 5
ci: build python wheels for more python versions and x86 macos architectures #1183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
706d3ed
4de1997
73dbc7b
27c57df
6f6ccd9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,58 +60,41 @@ def _run_cmake(self): | |
| # The directory containing this setup.py | ||
| source = os.path.dirname(os.path.abspath(__file__)) | ||
|
|
||
| # Get setuptools build directories (following Arrow's pattern) | ||
| # Get setuptools build directories | ||
| build_cmd = self.get_finalized_command('build') | ||
| saved_cwd = os.getcwd() | ||
| build_temp = pjoin(saved_cwd, build_cmd.build_temp) | ||
| build_lib = pjoin(saved_cwd, build_cmd.build_lib) | ||
|
|
||
| if not os.path.isdir(build_temp): | ||
| self.mkpath(build_temp) | ||
|
|
||
| # Install directly to setuptools' build_lib directory | ||
| # This way setuptools finds the files without manual copying | ||
| install_prefix = pjoin(build_lib, "silodb") | ||
|
|
||
| # Configuration name (e.g., Debug, Release) | ||
| config_name = self.build_type.capitalize() | ||
|
|
||
| # Change to the build_temp directory | ||
| with changed_dir(build_temp): | ||
| # Find existing conan generators directory | ||
| # Try build/{config_name}/generators first, then build/{other_config}/generators | ||
| conan_generators_dir = None | ||
| for config in [config_name, 'Release', 'Debug']: | ||
| candidate = pjoin(source, "build", config, "generators") | ||
| if os.path.exists(candidate): | ||
| conan_generators_dir = candidate | ||
| break | ||
|
|
||
| if not conan_generators_dir: | ||
| raise RuntimeError( | ||
| "Conan dependencies not found. Please run the following first:\n" | ||
| f" mkdir -p build/{config_name} && cd build/{config_name}\n" | ||
| " conan install ../..\n" | ||
| " cmake ../.. -DBUILD_PYTHON_BINDINGS=OFF\n" | ||
| " cmake --build .\n" | ||
| "Then retry: pip install ." | ||
| ) | ||
|
|
||
| print(f"-- Using conan dependencies from {conan_generators_dir}") | ||
| # Reuse the existing cmake build directory (populated by `make dependencies`) | ||
| # so that silolib is not recompiled for each Python version | ||
| build_dir = pjoin(source, "build", config_name) | ||
|
|
||
| if not os.path.isdir(build_dir): | ||
| self.mkpath(build_dir) | ||
|
|
||
| # Change to the build_dir directory | ||
| with changed_dir(build_dir): | ||
| # --- CONFIGURE --- | ||
| cmake_options = [ | ||
| f'-DCMAKE_INSTALL_PREFIX={install_prefix}', | ||
| f'-DPython3_EXECUTABLE={sys.executable}', | ||
| # Explicitly provide include dir so CMake finds headers for | ||
| # python-build-standalone installs (used by uv) on Linux | ||
| f'-DPython3_INCLUDE_DIR={sysconfig.get_path("include")}', | ||
| f'-DCMAKE_BUILD_TYPE={config_name}', | ||
| f'-DCMAKE_PREFIX_PATH={conan_generators_dir}', | ||
| f'-DCMAKE_MODULE_PATH={conan_generators_dir}', | ||
| '-DBUILD_PYTHON_BINDINGS=ON', | ||
| # var ignored on other OSs | ||
| '-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0', | ||
| ] | ||
|
|
||
| print(f"-- Running cmake to configure project in {build_temp}") | ||
| print(f"-- Running cmake to configure project in {build_dir}") | ||
| print(f"-- Will install to: {install_prefix}") | ||
| self.spawn(['cmake'] + cmake_options + [source]) | ||
|
Comment on lines
+75
to
99
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting CMAKE_OSX_DEPLOYMENT_TARGET to 15.0 will make the wheels only compatible with macOS 15 Sequoia and later. This is quite restrictive and excludes users on macOS 14, 13, and earlier versions. Consider lowering this to a more widely compatible version like 11.0 or 12.0 to maximize compatibility across different macOS versions, especially for x86_64 builds which typically support older hardware. The comment says the var is "ignored on other OSs" but doesn't justify why 15.0 is required for macOS.