Skip to content
Snippets Groups Projects
Commit fb261bf7 authored by Masood Malekghassemi's avatar Masood Malekghassemi
Browse files

Un-namespace Python packages

Setuptools was updated and our hacky namespace-package-chickens came
back to roost. This removes the unsupported namespace package hacks.
parent 4603a1c7
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
from libc cimport stdlib from libc cimport stdlib
cdef extern from "grpc/tools/main.h": cdef extern from "grpc_tools/main.h":
int protoc_main(int argc, char *argv[]) int protoc_main(int argc, char *argv[])
def run_main(list args not None): def run_main(list args not None):
......
...@@ -33,7 +33,7 @@ import sys ...@@ -33,7 +33,7 @@ import sys
import setuptools import setuptools
from grpc.tools import protoc from grpc_tools import protoc
def build_package_protos(package_root): def build_package_protos(package_root):
...@@ -45,7 +45,7 @@ def build_package_protos(package_root): ...@@ -45,7 +45,7 @@ def build_package_protos(package_root):
proto_files.append(os.path.abspath(os.path.join(root, filename))) proto_files.append(os.path.abspath(os.path.join(root, filename)))
well_known_protos_include = pkg_resources.resource_filename( well_known_protos_include = pkg_resources.resource_filename(
'grpc.tools', '_proto') 'grpc_tools', '_proto')
for proto_file in proto_files: for proto_file in proto_files:
command = [ command = [
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "src/compiler/python_generator.h" #include "src/compiler/python_generator.h"
#include "grpc/tools/main.h" #include "grpc_tools/main.h"
int protoc_main(int argc, char* argv[]) { int protoc_main(int argc, char* argv[]) {
google::protobuf::compiler::CommandLineInterface cli; google::protobuf::compiler::CommandLineInterface cli;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
import pkg_resources import pkg_resources
import sys import sys
from grpc.tools import _protoc_compiler from grpc_tools import _protoc_compiler
def main(command_arguments): def main(command_arguments):
"""Run the protocol buffer compiler with the given command-line arguments. """Run the protocol buffer compiler with the given command-line arguments.
......
...@@ -108,7 +108,7 @@ PROTO_FILES = [ ...@@ -108,7 +108,7 @@ PROTO_FILES = [
CC_INCLUDE = os.path.normpath(protoc_lib_deps.CC_INCLUDE) CC_INCLUDE = os.path.normpath(protoc_lib_deps.CC_INCLUDE)
PROTO_INCLUDE = os.path.normpath(protoc_lib_deps.PROTO_INCLUDE) PROTO_INCLUDE = os.path.normpath(protoc_lib_deps.PROTO_INCLUDE)
GRPC_PYTHON_TOOLS_PACKAGE = 'grpc.tools' GRPC_PYTHON_TOOLS_PACKAGE = 'grpc_tools'
GRPC_PYTHON_PROTO_RESOURCES_NAME = '_proto' GRPC_PYTHON_PROTO_RESOURCES_NAME = '_proto'
DEFINE_MACROS = () DEFINE_MACROS = ()
...@@ -154,16 +154,16 @@ def package_data(): ...@@ -154,16 +154,16 @@ def package_data():
def extension_modules(): def extension_modules():
if BUILD_WITH_CYTHON: if BUILD_WITH_CYTHON:
plugin_sources = [os.path.join('grpc', 'tools', '_protoc_compiler.pyx')] plugin_sources = [os.path.join('grpc_tools', '_protoc_compiler.pyx')]
else: else:
plugin_sources = [os.path.join('grpc', 'tools', '_protoc_compiler.cpp')] plugin_sources = [os.path.join('grpc_tools', '_protoc_compiler.cpp')]
plugin_sources += [ plugin_sources += [
os.path.join('grpc', 'tools', 'main.cc'), os.path.join('grpc_tools', 'main.cc'),
os.path.join('grpc_root', 'src', 'compiler', 'python_generator.cc')] + [ os.path.join('grpc_root', 'src', 'compiler', 'python_generator.cc')] + [
os.path.join(CC_INCLUDE, cc_file) os.path.join(CC_INCLUDE, cc_file)
for cc_file in CC_FILES] for cc_file in CC_FILES]
plugin_ext = extension.Extension( plugin_ext = extension.Extension(
name='grpc.tools._protoc_compiler', name='grpc_tools._protoc_compiler',
sources=plugin_sources, sources=plugin_sources,
include_dirs=[ include_dirs=[
'.', '.',
...@@ -189,7 +189,6 @@ setuptools.setup( ...@@ -189,7 +189,6 @@ setuptools.setup(
license='3-clause BSD', license='3-clause BSD',
ext_modules=extension_modules(), ext_modules=extension_modules(),
packages=setuptools.find_packages('.'), packages=setuptools.find_packages('.'),
namespace_packages=['grpc'],
install_requires=[ install_requires=[
'protobuf>=3.0.0', 'protobuf>=3.0.0',
'grpcio>={version}'.format(version=grpc_version.VERSION), 'grpcio>={version}'.format(version=grpc_version.VERSION),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment