diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/python | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/python')
-rw-r--r-- | contrib/libs/python/Include/ya.make | 28 | ||||
-rw-r--r-- | contrib/libs/python/gen_includes.py | 70 | ||||
-rw-r--r-- | contrib/libs/python/ya.make | 36 |
3 files changed, 67 insertions, 67 deletions
diff --git a/contrib/libs/python/Include/ya.make b/contrib/libs/python/Include/ya.make index e65263e6a0..b1fe0f213e 100644 --- a/contrib/libs/python/Include/ya.make +++ b/contrib/libs/python/Include/ya.make @@ -1,5 +1,5 @@ -PY23_LIBRARY() - +PY23_LIBRARY() + WITHOUT_LICENSE_TEXTS() LICENSE(YandexOpen) @@ -9,21 +9,21 @@ OWNER( spreis g:contrib ) - -NO_PYTHON_INCLUDES() - -ADDINCL(GLOBAL contrib/libs/python/Include) - -IF (PYTHON2) - CFLAGS(GLOBAL -DUSE_PYTHON2) + +NO_PYTHON_INCLUDES() + +ADDINCL(GLOBAL contrib/libs/python/Include) + +IF (PYTHON2) + CFLAGS(GLOBAL -DUSE_PYTHON2) PEERDIR( contrib/tools/python/lib ) -ELSE() - CFLAGS(GLOBAL -DUSE_PYTHON3) +ELSE() + CFLAGS(GLOBAL -DUSE_PYTHON3) PEERDIR( contrib/tools/python3/src ) -ENDIF() - -END() +ENDIF() + +END() diff --git a/contrib/libs/python/gen_includes.py b/contrib/libs/python/gen_includes.py index 0e024cc49d..b19b15083b 100644 --- a/contrib/libs/python/gen_includes.py +++ b/contrib/libs/python/gen_includes.py @@ -2,9 +2,9 @@ import sys import os import errno from os import listdir -from os.path import dirname, relpath, join - +from os.path import dirname, relpath, join + def ensure_dir_exists(path): try: os.makedirs(path) @@ -14,25 +14,25 @@ def ensure_dir_exists(path): else: raise - + def make_dir(directory): if not os.path.exists(directory): os.makedirs(directory) - -def files(directory): - for dirpath, dirnames, filenames in os.walk(directory): - for name in filenames: - yield relpath(join(dirpath, name), directory) - - + +def files(directory): + for dirpath, dirnames, filenames in os.walk(directory): + for name in filenames: + yield relpath(join(dirpath, name), directory) + + def headers_set(directory): - return { - f for f in files(directory) - if f.endswith('.h') and not f.startswith('internal/') - } - + return { + f for f in files(directory) + if f.endswith('.h') and not f.startswith('internal/') + } + if __name__ == "__main__": python2_path = sys.argv[1] @@ -42,23 +42,23 @@ if __name__ == "__main__": ensure_dir_exists(join('.', python2_path)) ensure_dir_exists(join('.', python3_path)) - only_headers2 = headers_set(python2_path) - only_headers3 = headers_set(python3_path) - all_headers = only_headers2 | only_headers3 - - for header in all_headers: - path = join(output_path, header) - make_dir(dirname(path)) - f = open(path, 'w') - f.write('#pragma once\n\n') - f.write('#ifdef USE_PYTHON3\n') - if (header in only_headers3): - f.write('#include <' + join(python3_path, header) + '>\n') - else: - f.write('#error "No <' + header + '> in Python3"\n') - f.write('#else\n') - if (header in only_headers2): - f.write('#include <' + join(python2_path, header) + '>\n') - else: - f.write('#error "No <' + header + '> in Python2"\n') - f.write('#endif\n') + only_headers2 = headers_set(python2_path) + only_headers3 = headers_set(python3_path) + all_headers = only_headers2 | only_headers3 + + for header in all_headers: + path = join(output_path, header) + make_dir(dirname(path)) + f = open(path, 'w') + f.write('#pragma once\n\n') + f.write('#ifdef USE_PYTHON3\n') + if (header in only_headers3): + f.write('#include <' + join(python3_path, header) + '>\n') + else: + f.write('#error "No <' + header + '> in Python3"\n') + f.write('#else\n') + if (header in only_headers2): + f.write('#include <' + join(python2_path, header) + '>\n') + else: + f.write('#error "No <' + header + '> in Python2"\n') + f.write('#endif\n') diff --git a/contrib/libs/python/ya.make b/contrib/libs/python/ya.make index 20a57f4b48..38bcccf2b9 100644 --- a/contrib/libs/python/ya.make +++ b/contrib/libs/python/ya.make @@ -13,27 +13,27 @@ LICENSE_TEXTS(.yandex_meta/licenses.list.txt) NO_PYTHON_INCLUDES() IF (USE_ARCADIA_PYTHON) - PEERDIR( - contrib/libs/python/Include - library/python/symbols/module - library/python/symbols/libc - library/python/symbols/python - ) + PEERDIR( + contrib/libs/python/Include + library/python/symbols/module + library/python/symbols/libc + library/python/symbols/python + ) IF (NOT OS_WINDOWS AND NOT OPENSOURCE) PEERDIR( library/python/symbols/uuid ) ENDIF() IF (MODULE_TAG == "PY2") - PEERDIR( - contrib/tools/python/lib - library/python/runtime - ) + PEERDIR( + contrib/tools/python/lib + library/python/runtime + ) ELSE() - PEERDIR( - contrib/tools/python3/lib - library/python/runtime_py3 - ) + PEERDIR( + contrib/tools/python3/lib + library/python/runtime_py3 + ) ENDIF() ELSE() IF (USE_SYSTEM_PYTHON) @@ -46,7 +46,7 @@ ELSE() ENDIF() END() - -RECURSE( - Include -) + +RECURSE( + Include +) |