This PR updates the method for retrieving the version number of the polygon-api-client package. It replaces the use of pkg_resources from setuptools with importlib.metadata, which is part of the standard library in Python 3.8 and newer.
Changes
Removed import pkg_resources and replaced it with from importlib.metadata import version, PackageNotFoundError.
Updated the version retrieval logic to use importlib.metadata.version instead of pkg_resources.require.
This PR updates the method for retrieving the version number of the
polygon-api-client
package. It replaces the use ofpkg_resources
fromsetuptools
withimportlib.metadata
, which is part of the standard library in Python 3.8 and newer.Changes
import pkg_resources
and replaced it withfrom importlib.metadata import version, PackageNotFoundError
.importlib.metadata.version
instead ofpkg_resources.require
.Benefits
setuptools
which is deprecated and causing issues (https://github.com/polygon-io/client-python/issues/693 & https://github.com/polygon-io/client-python/issues/593)