Bug 2458671

Summary: poetry fails to build with Python 3.15: test_load_successful_with_invalid_distribution: importlib.metadata.MetadataNotFound: No package metadata was found.
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: poetryAssignee: Lumír Balhar <lbalhar>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ksurma, lbalhar, mhroncok, python-packagers-sig, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-05-04 06:45:55 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: 2412434    

Description Karolina Surma 2026-04-15 12:51:14 UTC
poetry fails to build with Python 3.15.0a8.

________________ test_load_successful_with_invalid_distribution ________________
[gw1] linux -- Python 3.15.0 /usr/bin/python3

caplog = <_pytest.logging.LogCaptureFixture object at 0x7ff6dd4206e0>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff6bbe5e1a0>
env = _MockEnv("/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/session-working-directory0/installed")
tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_load_successful_with_inva0')
installed_results = [<importlib.metadata.PathDistribution object at 0x7ff6bb9eb700>, <importlib.metadata.PathDistribution object at 0x7ff6...tadata.PathDistribution object at 0x7ff6bb9e9090>, <importlib.metadata.PathDistribution object at 0x7ff6bb9e85f0>, ...]

    def test_load_successful_with_invalid_distribution(
        caplog: LogCaptureFixture,
        mocker: MockerFixture,
        env: MockEnv,
        tmp_path: Path,
        installed_results: list[metadata.PathDistribution],
    ) -> None:
        invalid_dist_info = tmp_path / "site-packages" / "invalid-0.1.0.dist-info"
        invalid_dist_info.mkdir(parents=True)
        mocker.patch(
            "importlib.metadata.Distribution.discover",
            return_value=[*installed_results, metadata.PathDistribution(invalid_dist_info)],
        )
>       repository_with_invalid_distribution = InstalledRepository.load(env)
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/builddir/build/BUILD/poetry-2.3.4-build/poetry-2.3.4/tests/repositories/test_installed_repository.py:198: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/poetry-2.3.4-build/BUILDROOT/usr/lib/python3.15/site-packages/poetry/repositories/installed_repository.py:273: in load
    dist_metadata = distribution.metadata  # type: ignore[attr-defined]
                    ^^^^^^^^^^^^^^^^^^^^^
/usr/lib64/python3.15/importlib/metadata/__init__.py:543: in metadata
    return self._assemble_message(self._ensure_metadata_present(text))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <importlib.metadata.PathDistribution object at 0x7ff6ba277f70>
text = None

    def _ensure_metadata_present(self, text: str | None) -> str:
        if text is not None:
            return text
    
>       raise MetadataNotFound('No package metadata was found.')
E       importlib.metadata.MetadataNotFound: No package metadata was found.

/usr/lib64/python3.15/importlib/metadata/__init__.py:556: MetadataNotFound

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/10327264-poetry/

For all our attempts to build poetry with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/package/poetry/

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.