@@ -74,6 +74,11 @@ def is_hpy_extension(ext_name):
74
74
dist .ext_modules = []
75
75
dist .ext_modules += hpy_ext_modules
76
76
77
+ class HpyExtName (str ):
78
+ def split (self , / , sep = None , maxsplit = - 1 ):
79
+ res = str .split (self , sep , maxsplit )
80
+ return [HpyExtName (x ) for x in res ]
81
+
77
82
hpy_devel = self
78
83
base_class = dist .cmdclass .get ('build_ext' , build_ext )
79
84
class build_hpy_ext (base_class ):
@@ -94,9 +99,16 @@ def build_extension(self, ext):
94
99
hpy_devel .fix_extension (ext , hpy_abi = self .distribution .hpy_abi )
95
100
return base_class .build_extension (self , ext )
96
101
102
+ def get_ext_fullname (self , ext_name ):
103
+ fullname = super ().get_ext_fullname (ext_name )
104
+ if is_hpy_extension (fullname ):
105
+ # wrap name to be able to identify in 'get_ext_filename'
106
+ return HpyExtName (fullname )
107
+ return fullname
108
+
97
109
def get_ext_filename (self , ext_name ):
98
110
# this is needed to give the .hpy.so extension to universal extensions
99
- if is_hpy_extension (ext_name ) and self .distribution .hpy_abi == 'universal' :
111
+ if ( isinstance ( ext_name , HpyExtName ) or is_hpy_extension (ext_name ) ) and self .distribution .hpy_abi == 'universal' :
100
112
ext_path = ext_name .split ('.' )
101
113
ext_suffix = '.hpy.so' # XXX Windows?
102
114
return os .path .join (* ext_path ) + ext_suffix
0 commit comments