Skip to content

bpo-38021: Modify AIX platform_tag so it provides PEP425 needs#17303

Merged
ncoghlan merged 14 commits into
python:masterfrom
aixtools:bpo-38021-aix-platform-tag
Dec 15, 2019
Merged

bpo-38021: Modify AIX platform_tag so it provides PEP425 needs#17303
ncoghlan merged 14 commits into
python:masterfrom
aixtools:bpo-38021-aix-platform-tag

Conversation

@aixtools

@aixtools aixtools commented Nov 21, 2019

Copy link
Copy Markdown
Contributor

PEP425 defines the platform_tag as whatever sysconfig.get_platform() (and distutils.util.get_platform() returns). HOWEVER, for a platform_tag to be useable it needs to satisfy a number of conditions.

The main condition is to provide sufficient detail so that binary distributions (e.g., eggs and wheels)
can be applied, accepted or rejected by distribution tools (e.g, pip and wheel).

This PR specifies the AIX platform tag be specified (effectively) as:
"AIX-{:04d}-{:04d}-{:2d}".format(vrtl,builddate,bitsize)

e.g., AIX 5.3 TL7 SP0 would be identified as: "AIX-5307-0747-32" and "AIX-5307-0747-64" for 32bit and 64bit builds, respectively.

Most of the information needed to provide a "pep425 build tag" is already available:
sysconfig.get_config_var("GNU_BUILD_TYPE") and sys.maxsize.

Comparable to how macos can determine it build-system characteristics one additional variable is needed: sysconfig.get_config_var("AIX_BUILDDATE").

As AIX guarantees application binary compatibility from old to new the run-time value of the get_platform() can be compared with the aix_buildtag() to determine whether a bdist is acceptable for installation, or not.

https://bugs.python.org/issue38021

@ned-deily

Copy link
Copy Markdown
Member

Adding @brettcannon and @ncoghlan to review in particular regarding input from PyPA (see bpo issue comments)

@brettcannon
brettcannon removed their request for review November 21, 2019 18:13
@brettcannon

Copy link
Copy Markdown
Member

I'm not the right person for distutils stuff.

@ned-deily

Copy link
Copy Markdown
Member

Additional comment here: https://bugs.python.org/issue38021#msg357236

Change field seperator in tag from to ``'-'`` to be similiar with other tags
Comment thread Lib/_aix_support.py Outdated
Comment thread Lib/_aix_support.py Outdated
Comment thread Lib/_aix_support.py Outdated
Comment thread Lib/_aix_support.py Outdated
Comment thread Lib/sysconfig.py Outdated
@aixtools aixtools changed the title bpo-38021: Provide a platform tag for AIX that satisfies PEP425 demands bpo-38021: Modify AIX platform_tag so it provides PEP425 needs Nov 28, 2019
@aixtools

aixtools commented Dec 1, 2019

Copy link
Copy Markdown
Contributor Author

Hoping for a final review. :)

Entering the year-end dash at work, so I may be slow to reply.

@ncoghlan

ncoghlan commented Dec 8, 2019

Copy link
Copy Markdown
Contributor

@aixtools Given that, I'm going to go ahead and make the documentation changes necessary to mark this as a 3.9+ only feature.

@ncoghlan ncoghlan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm in the process of making some direct edits for documentation wording and markup changes, but there's a more substantial change needed before we accept the PR: to minimise compatibility risks, the platform prefix should remain in lowercase, and any code that cares about the rest of the formatting will need to switch based on the number of hyphens found.

@bedevere-bot

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@aixtools

aixtools commented Dec 8, 2019

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again - both in code and docs. AIX tag is lowercase.

Shall adjust my PR in pypa to switch based on the number of hyphens found.

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@ncoghlan: please review the changes made to this pull request.

@bedevere-bot
bedevere-bot requested a review from ncoghlan December 8, 2019 20:42
@ncoghlan

Copy link
Copy Markdown
Contributor

@aixtools When I sent my last review, it was missing some cosmetic comments related to the error handling logic in the _aix_support module. Since I missed sending those last time, I went ahead and made them directly, rather than taking you through yet another review-edit-review cycle.

@ncoghlan
ncoghlan merged commit 39afa2d into python:master Dec 15, 2019
@aixtools

Copy link
Copy Markdown
Contributor Author

@aixtools When I sent my last review, it was missing some cosmetic comments related to the error handling logic in the _aix_support module. Since I missed sending those last time, I went ahead and made them directly, rather than taking you through yet another review-edit-review cycle.

Thanks!

shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
…GH-17303)

Provides a richer platform tag for AIX that we expect to be sufficient for PEP 425
binary distribution identification. Any backports to earlier Python versions will be
handled via setuptools.

Patch by Michael Felt.
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.

7 participants