@@ -216,35 +216,38 @@ lib.fix (self: {
216
216
# Python interpreter derivation
217
217
python :
218
218
let
219
- inherit ( python . passthru ) sourceVersion implementation pythonVersion ;
220
-
221
- # TODO: Implement ABI tags in the nixpkgs Python derivation.
222
- #
223
- # This isn't strictly correct in the face of things like Python free-threading
224
- # which has a `t` suffix but there is no way right now to introspect & check
225
- # if the GIL is enabled or not.
226
- #
227
- # So a free-threaded build will erroneously be returned as compatible with
228
- # regular CPython wheels.
229
219
abiTags =
230
- if implementation == "cpython" then
231
- [
232
- "none"
233
- "any"
234
- "abi3"
235
- "cp${ sourceVersion . major } ${ sourceVersion . minor } "
236
- ]
237
- else if implementation == "pypy" then
238
- [
239
- "none"
240
- "any"
241
- "pypy${ concatStrings ( take 2 ( splitString "." pythonVersion ) ) } _pp${ sourceVersion . major } ${ sourceVersion . minor } "
242
- ]
243
- else
244
- [
245
- "none"
246
- "any"
247
- ] ;
220
+ python . passthru . pythonABITags or (
221
+ # Fall back to computing an ABI tag.
222
+ #
223
+ # This isn't strictly correct in the face of things like Python free-threading
224
+ # which has a `t` suffix but there is no way right now to introspect & check
225
+ # if the GIL is enabled or not.
226
+ #
227
+ # So a free-threaded build will erroneously be returned as compatible with
228
+ # regular CPython wheels.
229
+ let
230
+ inherit ( python . passthru ) sourceVersion implementation pythonVersion ;
231
+ in
232
+ if implementation == "cpython" then
233
+ [
234
+ "none"
235
+ "any"
236
+ "abi3"
237
+ "cp${ sourceVersion . major } ${ sourceVersion . minor } "
238
+ ]
239
+ else if implementation == "pypy" then
240
+ [
241
+ "none"
242
+ "any"
243
+ "pypy${ concatStrings ( take 2 ( splitString "." pythonVersion ) ) } _pp${ sourceVersion . major } ${ sourceVersion . minor } "
244
+ ]
245
+ else
246
+ [
247
+ "none"
248
+ "any"
249
+ ]
250
+ ) ;
248
251
in
249
252
tag : elem tag abiTags ;
250
253
0 commit comments