Bug 2365874

Summary: python-pipdeptree fails to build with Python 3.14: TypeError: _Formatter.__init__() got an unexpected keyword argument 'prefix_chars'
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-pipdeptreeAssignee: Lumír Balhar <lbalhar>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ksurma, lbalhar, mhroncok, python-packagers-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python3.14-3.14.0~b2-1.fc43 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-05-28 12:13:11 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:    
Bug Blocks: 2322407    

Description Karolina Surma 2025-05-13 10:26:28 UTC
python-pipdeptree fails to build with Python 3.14.0b1.
This comes from Python and should be fixed in b2: https://github.com/python/cpython/issues/133653

____________________________ test_main_log_resolved ____________________________

tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_main_log_resolved0')
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fde719a87a0>
capsys = <_pytest.capture.CaptureFixture object at 0x7fde719fe820>

    def test_main_log_resolved(tmp_path: Path, mocker: MockFixture, capsys: pytest.CaptureFixture[str]) -> None:
        mocker.patch("sys.argv", ["", "--python", "auto"])
        mocker.patch("pipdeptree.__main__.detect_active_interpreter", return_value=str(tmp_path))
        mock_subprocess_run = mocker.patch("subprocess.run")
        valid_sys_path = str([str(tmp_path)])
        mock_subprocess_run.return_value = CompletedProcess(
            args=["python", "-c", "import sys; print(sys.path)"],
            returncode=0,
            stdout=valid_sys_path,
            stderr="",
        )
    
>       main()

tests/test_pipdeptree.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILDROOT/usr/lib/python3.14/site-packages/pipdeptree/__main__.py:22: in main
    options = get_options(args)
../BUILDROOT/usr/lib/python3.14/site-packages/pipdeptree/_cli.py:164: in get_options
    parser = build_parser()
../BUILDROOT/usr/lib/python3.14/site-packages/pipdeptree/_cli.py:42: in build_parser
    parser = ArgumentParser(description="Dependency tree of the installed python packages", formatter_class=_Formatter)
/usr/lib64/python3.14/argparse.py:1920: in __init__
    self.add_argument(
/usr/lib64/python3.14/argparse.py:1562: in add_argument
    formatter = self._get_formatter()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = ArgumentParser(prog='', usage=None, description='Dependency tree of the installed python packages', formatter_class=<class 'pipdeptree._cli._Formatter'>, conflict_handler='error', add_help=True)

    def _get_formatter(self):
        if isinstance(self.formatter_class, type) and issubclass(
            self.formatter_class, HelpFormatter
        ):
>           return self.formatter_class(
                prog=self.prog,
                prefix_chars=self.prefix_chars,
                color=self.color,
            )
E           TypeError: _Formatter.__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/09027269-python-pipdeptree/

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

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.