packaging icon indicating copy to clipboard operation
packaging copied to clipboard

Add `packaging.tags.interpreter_abi`

Open FFY00 opened this issue 2 years ago • 5 comments

Build backends that build extension modules will want to know the interpreter tag for the current interpreter.

Currently, the easiest way to achieve that is via sys_tags:

next(tags.sys_tags()).abi

packaging could provide a packaging.tags.interpreter_tag function that avoids going through sys_tags.

FFY00 avatar Nov 08 '22 22:11 FFY00

So you just want the running interpreter's most strict ABI tag? Or are you after all supported ABI tags?

brettcannon avatar Nov 09 '22 21:11 brettcannon

Yes. In practice, this is only relevant to CPython right now, where debug builds can load both debug and non-debug modules, but we want the debug tag in that case.

FFY00 avatar Nov 09 '22 21:11 FFY00

Yes.

"Yes", which? Most strict or all tags?

brettcannon avatar Nov 25 '22 23:11 brettcannon

xref https://github.com/python/cpython/issues/103483

In any case, packaging will probably end up implementing the linked issue in order to provide a backport for currently supported python interpreters ?

The question raised by @brettcannon leads me to other questions.

I guess the original intent is for most specific tag in order to ease non-pure wheel building/tagging: ref https://github.com/python/cpython/issues/99560 (cc @mattip)

Does this means that cp3?-abi3- will be left-out or should multiple tags be reported ?

mayeut avatar Aug 20 '23 12:08 mayeut

I would think "most strict" would be sufficient for packaging to determine the logic for the rest of the tags, as is done in PR #611.

mattip avatar Aug 20 '23 12:08 mattip