pypa / pypa/packaging

Order of architectures in platform tags on macOS

Open
#381 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement packaging.tags
Dominant language
Python
Stars
751
Forks
324
Avg merge
12h 58m
Merged PRs (30d)
3

Description

The order of architectures in the result of tags.mac_platform() does not look at the type of python installation and prefers non-universal wheels over universal wheels. I'd prefer behaviour where tags.mac_platform() prefers universal wheels over non-universal wheels.

An example: when running on an intel mac "pip install foo" will prefer a wheel with tag "macosx_10_9_x86_64" over a wheel with tag "macosx_10_9_universal2", I'd prefer to install the universal2 wheel instead.

The primary motivation of this is that installation of "universal2" wheels makes it possible to use tools like py2app and pyinstaller to create application bundles that support both CPU architectures ("Universal 2 binaries" in Apple speak).

A disadvantage is slightly higher disk usage when universal2 wheels are used.

As an aside: In the long run I'd hope that most projects currently providing mac wheels will provide "universal2" wheels, but I expect that there will be "x86_64" wheels as well for the foreseeable future because only fairly recent versions of pip support universal2 wheels.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the tags.mac_platform() entry point and inspect how architecture tags are ordered for Intel macOS installations. Look for existing tests covering x86_64 and universal2 tags, then update or add coverage so the requested preference is explicit. Done means the relevant tests pass and universal2 is ordered ahead of x86_64 in the described case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.