Merge pull request #1813 from borglab/python-typing
commit
74b149fa7c
|
@ -263,11 +263,18 @@ if(GTSAM_UNSTABLE_BUILD_PYTHON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add custom target so we can install with `make python-install`
|
# Add custom target so we can install with `make python-install`
|
||||||
set(GTSAM_PYTHON_INSTALL_TARGET python-install)
|
if (NOT WIN32) # WIN32=1 is target platform is Windows
|
||||||
add_custom_target(${GTSAM_PYTHON_INSTALL_TARGET}
|
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 .
|
COMMAND ${PYTHON_EXECUTABLE} -m pip install --user .
|
||||||
DEPENDS ${GTSAM_PYTHON_DEPENDENCIES}
|
DEPENDS ${GTSAM_PYTHON_DEPENDENCIES}
|
||||||
WORKING_DIRECTORY ${GTSAM_PYTHON_BUILD_DIRECTORY})
|
WORKING_DIRECTORY ${GTSAM_PYTHON_BUILD_DIRECTORY})
|
||||||
|
endif()
|
||||||
|
|
||||||
# Custom make command to run all GTSAM Python tests
|
# Custom make command to run all GTSAM Python tests
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
-r requirements.txt
|
-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)
|
|
@ -13,6 +13,7 @@ package_data = {
|
||||||
"./*.so",
|
"./*.so",
|
||||||
"./*.dll",
|
"./*.dll",
|
||||||
"./*.pyd",
|
"./*.pyd",
|
||||||
|
"*.pyi", "**/*.pyi", # Add the type hints
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue