Bug 2458631 - python-pip fails to build with Python 3.15: importlib.metadata.MetadataNotFound: No package metadata was found.
Summary: python-pip fails to build with Python 3.15: importlib.metadata.MetadataNotFou...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pip
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Python Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 2463129
Blocks: PYTHON3.15
TreeView+ depends on / blocked
 
Reported: 2026-04-15 09:36 UTC by Karolina Surma
Modified: 2026-04-27 09:31 UTC (History)
6 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pypa pip issues 13901 0 None closed `test_trailing_slash_directory_metadata` fails on Python 3.15.0a8 2026-04-15 10:00:01 UTC
Github pypa pip pull 13902 0 None Merged Fix `test_trailing_slash_directory_metadata` for Python 3.15 2026-04-15 10:00:01 UTC

Description Karolina Surma 2026-04-15 09:36:58 UTC
python-pip fails to build with Python 3.15.0a8.

________ test_trailing_slash_directory_metadata[/path/to/foo.egg-info/] ________
[gw0] linux -- Python 3.15.0 /usr/bin/python3

path = '/path/to/foo.egg-info/'

    @pytest.mark.parametrize(
        "path",
        [
            "/path/to/foo.egg-info".replace("/", os.path.sep),
            # Tests issue fixed by https://github.com/pypa/pip/pull/2530
            "/path/to/foo.egg-info/".replace("/", os.path.sep),
        ],
    )
    def test_trailing_slash_directory_metadata(path: str) -> None:
        dist = get_directory_distribution(path)
>       assert dist.raw_name == dist.canonical_name == "foo"
               ^^^^^^^^^^^^^

tests/unit/metadata/test_metadata.py:148: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILDROOT/usr/lib/python3.15/site-packages/pip/_internal/metadata/base.py:416: in raw_name
    return self.metadata.get("Name", self.canonical_name)
           ^^^^^^^^^^^^^
/usr/lib64/python3.15/functools.py:1169: in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
../BUILDROOT/usr/lib/python3.15/site-packages/pip/_internal/metadata/base.py:391: in metadata
    metadata = self._metadata_impl()
               ^^^^^^^^^^^^^^^^^^^^^
../BUILDROOT/usr/lib/python3.15/site-packages/pip/_internal/metadata/importlib/_dists.py:210: in _metadata_impl
    return cast(email.message.Message, self._dist.metadata)
                                       ^^^^^^^^^^^^^^^^^^^
/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 0x7f7c90b2f480>
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.

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/10318777-python-pip/

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

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 Miro Hrončok 2026-04-15 09:58:47 UTC
> importlib.metadata.MetadataNotFound: No package metadata was found.

This was added in https://github.com/python/cpython/pull/146234 as a response to https://github.com/python/cpython/issues/143387

Comment 2 Lumír Balhar 2026-04-27 09:31:41 UTC
pip 26.1 contains the fix for this issue.


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