Skip to content

Commit

Permalink
Merge pull request #1813 from borglab/python-typing
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Aug 26, 2024
2 parents 55e3ac5 + 1744c4a commit 74b149f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
11 changes: 9 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,18 @@ if(GTSAM_UNSTABLE_BUILD_PYTHON)
endif()

# Add custom target so we can install with `make python-install`
set(GTSAM_PYTHON_INSTALL_TARGET python-install)
add_custom_target(${GTSAM_PYTHON_INSTALL_TARGET}
if (NOT WIN32) # WIN32=1 is target platform is Windows
add_custom_target(python-install
COMMAND stubgen -q -p gtsam -o ./stubs && cp -a stubs/gtsam/ gtsam && ${PYTHON_EXECUTABLE} -m pip install --user .
DEPENDS ${GTSAM_PYTHON_DEPENDENCIES}
WORKING_DIRECTORY ${GTSAM_PYTHON_BUILD_DIRECTORY})
else()
#TODO(Varun) Find equivalent cp on Windows
add_custom_target(python-install
COMMAND ${PYTHON_EXECUTABLE} -m pip install --user .
DEPENDS ${GTSAM_PYTHON_DEPENDENCIES}
WORKING_DIRECTORY ${GTSAM_PYTHON_BUILD_DIRECTORY})
endif()

# Custom make command to run all GTSAM Python tests
add_custom_target(
Expand Down
3 changes: 2 additions & 1 deletion python/dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-r requirements.txt
pyparsing>=2.4.2
pyparsing>=2.4.2
mypy==1.4.1 #TODO(Varun) A bug in mypy>=1.5.0 causes an unresolved placeholder error when importing numpy>=2.0.0 (https://github.com/python/mypy/issues/17396)
1 change: 1 addition & 0 deletions python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package_data = {
"./*.so",
"./*.dll",
"./*.pyd",
"*.pyi", "**/*.pyi", # Add the type hints
]
}

Expand Down

0 comments on commit 74b149f

Please sign in to comment.