Skip to content

Commit

Permalink
Replace pkg_resources with importlib.
Browse files Browse the repository at this point in the history
`pkg_resources` has been deprecated and will eventually stop working.

PiperOrigin-RevId: 718999650
  • Loading branch information
kenjitoyama authored and copybara-github committed Jan 23, 2025
1 parent 86dd4d3 commit a7b9c86
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

"""Simple package definition for using with `pip`."""

import importlib
import os

import pkg_resources
import setuptools
from setuptools import find_packages
from setuptools import setup
Expand Down Expand Up @@ -68,8 +68,10 @@ def run(self):
# dependencies.
from grpc_tools import protoc # pylint: disable=g-import-not-at-top

grpc_protos_include = pkg_resources.resource_filename(
'grpc_tools', '_proto')
with importlib.resources.as_file(
importlib.resources.files('grpc_tools').joinpath('_proto')
) as path:
grpc_protos_include = str(path)

for proto_path in _ANDROID_ENV_PROTOS:
proto_args = [
Expand Down

0 comments on commit a7b9c86

Please sign in to comment.