@@ -131,6 +131,14 @@ impl StableAbi {
131131 version : StableAbiVersion :: Version ( major, minor) ,
132132 }
133133 }
134+
135+ /// Create a StableAbi instance from a known abi3t version
136+ pub fn from_abi3t_version ( major : u8 , minor : u8 ) -> StableAbi {
137+ StableAbi {
138+ kind : StableAbiKind :: Abi3t ,
139+ version : StableAbiVersion :: Version ( major, minor) ,
140+ }
141+ }
134142}
135143
136144/// Python version to use as the abi3/abi3t target.
@@ -145,7 +153,7 @@ pub enum StableAbiVersion {
145153}
146154
147155impl StableAbiVersion {
148- /// Convert `StableAbiVersion` into an Option, where CurrentPython maps None
156+ /// Convert `StableAbiVersion` into an Option, where CurrentPython maps to None
149157 pub fn min_version ( & self ) -> Option < ( u8 , u8 ) > {
150158 match self {
151159 StableAbiVersion :: CurrentPython => None ,
@@ -159,12 +167,15 @@ impl StableAbiVersion {
159167pub enum StableAbiKind {
160168 /// The original stable ABI, supporting Python 3.2 and up
161169 Abi3 ,
170+ /// The free-threaded stable ABI, supporting Python 3.15 and up
171+ Abi3t ,
162172}
163173
164174impl fmt:: Display for StableAbiKind {
165175 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
166176 match self {
167177 StableAbiKind :: Abi3 => write ! ( f, "abi3" ) ,
178+ StableAbiKind :: Abi3t => write ! ( f, "abi3t" ) ,
168179 }
169180 }
170181}
@@ -174,6 +185,7 @@ impl StableAbiKind {
174185 pub fn wheel_tag ( & self ) -> & str {
175186 match self {
176187 StableAbiKind :: Abi3 => "abi3" ,
188+ StableAbiKind :: Abi3t => "abi3.abi3t" ,
177189 }
178190 }
179191}
@@ -341,6 +353,7 @@ impl BridgeModel {
341353 . and_then ( |pyo3| match pyo3. stable_abi {
342354 Some ( stable_abi) => match stable_abi. kind {
343355 StableAbiKind :: Abi3 => Some ( true ) ,
356+ _ => None ,
344357 } ,
345358 None => None ,
346359 } )
0 commit comments