Bug 2365653

Summary: python-pytest-venv fails to build with Python 3.14: venv.create() ends with a failure; TypeError: HelpFormatter.__init__() got an unexpected keyword argument 'prefix_chars'
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-pytest-venvAssignee: Miro Hrončok <mhroncok>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ksurma, lbalhar, mhroncok
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-05-14 06:23:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2365142    
Bug Blocks: 2322407    

Description Karolina Surma 2025-05-12 15:05:53 UTC
python-pytest-venv fails to build with Python 3.14.0b1.

All tests end with a similar failure:

__________________________ ERROR at setup of test_it ___________________________

tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_it0')

    @pytest.fixture
    def venv(tmpdir):
        venv = VirtualEnvironment(tmpdir.strpath)
>       venv.create()

../BUILDROOT/usr/lib/python3.14/site-packages/pytest_venv/__init__.py:14: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILDROOT/usr/lib/python3.14/site-packages/pytest_venv/__init__.py:35: in create
    subprocess.check_call(cmd)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

popenargs = (['/usr/bin/python3', '-m', 'virtualenv', '-p', '/usr/bin/python3', '/tmp/pytest-of-mockbuild/pytest-0/test_it0'],)
kwargs = {}, retcode = 1
cmd = ['/usr/bin/python3', '-m', 'virtualenv', '-p', '/usr/bin/python3', '/tmp/pytest-of-mockbuild/pytest-0/test_it0']

    def check_call(*popenargs, **kwargs):
        """Run command with arguments.  Wait for command to complete.  If
        the exit code was zero then return, otherwise raise
        CalledProcessError.  The CalledProcessError object will have the
        return code in the returncode attribute.
    
        The arguments are the same as for the call function.  Example:
    
        check_call(["ls", "-l"])
        """
        retcode = call(*popenargs, **kwargs)
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
>           raise CalledProcessError(retcode, cmd)
E           subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'virtualenv', '-p', '/usr/bin/python3', '/tmp/pytest-of-mockbuild/pytest-0/test_it0']' returned non-zero exit status 1.

/usr/lib64/python3.14/subprocess.py:419: CalledProcessError
---------------------------- Captured stderr setup -----------------------------
TypeError: HelpFormatter.__init__() got an unexpected keyword argument 'prefix_chars'


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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14-b1/fedora-rawhide-x86_64/09023986-python-pytest-venv/

For all our attempts to build python-pytest-venv with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14-b1/package/python-pytest-venv/

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.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14-b1/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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 1 Miro Hrončok 2025-05-12 16:35:32 UTC
This is a problem in Python:

https://github.com/python/cpython/issues/133653

Manifesting via virtualenv, fixed/workaround there in https://github.com/pypa/virtualenv/pull/2878 -- part of the recent releases, Fedora update PR in https://src.fedoraproject.org/rpms/python-virtualenv/pull-request/134

Comment 2 Lumír Balhar 2025-05-14 06:23:36 UTC
The last three builds in https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-pytest-venv/ are green. Closing.