diff options
| author | Devtools Arcadia <[email protected]> | 2022-02-07 18:08:42 +0300 |
|---|---|---|
| committer | Devtools Arcadia <[email protected]> | 2022-02-07 18:08:42 +0300 |
| commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
| tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/tools/python3/pycc | |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/tools/python3/pycc')
| -rw-r--r-- | contrib/tools/python3/pycc/bin/ya.make | 28 | ||||
| -rwxr-xr-x | contrib/tools/python3/pycc/main.py | 19 | ||||
| -rw-r--r-- | contrib/tools/python3/pycc/ya.make | 13 |
3 files changed, 60 insertions, 0 deletions
diff --git a/contrib/tools/python3/pycc/bin/ya.make b/contrib/tools/python3/pycc/bin/ya.make new file mode 100644 index 00000000000..c63399c5257 --- /dev/null +++ b/contrib/tools/python3/pycc/bin/ya.make @@ -0,0 +1,28 @@ +OWNER(g:contrib g:ymake orivej) + +PY3_PROGRAM_BIN(pycc) + +ENABLE(PYBUILD_NO_PYC) + +DISABLE(PYTHON_SQLITE3) + +PEERDIR( + library/python/runtime_py3 + library/python/runtime_py3/main +) + +NO_CHECK_IMPORTS() + +NO_PYTHON_INCLUDES() + +NO_PYTHON_COVERAGE() + +SRCDIR( + contrib/tools/python3/pycc +) + +PY_SRCS( + MAIN main.py +) + +END() diff --git a/contrib/tools/python3/pycc/main.py b/contrib/tools/python3/pycc/main.py new file mode 100755 index 00000000000..996edb2bdda --- /dev/null +++ b/contrib/tools/python3/pycc/main.py @@ -0,0 +1,19 @@ +import marshal +import sys + + +def main(): + srcpathx, in_fname, out_fname = sys.argv[1:] + srcpath = srcpathx[:-1] + + with open(in_fname, 'r', encoding='utf-8') as in_file: + source = in_file.read() + + code = compile(source, srcpath, 'exec', dont_inherit=True) + + with open(out_fname, 'wb') as out_file: + marshal.dump(code, out_file) + + +if __name__ == '__main__': + main() diff --git a/contrib/tools/python3/pycc/ya.make b/contrib/tools/python3/pycc/ya.make new file mode 100644 index 00000000000..7bc5da96202 --- /dev/null +++ b/contrib/tools/python3/pycc/ya.make @@ -0,0 +1,13 @@ +OWNER(g:contrib g:ymake orivej) + +IF (USE_PREBUILT_TOOLS) + INCLUDE(${ARCADIA_ROOT}/build/prebuilt/contrib/tools/python3/pycc/ya.make.prebuilt) +ENDIF() + +IF (NOT PREBUILT) + INCLUDE(${ARCADIA_ROOT}/contrib/tools/python3/pycc/bin/ya.make) +ENDIF() + +RECURSE( + bin +) |
