Skip to content

Dependency on Deprecated pkg_resources in razorpay Python Client Library #300

@sateesh012m

Description

@sateesh012m

The razorpay Python client library (client.py, line 4) triggers a UserWarning due to its use of pkg_resources, which is deprecated in setuptools and slated for removal as early as November 30, 2025. The warning message is:
.venv/lib/python3.12/site-packages/razorpay/client.py:4: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html.

Steps to Reproduce:

Install razorpay 1.4.2 in a Python 3.12 environment.
Import the razorpay module or run a script using the client.
Observed the warning.
Expected Behavior:
The library should avoid using pkg_resources and adopt an alternative to ensure compatibility with future setuptools versions.

Current Behavior:
The library triggers the deprecation warning, which may lead to runtime errors after pkg_resources is removed.

Environment:

Python version: 3.12
Razorpay version: 1.4.2
Setuptools version: 80.9.0
OS: Ubuntu 22.04
Suggested Fix:
Update the library to replace pkg_resources usage with a modern alternative like importlib.metadata or other non-deprecated APIs. Reference: https://setuptools.pypa.io/en/latest/pkg_resources.html.

Additional Context:
This issue may affect users relying on newer setuptools versions. Pinning setuptools<81 is a temporary workaround, but a proper fix is needed before the removal deadline.

Please advise on plans to address this deprecation or if a fix is already in progress. Thank you!

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