Skip to content

Commit 6413cc9

Browse files
authored
Merge pull request #66 from LemurPwned/hotfix/submodules
attempt at improving stub detection
2 parents 0005271 + a882529 commit 6413cc9

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

setup.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import contextlib
22
import os
3+
import sys
34

45
import setuptools
56
from setuptools import Extension, find_namespace_packages, setup
67
from setuptools.command.build_ext import build_ext
78

8-
__version__ = "1.5.0"
9+
__version__ = "1.5.1"
910
"""
1011
As per
1112
https://github.com/pybind/python_example
@@ -24,6 +25,7 @@ class get_pybind_include(object):
2425
until it is actually installed, so that the ``get_include()``
2526
method can be invoked.
2627
"""
28+
2729
def __str__(self):
2830
import pybind11
2931

@@ -83,8 +85,7 @@ def cpp_flag(compiler):
8385
if has_flag(compiler, flag):
8486
return flag
8587

86-
raise RuntimeError("Unsupported compiler -- at least C++17 support "
87-
"is needed!")
88+
raise RuntimeError("Unsupported compiler -- at least C++17 support " "is needed!")
8889

8990

9091
class BuildExt(build_ext):
@@ -119,8 +120,9 @@ def build_extensions(self):
119120
opts.append("-fvisibility=hidden")
120121

121122
for ext in self.extensions:
122-
ext.define_macros = [("VERSION_INFO",
123-
f'"{self.distribution.get_version()}"')]
123+
ext.define_macros = [
124+
("VERSION_INFO", f'"{self.distribution.get_version()}"')
125+
]
124126
ext.extra_compile_args = opts
125127
ext.extra_link_args = link_opts
126128
build_ext.build_extensions(self)
@@ -139,6 +141,17 @@ def build_extensions(self):
139141
namespace_packages=["cmtj"],
140142
packages=find_namespace_packages(include=["cmtj.*"]),
141143
package_data={"cmtj": ["py.typed", "*.pyi"]},
144+
data_files=[
145+
("shared/typehints/python{}.{}/cmtj").format(
146+
*sys.version_info[:2], "cmtj/__init__.pyi"
147+
),
148+
("shared/typehints/python{}.{}/cmtj/stack").format(
149+
*sys.version_info[:2], "cmtj/stack/__init__.pyi"
150+
),
151+
("shared/typehints/python{}.{}/cmtj/noise").format(
152+
*sys.version_info[:2], "cmtj/noise/__init__.pyi"
153+
),
154+
],
142155
setup_requires=["pybind11>=2.6.1"],
143156
cmdclass={"build_ext": BuildExt},
144157
zip_safe=False,

0 commit comments

Comments
 (0)