Run under setuptools

pull/21504/head
Richard Belleville 5 years ago
parent 5f5402505e
commit 12cf83fd70
  1. 2
      tools/distrib/python/grpcio_tools/grpc_tools/_protoc_compiler.pyx
  2. 3
      tools/distrib/python/grpcio_tools/grpc_tools/protoc.py
  3. 4
      tools/distrib/python/grpcio_tools/setup.py

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# TODO: Manually format.
from libc cimport stdlib
from libcpp.vector cimport vector
from libcpp.utility cimport pair

@ -17,7 +17,6 @@
import pkg_resources
import sys
# TODO: Figure out how to add this dependency to setuptools.
import six
import os
@ -150,7 +149,7 @@ class ProtoFinder(importlib.abc.MetaPathFinder):
try:
prospective_path = os.path.join(search_path, filepath)
os.stat(prospective_path)
except FileNotFoundError:
except (FileNotFoundError, NotADirectoryError):
continue
else:
return importlib.machinery.ModuleSpec(

@ -37,6 +37,8 @@ from subprocess import PIPE
_PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__))
_README_PATH = os.path.join(_PACKAGE_PATH, 'README.rst')
_TEST_CLASS = "grpc_tools.test.protoc_test.ProtocTest"
os.chdir(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, os.path.abspath('.'))
@ -223,7 +225,9 @@ setuptools.setup(
packages=setuptools.find_packages('.'),
install_requires=[
'protobuf>=3.5.0.post1',
'six>=1.0.0',
'grpcio>={version}'.format(version=grpc_version.VERSION),
],
package_data=package_data(),
test_suite=_TEST_CLASS,
)

Loading…
Cancel
Save