@@ -258,6 +258,16 @@ def run(self):
258258 for ext in self .extensions :
259259 self .build_extension (ext )
260260
261+ # Build stubs for 'habitat_sim_bindings' to provide type information.
262+ subprocess .run (
263+ [
264+ "pybind11-stubgen" ,
265+ "habitat_sim._ext.habitat_sim_bindings" ,
266+ "-o" ,
267+ "src_python" ,
268+ ]
269+ )
270+
261271 def build_extension (self , ext ):
262272 extdir = os .path .abspath (os .path .dirname (self .get_ext_fullpath (ext .name )))
263273
@@ -441,21 +451,28 @@ def load(filename):
441451 setup (
442452 name = "habitat_sim" ,
443453 version = habitat_sim .__version__ ,
444- author = "FAIR A-STAR " ,
454+ author = "Meta " ,
445455 description = "A high performance simulator for training embodied agents" ,
446456 long_description = "" ,
447457 packages = find_packages (where = "src_python" ),
448458 package_dir = {"" : "src_python" },
449459 install_requires = requirements ,
450460 tests_require = ["hypothesis" , "pytest-benchmark" , "pytest" ],
461+ setup_requires = ["pybind11-stubgen" ],
451462 python_requires = ">=3.9" ,
452463 # add extension module
453464 ext_modules = [CMakeExtension ("habitat_sim._ext.habitat_sim_bindings" , "src" )],
454465 # add custom build_ext command
455- cmdclass = dict (build_ext = CMakeBuild ),
466+ cmdclass = {
467+ "build_ext" : CMakeBuild ,
468+ },
456469 zip_safe = False ,
457470 include_package_data = True ,
471+ package_data = {
472+ "habitat_sim" : ["py.typed" , "**/*.pyi" ],
473+ },
458474 )
475+
459476 pymagnum_build_dir = osp .join (
460477 _cmake_build_dir , "deps" , "magnum-bindings" , "src" , "python"
461478 )
0 commit comments