Bug 2414803

Summary: python-pipdeptree fails to build with Python 3.15: tests/test_discovery.py::test_invalid_metadata - TypeError: argument of type 'NoneType' is not a container or iterable
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-pipdeptreeAssignee: Lumír Balhar <lbalhar>
Status: NEW --- 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: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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: 2412434    

Description Karolina Surma 2025-11-13 11:09:54 UTC
python-pipdeptree fails to build with Python 3.15.0a1.

____________________________ test_invalid_metadata _____________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe1aabc9160>
capfd = <_pytest.capture.CaptureFixture object at 0x7fe1aad375b0>
fake_dist_with_invalid_metadata = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_invalid_metadata0/site-packages/bar-2.4.5.dist-info')

    def test_invalid_metadata(
        mocker: MockerFixture, capfd: pytest.CaptureFixture[str], fake_dist_with_invalid_metadata: Path
    ) -> None:
        fake_site_dir = str(fake_dist_with_invalid_metadata.parent)
        mocked_sys_path = [fake_site_dir]
        mocker.patch("pipdeptree._discovery.sys.path", mocked_sys_path)
    
>       dists = get_installed_distributions()

tests/test_discovery.py:165: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILDROOT/usr/lib/python3.15/site-packages/pipdeptree/_discovery.py:49: in get_installed_distributions
    return filter_valid_distributions(distributions(path=computed_paths))
../BUILDROOT/usr/lib/python3.15/site-packages/pipdeptree/_discovery.py:89: in filter_valid_distributions
    if not has_valid_metadata(dist):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dist = <importlib.metadata.PathDistribution object at 0x7fe1aaa889b0>

    def has_valid_metadata(dist: Distribution) -> bool:
>       return "Name" in dist.metadata
E       TypeError: argument of type 'NoneType' is not a container or iterable

../BUILDROOT/usr/lib/python3.15/site-packages/pipdeptree/_discovery.py:119: TypeError
=========================== short test summary info ============================
FAILED tests/test_discovery.py::test_invalid_metadata - TypeError: argument of type 'NoneType' is not a container or iterable

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.15/fedora-rawhide-x86_64/09792554-python-pipdeptree/

For all our attempts to build python-pipdeptree with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/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.15:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/

Let us know here if you have any questions.

Python 3.15 is planned to be included in Fedora 45.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.15.
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 Lumír Balhar 2026-01-05 10:51:00 UTC
Reported upstream: https://github.com/tox-dev/pipdeptree/issues/530