Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
4faea6b5
Commit
4faea6b5
authored
8 years ago
by
kpayson64
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #7290 from soltanmm/auto-cy
Fallback to generating files if not generated
parents
6b8a8e4a
f17f0f6b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+17
-5
17 additions, 5 deletions
setup.py
with
17 additions
and
5 deletions
setup.py
+
17
−
5
View file @
4faea6b5
...
...
@@ -70,7 +70,9 @@ LICENSE = '3-clause BSD'
# Environment variable to determine whether or not the Cython extension should
# *use* Cython or use the generated C files. Note that this requires the C files
# to have been generated by building first *with* Cython support.
# to have been generated by building first *with* Cython support. Even if this
# is set to false, if the script detects that the generated `.c` file isn't
# present, then it will still attempt to use Cython.
BUILD_WITH_CYTHON
=
os
.
environ
.
get
(
'
GRPC_PYTHON_BUILD_WITH_CYTHON
'
,
False
)
# Environment variable to determine whether or not to enable coverage analysis
...
...
@@ -146,10 +148,20 @@ def cython_extensions(module_names, extra_sources, include_dirs,
if
ENABLE_CYTHON_TRACING
:
define_macros
=
define_macros
+
[(
'
CYTHON_TRACE_NOGIL
'
,
1
)]
cython_compiler_directives
[
'
linetrace
'
]
=
True
file_extension
=
'
pyx
'
if
build_with_cython
else
'
c
'
module_files
=
[
os
.
path
.
join
(
PYTHON_STEM
,
name
.
replace
(
'
.
'
,
'
/
'
)
+
'
.
'
+
file_extension
)
for
name
in
module_names
]
pyx_module_files
=
[
os
.
path
.
join
(
PYTHON_STEM
,
name
.
replace
(
'
.
'
,
'
/
'
)
+
'
.pyx
'
)
for
name
in
module_names
]
c_module_files
=
[
os
.
path
.
join
(
PYTHON_STEM
,
name
.
replace
(
'
.
'
,
'
/
'
)
+
'
.c
'
)
for
name
in
module_names
]
if
not
build_with_cython
:
for
module_file
in
c_module_files
:
if
not
os
.
path
.
isfile
(
module_file
):
sys
.
stderr
.
write
(
'
Cython-generated files are missing;
'
'
forcing Cython build...
\n
'
)
build_with_cython
=
True
break
module_files
=
pyx_module_files
if
build_with_cython
else
c_module_files
extensions
=
[
_extension
.
Extension
(
name
=
module_name
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment