1
1
import contextlib
2
2
import os
3
+ import sys
3
4
4
5
import setuptools
5
6
from setuptools import Extension , find_namespace_packages , setup
6
7
from setuptools .command .build_ext import build_ext
7
8
8
- __version__ = "1.5.0 "
9
+ __version__ = "1.5.1 "
9
10
"""
10
11
As per
11
12
https://github.com/pybind/python_example
@@ -24,6 +25,7 @@ class get_pybind_include(object):
24
25
until it is actually installed, so that the ``get_include()``
25
26
method can be invoked.
26
27
"""
28
+
27
29
def __str__ (self ):
28
30
import pybind11
29
31
@@ -83,8 +85,7 @@ def cpp_flag(compiler):
83
85
if has_flag (compiler , flag ):
84
86
return flag
85
87
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!" )
88
89
89
90
90
91
class BuildExt (build_ext ):
@@ -119,8 +120,9 @@ def build_extensions(self):
119
120
opts .append ("-fvisibility=hidden" )
120
121
121
122
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
+ ]
124
126
ext .extra_compile_args = opts
125
127
ext .extra_link_args = link_opts
126
128
build_ext .build_extensions (self )
@@ -139,6 +141,17 @@ def build_extensions(self):
139
141
namespace_packages = ["cmtj" ],
140
142
packages = find_namespace_packages (include = ["cmtj.*" ]),
141
143
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
+ ],
142
155
setup_requires = ["pybind11>=2.6.1" ],
143
156
cmdclass = {"build_ext" : BuildExt },
144
157
zip_safe = False ,
0 commit comments