Bug 2458671 - poetry fails to build with Python 3.15: test_load_successful_with_invalid_distribution: importlib.metadata.MetadataNotFound: No package metadata was found.
Summary: poetry fails to build with Python 3.15: test_load_successful_with_invalid_dis...
Keywords:
Status: POST
Alias: None
Product: Fedora
Classification: Fedora
Component: poetry
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lumír Balhar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.15
TreeView+ depends on / blocked
 
Reported: 2026-04-15 12:51 UTC by Karolina Surma
Modified: 2026-04-27 09:22 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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