Wheel Platform tag for Windows

I wanted to check the documentation of the wheel platform tags like win_amd64 and win32. I can guess of course, but I was curious about the details and if there’s more.

Am I looking in the wrong place? Thanks.

PEP 425 says "The platform tag is simply distutils.util.get_platform() with all hyphens - and periods . replaced with underscore _". Is that not what you want?

(This might need fixing now that distutils is being removed from the stdlib :wink:)

And what is distutils.util.get_platform()? The documentation is silent:

You can either run it and see the value, or look at the source code, I guess. As you’ve found (sorry, I assumed this was obvious, I should have said) the values are defined by CPython, but aren’t exhaustively listed anywhere.

As you say, the value on Windows is one of win32 and win_amd64. No other values turn up in practice, if any actually do exist (which I’m not 100% sure about). What else were you hoping for?

There are four Windows arch tags: win32 (aka X86), win-amd64 (aka X86_64), win-arm32, and win-arm64.

1 Like

Thanks all. Indeed I was hoping for an exhaustive, authoritative list in the documentation. (Or wondering if I missed it somewhere.) That’s all. I would recommend adding the list (“win32 (aka X86), win-amd64 (aka X86_64), win-arm32, and win-arm64.”) to at least one of the three places linked above. But that’s just my opinion of course. Thanks again.

1 Like

Platform tags are partly a contract to the interpreter, not the platform, so it’s more of describing what the interpreter wants to call the platform it’s running on, therefore there’s not a definitive list. Now for some platforms, wheels are expected to be able to interact with things on the run-time platform that have some sort of external versioning (to the interpreter), so we do have some writeups on selected platform tags describing a naming scheme (e.g. manyllinux and macos_X_Y tags), but that has never been needed due to the strict backwards-compatible nature of Windows platforms. A PEP describing existing practice could be useful, but there is very little incentive to work on that AFAIK, so you probably need to work on it yourself and/or with folks from Microsoft.

Currently, only the 32-bit and 64-bit versions of the Windows platform are supported, so win32 and win-amd64 is the exhaustive (supported) list.

If you do your own build for other platforms, you could get a different tag. This includes the two (current) ARM variants of Windows, as well as occasional (unsupported) variants targeting UWP or WinRT.

I’m hoping to be able to release an ARM64 build eventually, but right now there’s no way for the ecosystem to do their own builds for it, so I’m holding off. But it does already exist (unsupported), so the tags may be valid. I’m not sure the right place is to document all of that context.

This might need fixing now that distutils is being removed from the stdlib

Just to say sysconfig.get_platform(), yeah.

1 Like

sysconfig.get_platform() documentation has the list I was looking for, so that is nice.