Bug 2403562 - python-astroid: Fails to build with setuptools 80.9.0 [ERROR in tests: UserWarning: pkg_resources is deprecated as an API]
Summary: python-astroid: Fails to build with setuptools 80.9.0 [ERROR in tests: UserWa...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-astroid
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2362565
TreeView+ depends on / blocked
 
Reported: 2025-10-13 15:41 UTC by Miro Hrončok
Modified: 2025-10-13 20:07 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-10-13 20:07:31 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2025-10-13 15:41:38 UTC
Dear package maintainer,

We want to update python-setuptools to 80.9.0 or newer.

However, your package fails to build with it, in our testing Copr:

https://copr.fedorainfracloud.org/coprs/churchyard/setuptools-80.9.0/package/python-astroid

To reproduce, try to build your package in mock with:

 $ fedpkg --release rawhide mockbuild -N -- --addrepo=https://download.copr.fedorainfracloud.org/results/churchyard/setuptools-80.9.0/fedora-rawhide-x86_64

As the number of failures is rather high, I have not yet tried to look into the details about each individual failure.
When you do, please feel free to post relevant part of the logs as comments.

Thank you. Let me know if you need help.

Comment 1 Miro Hrončok 2025-10-13 16:10:50 UTC
=================================== FAILURES ===================================
_______ AstroidManagerTest.test_identify_old_namespace_package_protocol ________

self = <tests.test_manager.AstroidManagerTest testMethod=test_identify_old_namespace_package_protocol>

    def test_identify_old_namespace_package_protocol(self) -> None:
        # Like the above cases, this package follows the old namespace package protocol
        # astroid currently assumes such packages are in sys.modules, so import it
        # pylint: disable-next=import-outside-toplevel
>       import tests.testdata.python3.data.path_pkg_resources_1.package.foo as _  # noqa

tests/test_manager.py:124: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/testdata/python3/data/path_pkg_resources_1/package/__init__.py:5: in <module>
    __import__("pkg_resources").declare_namespace(__name__)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    """
    Package resource API
    --------------------
    
    A resource is a logical file contained within a package, or a logical
    subdirectory thereof.  The package resource API expects resource names
    to have their path parts separated with ``/``, *not* whatever the local
    path separator is.  Do not use os.path operations to manipulate resource
    names being passed into the API.
    
    The package resource API is designed to work with normal filesystem packages,
    .egg files, and unpacked .egg files.  It can also work in a limited way with
    .zip files and with custom PEP 302 loaders that support the ``get_data()``
    method.
    
    This module is deprecated. Users are directed to :mod:`importlib.resources`,
    :mod:`importlib.metadata` and :pypi:`packaging` instead.
    """
    
    from __future__ import annotations
    
    import sys
    
    if sys.version_info < (3, 9):  # noqa: UP036 # Check for unsupported versions
        raise RuntimeError("Python 3.9 or later is required")
    
    import _imp
    import collections
    import email.parser
    import errno
    import functools
    import importlib
    import importlib.abc
    import importlib.machinery
    import inspect
    import io
    import ntpath
    import operator
    import os
    import pkgutil
    import platform
    import plistlib
    import posixpath
    import re
    import stat
    import tempfile
    import textwrap
    import time
    import types
    import warnings
    import zipfile
    import zipimport
    from collections.abc import Iterable, Iterator, Mapping, MutableSequence
    from pkgutil import get_importer
    from typing import (
        TYPE_CHECKING,
        Any,
        BinaryIO,
        Callable,
        Literal,
        NamedTuple,
        NoReturn,
        Protocol,
        TypeVar,
        Union,
        overload,
    )
    
    sys.path.extend(((vendor_path := os.path.join(os.path.dirname(os.path.dirname(__file__)), 'setuptools', '_vendor')) not in sys.path) * [vendor_path])  # fmt: skip
    # workaround for #4476
    sys.modules.pop('backports', None)
    
    # capture these to bypass sandboxing
    from os import open as os_open, utime  # isort: skip
    from os.path import isdir, split  # isort: skip
    
    try:
        from os import mkdir, rename, unlink
    
        WRITE_SUPPORT = True
    except ImportError:
        # no write support, probably under GAE
        WRITE_SUPPORT = False
    
    import packaging.markers
    import packaging.requirements
    import packaging.specifiers
    import packaging.utils
    import packaging.version
    from jaraco.text import drop_comment, join_continuation, yield_lines
    from platformdirs import user_cache_dir as _user_cache_dir
    
    if TYPE_CHECKING:
        from _typeshed import BytesPath, StrOrBytesPath, StrPath
        from _typeshed.importlib import LoaderProtocol
        from typing_extensions import Self, TypeAlias
    
>   warnings.warn(
        "pkg_resources is deprecated as an API. "
        "See https://setuptools.pypa.io/en/latest/pkg_resources.html. "
        "The pkg_resources package is slated for removal as early as "
        "2025-11-30. Refrain from using this package or pin to "
        "Setuptools<81.",
        UserWarning,
        stacklevel=2,
    )
E   UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.

/usr/lib/python3.14/site-packages/pkg_resources/__init__.py:98: UserWarning
=========================== short test summary info ============================
FAILED tests/test_manager.py::AstroidManagerTest::test_identify_old_namespace_package_protocol
=========== 1 failed, 1612 passed, 81 skipped, 15 xfailed in 19.89s ============


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