Skip to content

pkg_resources is deprecated as an API #781

@BigMichi1

Description

@BigMichi1

Checklist

Safety version

3.6.0

Python version

3.12.11

Operating System

openSUSE Leap 15.6

Describe the problem you'd like to have solved

no warning related to using a deprecated API should be printed when running safety

Describe the ideal solution

remove/replace dependency on pkg_resources with newer APIs like importlib.resources, importlib.metadata

Alternatives and current workarounds

No response

Additional context

See https://setuptools.pypa.io/en/latest/pkg_resources.html

What I Did

Running: safety check --output json

/home/user/.conda/envs/python312/lib/python3.12/site-packages/safety/safety.py:1853: 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.
import pkg_resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions