<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Python%2FWheel</id>
	<title>Python/Wheel - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Python%2FWheel"/>
	<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Python/Wheel&amp;action=history"/>
	<updated>2026-05-07T04:21:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://aznot.com/index.php?title=Python/Wheel&amp;diff=6287&amp;oldid=prev</id>
		<title>Kenneth: /* Check WHL Details */</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Python/Wheel&amp;diff=6287&amp;oldid=prev"/>
		<updated>2023-06-14T21:19:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Check WHL Details&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Naming Convention ==&lt;br /&gt;
&lt;br /&gt;
The naming format can be found under filename convention in PEP 427:&lt;br /&gt;
 {distribution}-{version}(-{build tag})?-{python tag}-{abi tag}-{platform tag}.whl&lt;br /&gt;
&lt;br /&gt;
ref: [https://stackoverflow.com/questions/41645540/how-to-interpret-naming-convention-in-pypi-package-name]&lt;br /&gt;
&lt;br /&gt;
== List all of the tags ==&lt;br /&gt;
&lt;br /&gt;
 pythonX.Y -m pip debug --verbose&lt;br /&gt;
&lt;br /&gt;
 import wheel.pep425tags&lt;br /&gt;
 print(wheel.pep425tags.get_supported())&lt;br /&gt;
&lt;br /&gt;
ref: [https://stackoverflow.com/questions/50248524/module-pip-has-no-attribute-pep425tags]&lt;br /&gt;
&lt;br /&gt;
== Check WHL Details ==&lt;br /&gt;
&lt;br /&gt;
Kenneth v1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
import argparse&lt;br /&gt;
from pathlib import Path&lt;br /&gt;
import sys&lt;br /&gt;
from packaging.utils import parse_wheel_filename&lt;br /&gt;
import platform&lt;br /&gt;
&lt;br /&gt;
        print(&amp;quot;System Debug: False&amp;quot;)&lt;br /&gt;
    if tag.abi.endswith(&amp;quot;d&amp;quot;):&lt;br /&gt;
        print(&amp;quot;Wheel Debug: True&amp;quot;)&lt;br /&gt;
        if not sys.flags.debug:&lt;br /&gt;
            failure.append(f&amp;quot;The ABI of the wheel is {tag.abi}, which is a debug wheel. However, the python interpeter does not have the debug flags set.&amp;quot;)&lt;br /&gt;
_minor = int(tag.interpreter[idx + 1])&lt;br /&gt;
        print(f&amp;quot;Wheel Python: 3.{supported_minor}&amp;quot;)&lt;br /&gt;
        if sys.version_info.minor != supported_minor:&lt;br /&gt;
            failure.append(f&amp;quot;The python minor version is {sys.version_info.minor}, but the wheel only supports minor version {supported_minor}&amp;quot;)&lt;br /&gt;
s[1] # armv7l&lt;br /&gt;
        if len(pieces) == 3:&lt;br /&gt;
            cpu_architecture += &amp;quot;_&amp;quot; + pieces[2]  # x86_64&lt;br /&gt;
&lt;br /&gt;
    # Check for MacOSX&lt;br /&gt;
    print(f&amp;quot;System Platform: {sys.platform}&amp;quot;)&lt;br /&gt;
c_ver()[0].split(&amp;quot;.&amp;quot;)&lt;br /&gt;
        if int(os_major) &amp;lt; int(wheel_os_version_major):&lt;br /&gt;
            failure.append(f&amp;quot;The operating system major version is {os_major}, but the wheel requires at least OS major version {wheel_os_version_major}&amp;quot;)&lt;br /&gt;
ported(args.wheelfile)&lt;br /&gt;
    if len(failures) &amp;gt; 0:&lt;br /&gt;
        print(f&amp;quot;ERROR: {args.wheelfile} is not supported on this platform.&amp;quot;)&lt;br /&gt;
        for fail in failures:&lt;br /&gt;
            print(f&amp;quot;REASON: {fail}&amp;quot;)&lt;br /&gt;
s a debug wheel being loaded in a non-debug interpreter?&lt;br /&gt;
    if sys.flags.debug:&lt;br /&gt;
        print(&amp;quot;System Debug: True&amp;quot;)&lt;br /&gt;
    else:&lt;br /&gt;
            print(&amp;#039;fail&amp;#039;)&lt;br /&gt;
        else:&lt;br /&gt;
            print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
    print()&lt;br /&gt;
&lt;br /&gt;
    # There should be no restriction on the platform:&lt;br /&gt;
    print(f&amp;quot;Tag Platform: {tag.platform}&amp;quot;)&lt;br /&gt;
is {sys.platform}&amp;quot;)&lt;br /&gt;
            print(&amp;#039;fail&amp;#039;)&lt;br /&gt;
        else:&lt;br /&gt;
            print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
 is {os_minor}, but the wheel requires at least OS major version {wheel_os_version_minor}&amp;quot;)&lt;br /&gt;
                print(&amp;#039;fail&amp;#039;)&lt;br /&gt;
        else:&lt;br /&gt;
            print(f&amp;quot;Wheel OS Minor: {wheel_os_version_minor}&amp;quot;)&lt;br /&gt;
            print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
 parse:&lt;br /&gt;
    _, _, _, tags = parse_wheel_filename(p.name)&lt;br /&gt;
&lt;br /&gt;
    print(f&amp;quot;Wheel: {args.wheelfile}&amp;quot;)&lt;br /&gt;
    tag = None&lt;br /&gt;
    for t in tags:&lt;br /&gt;
should it be using?&lt;br /&gt;
    print(f&amp;quot;System Python: 3.{sys.version_info.minor}&amp;quot;)&lt;br /&gt;
    idx = tag.interpreter.find(&amp;quot;3&amp;quot;)&lt;br /&gt;
    if idx &amp;gt;= 0 and idx &amp;lt; len(tag.interpreter) - 1:&lt;br /&gt;
          failure.append(f&amp;quot;The wheel was build for macosx, but the current platform     print()&lt;br /&gt;
&lt;br /&gt;
    print(f&amp;quot;System Architecture: {platform.machine()}&amp;quot;)&lt;br /&gt;
    print(f&amp;quot;Wheel Architecture: {cpu_architecture}&amp;quot;)&lt;br /&gt;
e.ArgumentParser(&lt;br /&gt;
        description=&amp;quot;Diagnoses why a wheel is unsupported on a particular platform.&amp;quot;&lt;br /&gt;
    )&lt;br /&gt;
    parser.add_argument(&amp;quot;wheelfile&amp;quot;, type=Path, help=&amp;quot;The name of the wheel file.&amp;quot;)&lt;br /&gt;
    args = parser.parse_args()&lt;br /&gt;
l being loaded by a non-cpython interpreter?&lt;br /&gt;
    print(&amp;quot;System CPythonn: &amp;quot; + sys.implementation.name) # cpython&lt;br /&gt;
    if tag.abi.startswith(&amp;quot;cp&amp;quot;):&lt;br /&gt;
        print(&amp;quot;Wheel Cpyhon: cpython&amp;quot;)&lt;br /&gt;
wheel_os_name = pieces[0]  # linux&lt;br /&gt;
        #wheel_os_version_major = pieces[1]&lt;br /&gt;
        wheel_os_version_major = None&lt;br /&gt;
        #wheel_os_version_minor = pieces[2]&lt;br /&gt;
 &amp;lt; int(wheel_os_version_minor):&lt;br /&gt;
                failure.append(f&amp;quot;The operating system minor version        print()&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;Wheel Debug: False&amp;quot;)&lt;br /&gt;
        print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
    print()&lt;br /&gt;
&lt;br /&gt;
    # Is a cpython whee        if sys.implementation.name != &amp;quot;cpython&amp;quot;:&lt;br /&gt;
            failure.append(f&amp;quot;The ABI of the wheel &amp;#039;{p}&amp;#039; requires cpython, but the system implementation is {sys.implementation.name}&amp;quot;)&lt;br /&gt;
macosx&amp;quot;:&lt;br /&gt;
        if sys.platform != &amp;quot;darwin&amp;quot;:&lt;br /&gt;
      if cpu_architecture != platform.machine():&lt;br /&gt;
        failure.append(f&amp;quot;The CPU architecture supported by the wheel is {cpu_architecture}, but the platform has architecture {platform.machine()}&amp;quot;)&lt;br /&gt;
f&amp;quot;File &amp;#039;{p}&amp;#039; does not exist&amp;quot;&lt;br /&gt;
    if not p.is_file():&lt;br /&gt;
        return f&amp;quot;&amp;#039;{p}&amp;#039; is not a file&amp;quot;&lt;br /&gt;
    if p.suffix != &amp;quot;.whl&amp;quot;:&lt;br /&gt;
        return f&amp;quot;&amp;#039;{p}&amp;#039; has incorrect suffix; the suffix must be .whl&amp;quot;&lt;br /&gt;
ces[3] # ?armv7l?&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;quot;Warning: Platform tag not as expected, attempting best effort.&amp;quot;)&lt;br /&gt;
        print()&lt;br /&gt;
f sys.version_info.major != 3:&lt;br /&gt;
    print(&amp;quot;Error: Expecting Python3&amp;quot;)&lt;br /&gt;
    sys.exit(1)&lt;br /&gt;
&lt;br /&gt;
def diagnose_unsupported(p: Path) -&amp;gt; str:&lt;br /&gt;
s_version_minor = pieces[2]&lt;br /&gt;
        cpu_architecture = pie                wheel_os_version_minor = None&lt;br /&gt;
        #cpu_architecture = pieces[3]&lt;br /&gt;
        cpu_architecture = piece    print(f&amp;quot;Wheel Platform: {wheel_os_name}&amp;quot;)&lt;br /&gt;
    print(&amp;quot;Wheel Interpreter: &amp;quot; + tag.interpreter) # cp39&lt;br /&gt;
    print(&amp;quot;Wheel Platform: &amp;quot; + tag.platform) # any | linux_armv7l | linux_x86_64 | win_amd64&lt;br /&gt;
    print()&lt;br /&gt;
     else:&lt;br /&gt;
            print(f&amp;quot;Wheel OS Major: {wheel_os_version_major}&amp;quot;)&lt;br /&gt;
            print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
        if int(os_major) == int(wheel_os_version_major):&lt;br /&gt;
            if int(os_minor)    print()&lt;br /&gt;
    wheel_os_version_major = pieces[1]&lt;br /&gt;
        wheel_o    if wheel_os_name == &amp;quot;        print(&amp;#039;fail&amp;#039;)&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
        else:&lt;br /&gt;
            print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
    if tag.platform == &amp;quot;any&amp;quot;:&lt;br /&gt;
        print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
        # return &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    pieces = tag.platform.split(&amp;quot;_&amp;quot;)&lt;br /&gt;
rint()&lt;br /&gt;
&lt;br /&gt;
    # If the interpreter is version intolerant, what interpreter         supported            print(&amp;#039;fail&amp;#039;)    print(f&amp;quot;Tag Pieces: {pieces}&amp;quot;)&lt;br /&gt;
    if len(pieces) == 4:&lt;br /&gt;
        wheel_os_name = pieces[0]  # linux&lt;br /&gt;
        print()&lt;br /&gt;
&lt;br /&gt;
    print(f&amp;quot;System OS: {platform.mac_ver()}&amp;quot;)&lt;br /&gt;
    print(f&amp;quot;Wheel OS: {wheel_os_version_major} {wheel_os_version_minor}&amp;quot;)&lt;br /&gt;
    if wheel_os_version_major:&lt;br /&gt;
        os_major, os_minor, os_patch = platform.ma            print(&amp;#039;fail&amp;#039;)&lt;br /&gt;
       return failure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    parser = argpars    failures = diagnose_unsup        sys.exit(1)&lt;br /&gt;
    else:&lt;br /&gt;
        print(f&amp;quot;{args.wheelfile} should be supported on your platform!&amp;quot;)&lt;br /&gt;
        print(&amp;quot;ok&amp;quot;)&lt;br /&gt;
i    p = Path(p)&lt;br /&gt;
    if not p.exists():&lt;br /&gt;
        return &lt;br /&gt;
    failure = []&lt;br /&gt;
&lt;br /&gt;
    # The wheel filename must        tag = t&lt;br /&gt;
    print(&amp;quot;Wheel ABI: &amp;quot; + tag.abi) # cp39&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # I    else:&lt;br /&gt;
        print            print(&amp;#039;fail&amp;#039;)&lt;br /&gt;
        else:&lt;br /&gt;
            print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;quot;Wheel Cpyhon: False&amp;quot;)&lt;br /&gt;
        print(&amp;#039;ok&amp;#039;)&lt;br /&gt;
    p&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Original:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
import argparse&lt;br /&gt;
from pathlib import Path&lt;br /&gt;
import sys&lt;br /&gt;
from packaging.utils import parse_wheel_filename&lt;br /&gt;
import platform&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def diagnose_unsupported(p: Path) -&amp;gt; str:&lt;br /&gt;
    p = Path(p)&lt;br /&gt;
    if not p.exists():&lt;br /&gt;
        return f&amp;quot;File &amp;#039;{p}&amp;#039; does not exist&amp;quot;&lt;br /&gt;
    if not p.is_file():&lt;br /&gt;
        return f&amp;quot;&amp;#039;{p}&amp;#039; is not a file&amp;quot;&lt;br /&gt;
    if p.suffix != &amp;quot;.whl&amp;quot;:&lt;br /&gt;
        return f&amp;quot;&amp;#039;{p}&amp;#039; has incorrect suffix; the suffix must be .whl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # The wheel filename must parse:&lt;br /&gt;
    _, _, _, tags = parse_wheel_filename(p.name)&lt;br /&gt;
&lt;br /&gt;
    tag = None&lt;br /&gt;
    for t in tags:&lt;br /&gt;
        tag = t&lt;br /&gt;
&lt;br /&gt;
    # Is a debug wheel being loaded in a non-debug interpreter?&lt;br /&gt;
    if tag.abi.endswith(&amp;quot;d&amp;quot;):&lt;br /&gt;
        if not sys.flags.debug:&lt;br /&gt;
            return f&amp;quot;The ABI of the wheel is {tag.abi}, which is a debug wheel. However, the python interpeter does not have the debug flags set.&amp;quot;&lt;br /&gt;
    # Is a cpython wheel being loaded by a non-cpython interpreter?&lt;br /&gt;
    if tag.abi.startswith(&amp;quot;cp&amp;quot;):&lt;br /&gt;
        if sys.implementation.name != &amp;quot;cpython&amp;quot;:&lt;br /&gt;
            return f&amp;quot;The ABI of the wheel &amp;#039;{p}&amp;#039; requires cpython, but the system implementation is {sys.implementation.name}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # If the interpreter is version intolerant, what interpreter should it be using?&lt;br /&gt;
    idx = tag.interpreter.find(&amp;quot;3&amp;quot;)&lt;br /&gt;
    if idx &amp;gt;= 0 and idx &amp;lt; len(tag.interpreter) - 1:&lt;br /&gt;
        supported_minor = int(tag.interpreter[idx + 1])&lt;br /&gt;
        if sys.version_info.minor != supported_minor:&lt;br /&gt;
            return f&amp;quot;The python minor version is {sys.version_info.minor}, but the wheel only supports minor version {supported_minor}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # There should be no restriction on the platform:&lt;br /&gt;
    if tag.platform == &amp;quot;any&amp;quot;:&lt;br /&gt;
        return &amp;quot;&amp;quot;&lt;br /&gt;
    pieces = tag.platform.split(&amp;quot;_&amp;quot;)&lt;br /&gt;
    if len(pieces) != 4:&lt;br /&gt;
        print(&amp;quot;Unable to parse the platform tag&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    wheel_os_name = pieces[0]&lt;br /&gt;
    wheel_os_version_major = pieces[1]&lt;br /&gt;
    wheel_os_version_minor = pieces[2]&lt;br /&gt;
    cpu_architecture = pieces[3]&lt;br /&gt;
    if wheel_os_name == &amp;quot;macosx&amp;quot;:&lt;br /&gt;
        if sys.platform != &amp;quot;darwin&amp;quot;:&lt;br /&gt;
            return f&amp;quot;The wheel was build for macosx, but the current platform is {sys.platform}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    if cpu_architecture != platform.machine():&lt;br /&gt;
        return f&amp;quot;The CPU architecture supported by the wheel is {cpu_architecture}, but the platform has architecture {platform.machine()}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    os_major, os_minor, os_patch = platform.mac_ver()[0].split(&amp;quot;.&amp;quot;)&lt;br /&gt;
    if int(os_major) &amp;lt; int(wheel_os_version_major):&lt;br /&gt;
        return f&amp;quot;The operating system major version is {os_major}, but the wheel requires at least OS major version {wheel_os_version_major}&amp;quot;&lt;br /&gt;
    if int(os_major) == int(wheel_os_version_major):&lt;br /&gt;
        if int(os_minor) &amp;lt; int(wheel_os_version_minor):&lt;br /&gt;
            return f&amp;quot;The operating system minor version is {os_minor}, but the wheel requires at least OS major version {wheel_os_version_minor}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    parser = argparse.ArgumentParser(&lt;br /&gt;
        description=&amp;quot;Diagnoses why a wheel is unsupported on a particular platform.&amp;quot;&lt;br /&gt;
    )&lt;br /&gt;
    parser.add_argument(&amp;quot;wheelfile&amp;quot;, type=Path, help=&amp;quot;The name of the wheel file.&amp;quot;)&lt;br /&gt;
    args = parser.parse_args()&lt;br /&gt;
    error_msg = diagnose_unsupported(args.wheelfile)&lt;br /&gt;
    if len(error_msg) &amp;gt; 0:&lt;br /&gt;
        print(&lt;br /&gt;
            f&amp;quot;ERROR: {args.wheelfile} is not supported on this platform. Reason: {error_msg}&amp;quot;&lt;br /&gt;
        )&lt;br /&gt;
    else:&lt;br /&gt;
        print(f&amp;quot;{args.wheelfile} should be supported on your platform!&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ref: More information about *why* a wheel is not supported on a given platform · Issue #10793 · pypa/pip - https://github.com/pypa/pip/issues/10793&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
</feed>