diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-21 23:25:25 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-21 23:25:25 +0300 |
commit | d01bc613eacb1c2e20088782566dd46fcfe173d1 (patch) | |
tree | 8adc21cf92342400b52f8eb83b2374341e8c29ae /build/plugins/pybuild.py | |
parent | d8b7fbd32069dda0983d4e0047b080d7c8c2c090 (diff) | |
download | ydb-d01bc613eacb1c2e20088782566dd46fcfe173d1.tar.gz |
intermediate changes
ref:30ff16a27e264ce77a857e4b8947c893c3f87d17
Diffstat (limited to 'build/plugins/pybuild.py')
-rw-r--r-- | build/plugins/pybuild.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py index f32a2d39a0..b3f8b3ad7c 100644 --- a/build/plugins/pybuild.py +++ b/build/plugins/pybuild.py @@ -10,6 +10,7 @@ YA_IDE_VENV_VAR = 'YA_IDE_VENV' PY_NAMESPACE_PREFIX = 'py/namespace' BUILTIN_PROTO = 'builtin_proto' + def is_arc_src(src, unit): return ( src.startswith('${ARCADIA_ROOT}/') or @@ -17,6 +18,7 @@ def is_arc_src(src, unit): unit.resolve_arc_path(src).startswith('$S/') ) + def is_extended_source_search_enabled(path, unit): if not is_arc_src(path, unit): return False @@ -24,17 +26,20 @@ def is_extended_source_search_enabled(path, unit): return False return True + def to_build_root(path, unit): if is_arc_src(path, unit): return '${ARCADIA_BUILD_ROOT}/' + rootrel_arc_src(path, unit) return path + def uniq_suffix(path, unit): upath = unit.path() if '/' not in path: return '' return '.{}'.format(pathid(path)[:4]) + def pb2_arg(suf, path, mod, unit): return '{path}__int__{suf}={mod}{modsuf}'.format( path=stripext(to_build_root(path, unit)), @@ -43,18 +48,23 @@ def pb2_arg(suf, path, mod, unit): modsuf=stripext(suf) ) + def proto_arg(path, mod, unit): return '{}.proto={}'.format(stripext(to_build_root(path, unit)), mod) + def pb_cc_arg(suf, path, unit): return '{}{suf}'.format(stripext(to_build_root(path, unit)), suf=suf) + def ev_cc_arg(path, unit): return '{}.ev.pb.cc'.format(stripext(to_build_root(path, unit))) + def ev_arg(path, mod, unit): return '{}__int___ev_pb2.py={}_ev_pb2'.format(stripext(to_build_root(path, unit)), mod) + def mangle(name): if '.' not in name: return name @@ -104,12 +114,15 @@ def parse_pyx_includes(filename, path, source_root, seen=None): else: ymake.report_configure_error("'{}' includes missing file: {} ({})".format(path, incfile, abs_path)) + def has_pyx(args): return any(arg.endswith('.pyx') for arg in args) + def get_srcdir(path, unit): return rootrel_arc_src(path, unit)[:-len(path)].rstrip('/') + def add_python_lint_checks(unit, py_ver, files): def get_resolved_files(): resolved_files = [] @@ -622,6 +635,7 @@ def onpy_constructor(unit, arg): arg[arg.index(':')] = '=' unit.onresource(['-', 'py/constructors/{}'.format(arg)]) + def onpy_enums_serialization(unit, *args): ns = '' args = iter(args) @@ -638,6 +652,7 @@ def onpy_enums_serialization(unit, *args): else: onpy_srcs(unit, filename) + def oncpp_enums_serialization(unit, *args): args = iter(args) for arg in args: |