Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows wheels have incorrect platform tags #3179

Open
freakboy3742 opened this issue Feb 10, 2025 · 3 comments
Open

Windows wheels have incorrect platform tags #3179

freakboy3742 opened this issue Feb 10, 2025 · 3 comments
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.

Comments

@freakboy3742
Copy link
Member

Describe the bug

The Toga Winforms wheels are tagged py3-none-any. However, they contain binary components (DLLs for WebView compatibility). They should be tagged as binary wheels.

This means there's nothing preventing the installation of Windows wheels on macOS or Linux, despite the fact that there are binary components that aren't compatible with non-Windows platforms.

Steps to reproduce

  1. Download the toga-winforms wheel
  2. Observe that it contains binary components.

Expected behavior

The wheel should have a platform tag. Technically, I think it should be py3_none_win_amd64, but I'm not sure how well that will work with pip - it may be necessary to use a tag like cp39_abi3_win_amd64 to fake "Python version doesn't matter, but it's Windows".

There should also be separate wheels for _win_amd64, _win32 and _win_arm64.

Screenshots

No response

Environment

  • Operating System: Windows
  • Python version: All

Logs


Additional context

This isn't causing any problems at present, but it does mean that Windows apps are larger than they need to be, and is providing a misleading compatibility tag in published artefacts.

This doesn't affect other platforms, and the wheels are pure Python wheels. They won't actually run on other platforms, but that will be reported as a runtime issue when FFI interfaces fail to find the required system components.

@freakboy3742 freakboy3742 added bug A crash or error in behavior. windows The issue relates to Microsoft Windows support. labels Feb 10, 2025
@freakboy3742
Copy link
Member Author

freakboy3742 commented Feb 10, 2025

As prior art: the PySDL2-DLL package has a similar requirement, and manages the task with a setup.py hack

It also confirms that py3-none-win_amd64 wheels will work.

@freakboy3742
Copy link
Member Author

Another approach: wheel has unpack, pack and tags subcommands that can be used to tweak the content and tagging of a wheel.

@mhsmith
Copy link
Member

mhsmith commented Feb 10, 2025

Technically, I think it should be py3_none_win_amd64, but I'm not sure how well that will work with pip

I think it works fine – this case is explicitly mentioned in the wheel tag spec, and there's a precedent in packages such as cmake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.
Projects
None yet
Development

No branches or pull requests

2 participants