Skip to content

Commit

Permalink
Merge pull request grpc#8065 from kpayson64/cygrpc_imports
Browse files Browse the repository at this point in the history
Make .pxi imports relative to _cython directory rather than root.
  • Loading branch information
kpayson64 authored Sep 15, 2016
2 parents 65b2970 + 7722245 commit 9544aad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion src/python/grpcio/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
GRPC_STEM = os.path.abspath(PYTHON_STEM + '../../../../')
PROTO_STEM = os.path.join(GRPC_STEM, 'src', 'proto')
PROTO_GEN_STEM = os.path.join(GRPC_STEM, 'src', 'python', 'gens')
CYTHON_STEM = os.path.join(PYTHON_STEM, 'grpc', '_cython')

CONF_PY_ADDENDUM = """
extensions.append('sphinx.ext.napoleon')
Expand Down Expand Up @@ -244,7 +245,7 @@ def try_cythonize(extensions, linetracing=False, mandatory=True):
extensions,
include_path=[
include_dir for extension in extensions for include_dir in extension.include_dirs
],
] + [CYTHON_STEM],
compiler_directives=cython_compiler_directives
)

Expand Down
16 changes: 8 additions & 8 deletions src/python/grpcio/grpc/_cython/cygrpc.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

include "grpc/_cython/_cygrpc/grpc.pxi"
include "_cygrpc/grpc.pxi"

include "grpc/_cython/_cygrpc/call.pxd.pxi"
include "grpc/_cython/_cygrpc/channel.pxd.pxi"
include "grpc/_cython/_cygrpc/credentials.pxd.pxi"
include "grpc/_cython/_cygrpc/completion_queue.pxd.pxi"
include "grpc/_cython/_cygrpc/records.pxd.pxi"
include "grpc/_cython/_cygrpc/security.pxd.pxi"
include "grpc/_cython/_cygrpc/server.pxd.pxi"
include "_cygrpc/call.pxd.pxi"
include "_cygrpc/channel.pxd.pxi"
include "_cygrpc/credentials.pxd.pxi"
include "_cygrpc/completion_queue.pxd.pxi"
include "_cygrpc/records.pxd.pxi"
include "_cygrpc/security.pxd.pxi"
include "_cygrpc/server.pxd.pxi"
16 changes: 8 additions & 8 deletions src/python/grpcio/grpc/_cython/cygrpc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ import sys

# TODO(atash): figure out why the coverage tool gets confused about the Cython
# coverage plugin when the following files don't have a '.pxi' suffix.
include "grpc/_cython/_cygrpc/grpc_string.pyx.pxi"
include "grpc/_cython/_cygrpc/call.pyx.pxi"
include "grpc/_cython/_cygrpc/channel.pyx.pxi"
include "grpc/_cython/_cygrpc/credentials.pyx.pxi"
include "grpc/_cython/_cygrpc/completion_queue.pyx.pxi"
include "grpc/_cython/_cygrpc/records.pyx.pxi"
include "grpc/_cython/_cygrpc/security.pyx.pxi"
include "grpc/_cython/_cygrpc/server.pyx.pxi"
include "_cygrpc/grpc_string.pyx.pxi"
include "_cygrpc/call.pyx.pxi"
include "_cygrpc/channel.pyx.pxi"
include "_cygrpc/credentials.pyx.pxi"
include "_cygrpc/completion_queue.pyx.pxi"
include "_cygrpc/records.pyx.pxi"
include "_cygrpc/security.pyx.pxi"
include "_cygrpc/server.pyx.pxi"

#
# initialize gRPC
Expand Down

0 comments on commit 9544aad

Please sign in to comment.