Lines Matching +full:project +full:- +full:src +full:- +full:path
7 # http://www.apache.org/licenses/LICENSE-2.0
22 import os.path
33 PYTHON_STEM = os.path.dirname(os.path.abspath(__file__))
34 GRPC_STEM = os.path.abspath(PYTHON_STEM + "../../../../")
35 PROTO_STEM = os.path.join(GRPC_STEM, "src", "proto")
36 PROTO_GEN_STEM = os.path.join(GRPC_STEM, "src", "python", "gens")
37 CYTHON_STEM = os.path.join(PYTHON_STEM, "grpc", "_cython")
45 # https://bitbucket.org/pypa/pypi/issues/120/binary-wheels-for-linux-are-not-supported
47 """Returns a string path to a bdist file for Linux to install.
49 If we can retrieve a pre-compiled bdist from online, uses it. Else, emits a
72 # Our chosen local bdist path.
103 source_dir = os.path.join(GRPC_STEM, "doc", "python", "sphinx")
104 target_dir = os.path.join(GRPC_STEM, "doc", "build")
106 ["-b", "html", "-W", "--keep-going", source_dir, target_dir]
115 """Command to generate project metadata in a module."""
117 description = "build grpcio project metadata files"
128 os.path.join(PYTHON_STEM, "grpc/_grpcio_metadata.py"), "w"
136 """Custom project build command."""
145 poison_filename = os.path.join(PYTHON_STEM, "poison.c")
159 base, file_ext = os.path.splitext(source)
168 if os.path.isfile(base + gen_ext)
175 sys.stderr.write("Cython-generated files are missing...\n")
180 sys.stderr.write("Found cython-generated files...\n")
190 mandatory: Whether or not having Cython-generated files is mandatory. If it
194 # Break import style to ensure we have access to Cython post-setup_requires
207 " Cython-generated code."
228 """Custom build_ext command to enable compiler-specific flags."""
231 "unix": ("-pthread",),
239 # E.g. on x64 linux the suffix is ".cpython-XYZ-x86_64-linux-gnu.so"
241 … # so that the resulting file name matches the target architecture and we end up with a well-formed
247 filename = filename[: -len(orig_ext_suffix)] + new_ext_suffix
259 [cc, "-x", "c", "-std=c++14", "-"],
268 "Non-fatal exception:" + traceback.format_exc() + "\n"
273 # behavior in gcc and clang. The clang doesn't take --stdc++11
284 def new_compile(obj, src, ext, cc_args, extra_postargs, pp_opts): argument
285 if src.endswith(".c"):
287 arg for arg in extra_postargs if "-std=c++" not in arg
289 elif src.endswith(".cc") or src.endswith(".cpp"):
291 arg for arg in extra_postargs if "-std=gnu99" not in arg
294 obj, src, ext, cc_args, extra_postargs, pp_opts
323 """Command to gather project dependencies."""
353 "src/python/grpcio/__pycache__/",
354 "src/python/grpcio/grpc/_cython/cygrpc.cpp",
355 "src/python/grpcio/grpc/_cython/*.so",
356 "src/python/grpcio/grpcio.egg-info/",
358 _CURRENT_DIRECTORY = os.path.normpath(
359 os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../..")
370 this_glob = os.path.normpath(
371 os.path.join(Clean._CURRENT_DIRECTORY, path_spec)
374 for path in abs_paths:
375 if not str(path).startswith(Clean._CURRENT_DIRECTORY):
377 "Cowardly refusing to delete {}.".format(path)
379 print("Removing {}".format(os.path.relpath(path)))
380 if os.path.isfile(path):
381 os.remove(str(path))
383 shutil.rmtree(str(path))