Merge pull request #1813 from borglab/python-typing

release/4.3a0
Varun Agrawal 2024-08-26 12:01:42 -04:00 committed by GitHub
commit 74b149fa7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 3 deletions

View File

@ -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(

View File

@ -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)

View File

@ -13,6 +13,7 @@ package_data = {
"./*.so",
"./*.dll",
"./*.pyd",
"*.pyi", "**/*.pyi", # Add the type hints
]
}