Skip to content

Apply packaging.tags patch to pip's vendored version#129

Merged
virtuald merged 3 commits intorobotpy:mainfrom
virtuald:patch-pip-packaging-tags
Sep 13, 2025
Merged

Apply packaging.tags patch to pip's vendored version#129
virtuald merged 3 commits intorobotpy:mainfrom
virtuald:patch-pip-packaging-tags

Conversation

@virtuald
Copy link
Member

Would love a release with this. We use a custom platform tag for our wheels so they only install on our controller, but we also want to be able to leverage normal wheels for our architecture too. This allows that to happen.

@virtuald
Copy link
Member Author

I noticed my initial patch actually breaks existing behavior... but I think it's the correct fix, but probably should be documented?

With this patch, if no platform tags are reported, pip debug reports:

Compatible tags: 45
  cp313-cp313-armv7l
  cp313-abi3-armv7l
  ...

Previously, pip debug would have reported:

Compatible tags: 45
  cp313-cp313-linux_armv7l
  cp313-abi3-linux_armv7l
  ...

I think this is because the unpatched version of packaging.tags (https://github.com/pypa/packaging/blob/0055d4b8ff353455f0617690e609bc68a1f9ade2/src/packaging/tags.py#L578) checks sysconfig.get_platform() and if it contains linux then it yields linux_{arch}.

I think the correct behavior is that if a user specifies --platform-tag, then they must declare all compatible tags. Otherwise, we should default to linux_{arch}.

@virtuald virtuald force-pushed the patch-pip-packaging-tags branch from 2d59977 to ff7724f Compare September 13, 2025 06:01
@virtuald virtuald mentioned this pull request Sep 13, 2025
- This means if you specify one platform tag, you must specify all of
  the tags that you need to support
@virtuald virtuald force-pushed the patch-pip-packaging-tags branch from ff7724f to 5cab2ce Compare September 13, 2025 06:33
@virtuald virtuald force-pushed the patch-pip-packaging-tags branch from 5cab2ce to bad6536 Compare September 13, 2025 06:36
@virtuald virtuald merged commit ee0298e into robotpy:main Sep 13, 2025
7 checks passed
@virtuald virtuald deleted the patch-pip-packaging-tags branch September 13, 2025 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pip ignores --platform-tags

1 participant