-
Notifications
You must be signed in to change notification settings - Fork 347
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
Feature/pypi #196
Open
EmDash00
wants to merge
15
commits into
MIT-SPARK:master
Choose a base branch
from
EmDash00:feature/pypi
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/pypi #196
Changes from 7 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
3e847db
feat. buildable and installable wheels
EmDash00 9a1f06e
remove default(none) so clang v17+ doesn't complain
EmDash00 15f2ea0
Upgrade pybind11 to v2.13.6, gain support for numpy 2.0
EmDash00 6f11f10
Add alternate rpaths for normal builds without sckit-build
EmDash00 d0c5610
Make to to install the python files to the wheel
EmDash00 033c4a7
Make the bindings for RobustRegistrationSolver more Pythonic
EmDash00 7567efa
export compile commands
EmDash00 e7ba9bf
Make python bindings overall more pythonic, add type interface
EmDash00 fb3c7fa
add python development dependencies
EmDash00 d65b67e
undo experimental package name change
EmDash00 9c0305c
Fix double declarations of enums while mantaining backwards compatabi…
c8a591e
Update example
67d3bec
Refactor, fix typos, and format python bindings; annotate OMP_MAX_THR…
EmDash00 27a0311
Make python binding of RobustRegistrationSolver constructor backwards…
EmDash00 43454c8
Add properties to make things more pythonic
EmDash00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[build-system] | ||
requires = ["scikit_build_core", "pybind11"] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[project] | ||
name = "teaserpp_python" | ||
version = "1.1.0" | ||
description = "Python binding for TEASER++" | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "Jingnan Shi", email = "[email protected]" }, | ||
] | ||
keywords = [ | ||
"Point cloud", | ||
"Registration", | ||
"Non-minimal solver", | ||
"Solver", | ||
] | ||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Education", | ||
"Intended Audience :: Other Audience", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: MacOS", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: Unix", | ||
"Programming Language :: C++", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
] | ||
dependencies = [ | ||
"numpy", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/MIT-SPARK/TEASER-plusplus" | ||
|
||
[tool.scikit-build] | ||
build-dir = "build/{wheel_tag}" | ||
build.verbose = false | ||
cmake.version = ">=3.16" | ||
wheel.install-dir = "teaserpp_python.libs" | ||
|
||
[tool.cibuildwheel] | ||
archs = ["auto64"] | ||
skip = ["*-musllinux*", "pp*", "cp36-*"] | ||
|
||
[tool.cibuildwheel.macos] | ||
environment = "MACOSX_DEPLOYMENT_TARGET=10.14" | ||
archs = ["auto64", "arm64"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (same question) I'm just curious; is |
||
|
||
project(teaser_python_bindings) | ||
|
||
|
@@ -24,10 +25,12 @@ endif () | |
|
||
# make sure to output the build file to teaserpp_python folder | ||
SET_TARGET_PROPERTIES(teaserpp_python | ||
PROPERTIES | ||
PREFIX "" | ||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/teaserpp_python" | ||
) | ||
PROPERTIES | ||
PREFIX "" | ||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/teaserpp_python" | ||
INSTALL_RPATH "$ORIGIN/../teaserpp_python.libs/lib;$ORIGIN/../../teaser/" | ||
BUILD_WITH_INSTALL_RPATH TRUE | ||
) | ||
|
||
# copy package __init__.py file | ||
configure_file(teaserpp_python/__init__.py | ||
|
@@ -43,3 +46,13 @@ file(COPY . | |
DESTINATION . | ||
FILES_MATCHING | ||
PATTERN *.py) | ||
|
||
if (DEFINED SKBUILD) | ||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/teaserpp/ | ||
DESTINATION "../teaserpp" | ||
FILES_MATCHING PATTERN "*.py" | ||
PATTERN "*.pyi" | ||
PATTERN "*.so" | ||
) | ||
install(TARGETS teaserpp_python DESTINATION "../teaserpp_python") | ||
endif () |
This file contains 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 file contains 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 file contains 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
Oops, something went wrong.
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.
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.
I'm just curious; is
compile_commands.json
needed to support pip installation?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.
No this is not. The compile flags just are convenient for development. The C++ linters and LSPs can use them to locate included libraries like pybind and Eigen so I don't get a billion errors everywhere and can get completion from the included libraries. I use
clangd
as my LSP so it's just helpful for me. I'm not sure if VSCode or other IDEs have more automatic detection. I'm just using a barebones setup with Neovim and their built-in LSP/linting support.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.
Thanks for your kind answer. I thought
compile_commands.json
was needed pip3. But isn't can be produced by-DCMAKE_EXPORT_COMPILE_COMMANDS=1
?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.
I think it can yeah. I think when building with
scikit-build
it was easier just to put it in the file since I had to figure out a way to pass it through in the pyproject file. We could probably put a switch there where they aren't made during release builds.