Skip to content

Commit b6ad186

Browse files
committed
Also create stubs for pip --editable / tox --develop
1 parent bd9807e commit b6ad186

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎setup.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from pathlib import Path
99

1010
from setuptools import setup
11+
from setuptools.command.editable_wheel import editable_wheel
1112
from setuptools.command.install import install
1213

1314
from extension_helpers import get_extensions
@@ -34,6 +35,14 @@ def run(self):
3435
install_stubs(self.build_lib, self.root)
3536

3637

38+
class EditableInstallWithStubs(editable_wheel):
39+
"""Post-installation command for editable_wheel mode."""
40+
41+
def run(self):
42+
super().run()
43+
install_stubs(self.project_dir, self.project_dir)
44+
45+
3746
# Specify the minimum version for the Numpy C-API
3847
for ext in ext_modules:
3948
if ext.include_dirs and "numpy" in ext.include_dirs[0]:
@@ -44,5 +53,6 @@ def run(self):
4453
ext_modules=ext_modules,
4554
cmdclass={
4655
"install": InstallWithStubs,
56+
"editable_wheel": EditableInstallWithStubs,
4757
},
4858
)

0 commit comments

Comments
 (0)