-
Notifications
You must be signed in to change notification settings - Fork 888
Use pyproject.toml for building #1112
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit completes the migration from setup.py to a modern pyproject.toml-based build system using scikit-build-core. The new system is standards-compliant and works with any PEP 517 build tool (pip, uv, build, poetry, etc.). ## Changes Made ### Build System (pyproject.toml) - Migrated from setup.py to pyproject.toml with scikit-build-core - Updated CMake version requirement from 3.0 to 3.15 - Updated dependency versions for Python 3.13 compatibility: - joblib: 0.14.1 -> >=1.0.0 (fixes distutils deprecation) - pytest: 3.0.7 -> >=7.0.0 - Changed all pinned dependencies to minimum version specifiers (>=) - Configured wheel building with proper install directories ### CMake Configuration - Added install() commands to all 8 C++ extension modules - Fixed OpenCV dependency to only link required components (core, imgproc, calib3d) - Eliminated unnecessary VTK dependency from OpenCV's viz module - Updated minimum CMake version to 3.15 - Added proper component specification to avoid transitive dependencies ### Bug Fixes - Added missing #include <cassert> to opensfm/src/geometry/triangulation.h - Fixed compilation error with modern GCC versions ### Files Modified - pyproject.toml: New build configuration - opensfm/src/CMakeLists.txt: OpenCV component restrictions, CMake version - opensfm/src/bundle/CMakeLists.txt: Added install() command - opensfm/src/dense/CMakeLists.txt: Added install() command - opensfm/src/features/CMakeLists.txt: Added install() command - opensfm/src/geo/CMakeLists.txt: Added install() command - opensfm/src/geometry/CMakeLists.txt: Added install() command - opensfm/src/map/CMakeLists.txt: Added install() command - opensfm/src/robust/CMakeLists.txt: Added install() command - opensfm/src/sfm/CMakeLists.txt: Added install() command - opensfm/src/geometry/triangulation.h: Added cassert include - .gitignore: Added build artifacts ## Testing - All 8 C++ extensions build successfully - All 198 pytest tests pass - Verified on Python 3.13.7 with GCC 15.2.1 - Tested with uv package manager - No VTK runtime dependencies ## Benefits - Modern, standards-compliant build system - Tool-agnostic (works with pip, uv, build, poetry, etc.) - Cleaner dependency management - Better compatibility with modern Python versions - Eliminates unnecessary dependencies 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implement fallback mechanism to support both modern and legacy glog versions. Modern glog (v0.5.0+) provides native CMake config files, but older systems like Ubuntu 20.04 (glog 0.4.0) ship packages built with autotools that lack these config files. The build now attempts to use glog's native CMake config first, falling back to a custom FindGlog.cmake module if the config is not available. Both paths create the glog::glog imported target with the required GLOG_USE_GLOG_EXPORT compile definition. Changes: - Add custom FindGlog.cmake with glog::glog target creation - Implement CONFIG-first detection with FindModule fallback in CMakeLists.txt - Update foundation and test libraries to use glog::glog target - Add status messages indicating which detection method succeeded This ensures compatibility across Ubuntu 20.04 (glog 0.4.0), Ubuntu 22.04+ (glog 0.6.0+), Arch Linux (glog 0.7.1), and custom glog installations. Fixes build errors with modern glog that requires GLOG_USE_GLOG_EXPORT definition when consuming the library.
1559cf0 to
19d8c58
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
pyproject.tomlmaking it possible to build the library viapip install -e .