Skip to content

test_py_info_satisfies_with_machine fails on OpenIndiana #75

@mtelka

Description

@mtelka

I do see the following failure while running tests on OpenIndiana:

_____________________ test_py_info_satisfies_with_machine ______________________

    def test_py_info_satisfies_with_machine() -> None:
        threaded = "t" if CURRENT.free_threaded else ""
        spec_str = (
            f"{CURRENT.implementation}{CURRENT.version_info.major}{threaded}-{CURRENT.architecture}-{CURRENT.machine}"
        )
        parsed_spec = PythonSpec.from_string_spec(spec_str)
>       assert CURRENT.satisfies(parsed_spec, impl_must_match=True) is True
E       AssertionError: assert False is True
E        +  where False = satisfies(PythonSpec(path=CPython3-64-i86pc.64bit), impl_must_match=True)
E        +    where satisfies = PythonInfo({'platform': 'sunos5', 'implementation': 'CPython', 'version_info': VersionInfo(major=3, minor=14, micro=4, releaselevel='final', serial=0), 'architecture': 64, 'sysconfig_platform': 'solaris-2.11-i86pc.64bit', 'version_nodot': '314', 'version': '3.14.4 (main, Apr  9 2026, 16:05:17) [GCC 14.3.0]', 'os': 'posix', 'free_threaded': False, 'prefix': '/usr', 'base_prefix': '/usr', 'real_prefix': None, 'base_exec_prefix': '/usr', 'exec_prefix': '/usr', 'executable': '/data/builds/ul-workspace/components/python/python-discovery/build/amd64-3.14/.tox/py314/bin/python', 'original_executable': '/data/builds/ul-workspace/components/python/python-discovery/build/amd64-3.14/.tox/py314/bin/python', 'system_executable': '/data/builds/ul-workspace/components/python/python-discovery/build/amd64-3.14/.tox/py314/bin/python', 'has_venv': True, 'path': ['/data/builds/ul-workspace/components/python/python-discovery/build/amd64-3.14/tests/windows', '/data/builds/ul-workspace/components/python/python-discovery/build/amd64-3.14/tests', '/data/builds/ul-workspace/components/python/python-discovery/build/amd64-3.14/tests/py_info', '/data/builds/ul-workspace/components/python/python-discovery/build/amd64-3.14/tests', '/data/builds/ul-workspace/components/python/python-discovery/build/prototype/i386/usr/lib/python3.14/vendor-packages', '/usr/lib/python314.zip', '/usr/lib/python3.14', '/usr/lib/python3.14/lib-dynload', '/usr/lib/python3.14/site-packages', '/usr/lib/python3.14/vendor-packages', '/usr/lib/python3.14/vendor-packages/setuptools/_vendor'], 'file_system_encoding': 'utf-8', 'stdout_encoding': 'utf-8', 'sysconfig_scheme': 'venv', 'sysconfig_paths': {'stdlib': '{installed_base}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}', 'platstdlib': '{platbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}', 'purelib': '{base}/lib/{implementation_lower}{py_version_short}{abi_thread}/site-packages', 'platlib': '{platbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}/site-packages', 'include': '{installed_base}/include/{implementation_lower}{py_version_short}{abiflags}', 'scripts': '{base}/bin', 'data': '{base}'}, 'distutils_install': {}, 'sysconfig': {'makefile_filename': '/usr/lib/python3.14/config-3.14/Makefile'}, 'sysconfig_vars': {'py_version_short': '3.14', 'implementation_lower': 'python', 'PYTHONFRAMEWORK': '', 'Py_ENABLE_SHARED': 1, 'LIBDIR': '/usr/lib/amd64', 'installed_base': '/usr', 'abi_thread': '', 'platbase': '/usr', 'INSTSONAME': 'libpython3.14.so.1.0', 'base': '/usr', 'platlibdir': 'lib', 'abiflags': ''}, 'tcl_lib': None, 'tk_lib': None, 'system_stdlib': '/usr/lib/python3.14', 'system_stdlib_platform': '/usr/lib/python3.14', 'max_size': 9223372036854775807}).satisfies

tests/py_info/test_py_info.py:389: AssertionError

The following change solves the issue for me:

--- python_discovery-1.3.1/src/python_discovery/_py_spec.py.orig
+++ python_discovery-1.3.1/src/python_discovery/_py_spec.py
@@ -17,7 +17,7 @@
     (?P<version>[0-9.]+)?           # version (e.g. 3.12, 3.12.1)
     (?P<threaded>t)?                # free-threaded flag
     (?:-(?P<arch>32|64))?           # architecture bitness
-    (?:-(?P<machine>[a-zA-Z0-9_]+))?  # ISA (e.g. arm64, x86_64)
+    (?:-(?P<machine>[a-zA-Z0-9_.]+))?  # ISA (e.g. arm64, x86_64)
     $
     """,
     re.VERBOSE,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions