Skip to content

Conversation

onixlas
Copy link

@onixlas onixlas commented Jun 15, 2025

The current implementation uses pkg_resources.get_distribution() to get the package version, which is now deprecated as officially stated in the setuptools documentation:

Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions.

I've replaced pkg_resources with Python's standard library alternative:

from importlib.metadata import version, PackageNotFoundError

try:
    __version__ = version("rrcf")
except PackageNotFoundError:
    __version__ = "unknown"

Thank you for your work on rrcf, it's a great package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant