Bug 2275071 - python-virtualenv fails to build with Python 3.13: AssertionError: assert False (assert CPython3Windows.has_shim(interpreter=py_info); assert contains_exe(...))
Summary: python-virtualenv fails to build with Python 3.13: AssertionError: assert Fal...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-virtualenv
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karolina Surma
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2024-04-15 08:17 UTC by Karolina Surma
Modified: 2024-04-16 11:59 UTC (History)
6 users (show)

Fixed In Version: 20.21.1-18
Clone Of:
Environment:
Last Closed: 2024-04-16 11:59:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2024-04-15 08:17:01 UTC
python-virtualenv fails to build with Python 3.13.0a6.

=================================== FAILURES ===================================
______________________ test_only_shim[cpython3_win_embed] ______________________

py_info = PythonInfo({'platform': 'win32', 'implementation': 'CPython', 'version_info': VersionInfo(major=3, minor=10, micro=4, ...: 'c:\\path\\to\\python\\Lib', 'system_stdlib_platform': 'c:\\path\\to\\python\\Lib', 'max_size': 9223372036854775807})
mock_files = <function mock_files.<locals>.<lambda> at 0x7fb94bf2a520>

    @pytest.mark.parametrize("py_info_name", ["cpython3_win_embed"])
    def test_only_shim(py_info, mock_files):
        shim = path(py_info.system_stdlib, "venv\\scripts\\nt\\python.exe")
        py_files = (
            path(py_info.prefix, "libcrypto-1_1.dll"),
            path(py_info.prefix, "libffi-7.dll"),
            path(py_info.prefix, "_asyncio.pyd"),
            path(py_info.prefix, "_bz2.pyd"),
        )
        mock_files(CPYTHON3_PATH, [shim, *py_files])
        sources = tuple(CPython3Windows.sources(interpreter=py_info))
>       assert CPython3Windows.has_shim(interpreter=py_info)
E       AssertionError: assert False
E        +  where False = <bound method CPython3Windows.has_shim of <class 'virtualenv.create.via_global_ref.builtin.cpython.cpython3.CPython3Windows'>>(interpreter=PythonInfo({'platform': 'win32', 'implementation': 'CPython', 'version_info': VersionInfo(major=3, minor=10, micro=4, releaselevel='final', serial=0), 'architecture': 64, 'version_nodot': '310', 'version': '3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]', 'os': 'nt', 'prefix': 'c:\\path\\to\\python', 'base_prefix': 'c:\\path\\to\\python', 'real_prefix': None, 'base_exec_prefix': 'c:\\path\\to\\python', 'exec_prefix': 'c:\\path\\to\\python', 'executable': 'c:\\path\\to\\python\\python.exe', 'original_executable': 'c:\\path\\to\\python\\python.exe', 'system_executable': 'c:\\path\\to\\python\\python.exe', 'has_venv': False, 'path': ['c:\\path\\to\\python\\Scripts\\virtualenv.exe', 'c:\\path\\to\\python\\python310.zip', 'c:\\path\\to\\python', 'c:\\path\\to\\python\\Lib\\site-packages'], 'file_system_encoding': 'utf-8', 'stdout_encoding': 'utf-8', 'sysconfig_scheme': None, 'sysconfig_paths': {'stdlib': '{installed_base}/Lib', 'platstdlib': '{base}/Lib', 'purelib': '{base}/Lib/site-packages', 'platlib': '{base}/Lib/site-packages', 'include': '{installed_base}/Include', 'scripts': '{base}/Scripts', 'data': '{base}'}, 'distutils_install': {'purelib': 'Lib\\site-packages', 'platlib': 'Lib\\site-packages', 'headers': 'Include\\UNKNOWN', 'scripts': 'Scripts', 'data': ''}, 'sysconfig': {'makefile_filename': 'c:\\path\\to\\python\\Lib\\config\\Makefile'}, 'sysconfig_vars': {'PYTHONFRAMEWORK': '', 'installed_base': 'c:\\path\\to\\python', 'base': 'c:\\path\\to\\python'}, 'system_stdlib': 'c:\\path\\to\\python\\Lib', 'system_stdlib_platform': 'c:\\path\\to\\python\\Lib', 'max_size': 9223372036854775807}))
E        +    where <bound method CPython3Windows.has_shim of <class 'virtualenv.create.via_global_ref.builtin.cpython.cpython3.CPython3Windows'>> = CPython3Windows.has_shim

______________ test_2_exe_on_default_py_host[cpython3_win_embed] _______________

py_info = PythonInfo({'platform': 'win32', 'implementation': 'CPython', 'version_info': VersionInfo(major=3, minor=10, micro=4, ...: 'c:\\path\\to\\python\\Lib', 'system_stdlib_platform': 'c:\\path\\to\\python\\Lib', 'max_size': 9223372036854775807})
mock_files = <function mock_files.<locals>.<lambda> at 0x7fb94bf48540>

    @pytest.mark.parametrize("py_info_name", ["cpython3_win_embed"])
    def test_2_exe_on_default_py_host(py_info, mock_files):
        mock_files(CPYTHON3_PATH, [py_info.system_executable])
        sources = tuple(CPython3Windows.sources(interpreter=py_info))
        # Default Python exe.
        assert contains_exe(sources, py_info.system_executable)
        # Should always exist.
>       assert contains_exe(sources, path(py_info.prefix, "pythonw.exe"))
E       AssertionError: assert False
E        +  where False = contains_exe((ExePathRefToDest(src=c:\path\to\python\python.exe, alias=[]), ExePathRefToDest(src=c:\path\to\python\python.exe, alias=[]), ExePathRefToDest(src=pythonw.exe, alias=[])), 'c:\\path\\to\\python\\pythonw.exe')
E        +    where 'c:\\path\\to\\python\\pythonw.exe' = path('c:\\path\\to\\python', 'pythonw.exe')
E        +      where 'c:\\path\\to\\python' = PythonInfo({'platform': 'win32', 'implementation': 'CPython', 'version_info': VersionInfo(major=3, minor=10, micro=4, releaselevel='final', serial=0), 'architecture': 64, 'version_nodot': '310', 'version': '3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]', 'os': 'nt', 'prefix': 'c:\\path\\to\\python', 'base_prefix': 'c:\\path\\to\\python', 'real_prefix': None, 'base_exec_prefix': 'c:\\path\\to\\python', 'exec_prefix': 'c:\\path\\to\\python', 'executable': 'c:\\path\\to\\python\\python.exe', 'original_executable': 'c:\\path\\to\\python\\python.exe', 'system_executable': 'c:\\path\\to\\python\\python.exe', 'has_venv': False, 'path': ['c:\\path\\to\\python\\Scripts\\virtualenv.exe', 'c:\\path\\to\\python\\python310.zip', 'c:\\path\\to\\python', 'c:\\path\\to\\python\\Lib\\site-packages'], 'file_system_encoding': 'utf-8', 'stdout_encoding': 'utf-8', 'sysconfig_scheme': None, 'sysconfig_paths': {'stdlib': '{installed_base}/Lib', 'platstdlib': '{base}/Lib', 'purelib': '{base}/Lib/site-packages', 'platlib': '{base}/Lib/site-packages', 'include': '{installed_base}/Include', 'scripts': '{base}/Scripts', 'data': '{base}'}, 'distutils_install': {'purelib': 'Lib\\site-packages', 'platlib': 'Lib\\site-packages', 'headers': 'Include\\UNKNOWN', 'scripts': 'Scripts', 'data': ''}, 'sysconfig': {'makefile_filename': 'c:\\path\\to\\python\\Lib\\config\\Makefile'}, 'sysconfig_vars': {'PYTHONFRAMEWORK': '', 'installed_base': 'c:\\path\\to\\python', 'base': 'c:\\path\\to\\python'}, 'system_stdlib': 'c:\\path\\to\\python\\Lib', 'system_stdlib_platform': 'c:\\path\\to\\python\\Lib', 'max_size': 9223372036854775807}).prefix

____________ test_3_exe_on_not_default_py_host[cpython3_win_embed] _____________

py_info = PythonInfo({'platform': 'win32', 'implementation': 'CPython', 'version_info': VersionInfo(major=3, minor=10, micro=4, ...: 'c:\\path\\to\\python\\Lib', 'system_stdlib_platform': 'c:\\path\\to\\python\\Lib', 'max_size': 9223372036854775807})
mock_files = <function mock_files.<locals>.<lambda> at 0x7fb94bf49760>

    @pytest.mark.parametrize("py_info_name", ["cpython3_win_embed"])
    def test_3_exe_on_not_default_py_host(py_info, mock_files):
        # Not default python host.
        py_info.system_executable = path(py_info.prefix, "python666.exe")
        mock_files(CPYTHON3_PATH, [py_info.system_executable])
        sources = tuple(CPython3Windows.sources(interpreter=py_info))
        # Not default Python exe linked to both the default name and origin.
        assert contains_exe(sources, py_info.system_executable, "python.exe")
>       assert contains_exe(sources, py_info.system_executable, "python666.exe")
E       AssertionError: assert False
E        +  where False = contains_exe((ExePathRefToDest(src=c:\path\to\python\python666.exe, alias=[]), ExePathRefToDest(src=c:\path\to\python\python666.exe, alias=[]), ExePathRefToDest(src=pythonw.exe, alias=[])), 'c:\\path\\to\\python\\python666.exe', 'python666.exe')
E        +    where 'c:\\path\\to\\python\\python666.exe' = PythonInfo({'platform': 'win32', 'implementation': 'CPython', 'version_info': VersionInfo(major=3, minor=10, micro=4, releaselevel='final', serial=0), 'architecture': 64, 'version_nodot': '310', 'version': '3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]', 'os': 'nt', 'prefix': 'c:\\path\\to\\python', 'base_prefix': 'c:\\path\\to\\python', 'real_prefix': None, 'base_exec_prefix': 'c:\\path\\to\\python', 'exec_prefix': 'c:\\path\\to\\python', 'executable': 'c:\\path\\to\\python\\python.exe', 'original_executable': 'c:\\path\\to\\python\\python.exe', 'system_executable': 'c:\\path\\to\\python\\python666.exe', 'has_venv': False, 'path': ['c:\\path\\to\\python\\Scripts\\virtualenv.exe', 'c:\\path\\to\\python\\python310.zip', 'c:\\path\\to\\python', 'c:\\path\\to\\python\\Lib\\site-packages'], 'file_system_encoding': 'utf-8', 'stdout_encoding': 'utf-8', 'sysconfig_scheme': None, 'sysconfig_paths': {'stdlib': '{installed_base}/Lib', 'platstdlib': '{base}/Lib', 'purelib': '{base}/Lib/site-packages', 'platlib': '{base}/Lib/site-packages', 'include': '{installed_base}/Include', 'scripts': '{base}/Scripts', 'data': '{base}'}, 'distutils_install': {'purelib': 'Lib\\site-packages', 'platlib': 'Lib\\site-packages', 'headers': 'Include\\UNKNOWN', 'scripts': 'Scripts', 'data': ''}, 'sysconfig': {'makefile_filename': 'c:\\path\\to\\python\\Lib\\config\\Makefile'}, 'sysconfig_vars': {'PYTHONFRAMEWORK': '', 'installed_base': 'c:\\path\\to\\python', 'base': 'c:\\path\\to\\python'}, 'system_stdlib': 'c:\\path\\to\\python\\Lib', 'system_stdlib_platform': 'c:\\path\\to\\python\\Lib', 'max_size': 9223372036854775807}).system_executable

=========================== short test summary info ============================
FAILED tests/unit/create/via_global_ref/builtin/cpython/test_cpython3_win.py::test_only_shim[cpython3_win_embed]
FAILED tests/unit/create/via_global_ref/builtin/cpython/test_cpython3_win.py::test_2_exe_on_default_py_host[cpython3_win_embed]
FAILED tests/unit/create/via_global_ref/builtin/cpython/test_cpython3_win.py::test_3_exe_on_not_default_py_host[cpython3_win_embed]
==== 3 failed, 236 passed, 34 skipped, 62 deselected, 9 warnings in 19.51s =====

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/07302982-python-virtualenv/

For all our attempts to build python-virtualenv with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-virtualenv/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 2 Karolina Surma 2024-04-16 06:54:29 UTC
It looks like https://github.com/pypa/virtualenv/issues/2671
and it also looks pathmod is no longer: all hail to parser? https://github.com/python/cpython/commit/752e18389ed03087b51b38eac9769ef8dfd167b7

Comment 3 Karolina Surma 2024-04-16 07:10:11 UTC
yeap, did s/pathmod/parser on our Fedora py3.13.patch and all green here: https://copr.fedorainfracloud.org/coprs/g/python/python3.13/build/7316257/
will update the upstream


Note You need to log in before you can comment on or make changes to this bug.