@@ -264,6 +264,16 @@ def run(self):
264
264
for ext in self .extensions :
265
265
self .build_extension (ext )
266
266
267
+ # Build stubs for 'habitat_sim_bindings' to provide type information.
268
+ subprocess .run (
269
+ [
270
+ "pybind11-stubgen" ,
271
+ "habitat_sim._ext.habitat_sim_bindings" ,
272
+ "-o" ,
273
+ "src_python" ,
274
+ ]
275
+ )
276
+
267
277
def build_extension (self , ext ):
268
278
extdir = os .path .abspath (os .path .dirname (self .get_ext_fullpath (ext .name )))
269
279
@@ -450,21 +460,28 @@ def load(filename):
450
460
setup (
451
461
name = "habitat_sim" ,
452
462
version = habitat_sim .__version__ ,
453
- author = "FAIR A-STAR " ,
463
+ author = "Meta " ,
454
464
description = "A high performance simulator for training embodied agents" ,
455
465
long_description = "" ,
456
466
packages = find_packages (where = "src_python" ),
457
467
package_dir = {"" : "src_python" },
458
468
install_requires = requirements ,
459
469
tests_require = ["hypothesis" , "pytest-benchmark" , "pytest" ],
470
+ setup_requires = ["pybind11-stubgen" ],
460
471
python_requires = ">=3.9" ,
461
472
# add extension module
462
473
ext_modules = [CMakeExtension ("habitat_sim._ext.habitat_sim_bindings" , "src" )],
463
474
# add custom build_ext command
464
- cmdclass = dict (build_ext = CMakeBuild ),
475
+ cmdclass = {
476
+ "build_ext" : CMakeBuild ,
477
+ },
465
478
zip_safe = False ,
466
479
include_package_data = True ,
480
+ package_data = {
481
+ "habitat_sim" : ["py.typed" , "**/*.pyi" ],
482
+ },
467
483
)
484
+
468
485
pymagnum_build_dir = osp .join (
469
486
_cmake_build_dir , "deps" , "magnum-bindings" , "src" , "python"
470
487
)
0 commit comments