Skip to content

util.get_host_platform: use sysconfig.get_platform (v2)#104

Merged
jaraco merged 2 commits intopypa:mainfrom
lazka:get-platform-match-sysconfig
Jan 22, 2022
Merged

util.get_host_platform: use sysconfig.get_platform (v2)#104
jaraco merged 2 commits intopypa:mainfrom
lazka:get-platform-match-sysconfig

Conversation

@lazka
Copy link
Copy Markdown
Contributor

@lazka lazka commented Jan 3, 2022

This continues #102 but tries to address the concerns raised in #102 (comment), see the second commit for any differences.

(I didn't add a test for aix since mocking seemed overly complex :/)

naveen521kk and others added 2 commits December 31, 2021 13:35
sysconfig module has a copy of this function in
`sysconfig.get_platform` and would be better to
use that directly. This should help distributors
to patch that function in a single place,
ie sysconfig.

Co-authored-by:  Christoph Reiter <reiter.christoph@gmail.com>
Signed-off-by: Naveen M K <naveen521kk@gmail.com>
While get_host_platform() in distutils and sysconfig.get_platform() are more
or less the same for the same Python version, this extracted distutils
containing the Python 3.9 logic was exposed via setuptools to users using
older Python versions.

To avoid any breakage make sure to restore the 3.9 behaviour for 3.7/3.8.
For any newer version get_host_platform() just delegates to sysconfig
as before.

Also partly revert the docstring to be more generic and no longer mention
sysconfig.get_platform(), so no one depends on them matching.
@lazka
Copy link
Copy Markdown
Contributor Author

lazka commented Jan 3, 2022

(btw, I'd totally understand if you delay any mingw targeted patches until the setuptools transition pains are dealt with)

Copy link
Copy Markdown
Member

@jaraco jaraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for looking into this and helping with the consolidation.

@jaraco jaraco merged commit bb018f1 into pypa:main Jan 22, 2022
This was referenced Jan 31, 2022
This was referenced Feb 7, 2022
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.

3 participants