Skip to content

pkg_resources Deprecation Warning in client.py (Setuptools 81+ Compatibility) #305

@FathimaFyrooz

Description

@FathimaFyrooz

Describe the Bug

The Razorpay Python client (razorpay/client.py) uses pkg_resources, which is deprecated and will be removed in Setuptools 81+ (planned for Nov 2025). This causes a warning in Python environments using newer Setuptools versions.

Error/Warning Message

Expected Behavior

The Razorpay SDK should migrate to modern alternatives like:

  • importlib.metadata (Python 3.8+)
  • importlib.resources
  • Direct dependency management

Steps to Reproduce

  1. Install Razorpay (pip install razorpay)
  2. Run any code that imports razorpay
  3. Warning appears (even with setuptools<81)

Environment

  • Razorpay-Python Version: 1.4.2
  • Setuptools Version: 80.9.0
  • Python Version: 3.12/3.13

Suggested Fix

Replace pkg_resources usage with importlib.metadata (for package version checks) or remove the dependency if possible.

References

Thanks! Hope this can be fixed before Setuptools 81 releases. 🚀

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions