diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/python/cffi | |
parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) | |
download | ydb-2d37894b1b037cf24231090eda8589bbb44fb6fc.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/cffi')
-rw-r--r-- | contrib/python/cffi/cffi/recompiler.py | 2 | ||||
-rw-r--r-- | contrib/python/cffi/gen/lib/ya.make | 34 | ||||
-rw-r--r-- | contrib/python/cffi/gen/main.py | 74 | ||||
-rw-r--r-- | contrib/python/cffi/gen/ya.make | 30 | ||||
-rw-r--r-- | contrib/python/cffi/ya.make | 50 |
5 files changed, 95 insertions, 95 deletions
diff --git a/contrib/python/cffi/cffi/recompiler.py b/contrib/python/cffi/cffi/recompiler.py index fae0d58748..87203dcff8 100644 --- a/contrib/python/cffi/cffi/recompiler.py +++ b/contrib/python/cffi/cffi/recompiler.py @@ -287,7 +287,7 @@ class Recompiler: self.write_c_source_to_f(f, preamble) def _rel_readlines(self, filename): - import pkgutil + import pkgutil return pkgutil.get_data('cffi', filename).decode('utf-8').splitlines(True) def write_c_source_to_f(self, f, preamble): diff --git a/contrib/python/cffi/gen/lib/ya.make b/contrib/python/cffi/gen/lib/ya.make index 8a9f8cc1a3..e5891f26a4 100644 --- a/contrib/python/cffi/gen/lib/ya.make +++ b/contrib/python/cffi/gen/lib/ya.make @@ -1,21 +1,21 @@ -PY23_LIBRARY() - +PY23_LIBRARY() + LICENSE(MIT) -OWNER(orivej) - -PEERDIR( - contrib/python/cffi -) - -SRCDIR( - contrib/python/cffi/gen -) - -PY_SRCS( - MAIN main.py -) - +OWNER(orivej) + +PEERDIR( + contrib/python/cffi +) + +SRCDIR( + contrib/python/cffi/gen +) + +PY_SRCS( + MAIN main.py +) + NO_LINT() -END() +END() diff --git a/contrib/python/cffi/gen/main.py b/contrib/python/cffi/gen/main.py index 39636d187c..106293d3c5 100644 --- a/contrib/python/cffi/gen/main.py +++ b/contrib/python/cffi/gen/main.py @@ -1,37 +1,37 @@ -import os.path -import sys - -from cffi.setuptools_ext import execfile - -usage = '''Usage: {} INPUT:VAR OUTPUT -Generate CFFI C module source code. - -INPUT is a source .py file. -VAR is a cffi.FFI() object defined in the source file. -OUTPUT is a .c or .cpp output file. -''' - - -def main(): - if len(sys.argv) != 3 or ':' not in sys.argv[1]: - sys.stdout.write(usage.format(sys.argv[0])) - sys.exit(1) - - mod_spec, c_file = sys.argv[1:3] - build_file_name, ffi_var_name = mod_spec.rsplit(':', 1) - - source_dir = os.path.dirname(os.path.abspath(build_file_name)) - sys._MEIPASS = source_dir # For pygit2. - sys.dont_write_bytecode = True - sys.path = [source_dir] - mod_vars = {'__name__': '__cffi__', '__file__': build_file_name} - execfile(build_file_name, mod_vars) - - ffi = mod_vars[ffi_var_name] - if callable(ffi): - ffi = ffi() - ffi.emit_c_code(c_file) - - -if __name__ == '__main__': - main() +import os.path +import sys + +from cffi.setuptools_ext import execfile + +usage = '''Usage: {} INPUT:VAR OUTPUT +Generate CFFI C module source code. + +INPUT is a source .py file. +VAR is a cffi.FFI() object defined in the source file. +OUTPUT is a .c or .cpp output file. +''' + + +def main(): + if len(sys.argv) != 3 or ':' not in sys.argv[1]: + sys.stdout.write(usage.format(sys.argv[0])) + sys.exit(1) + + mod_spec, c_file = sys.argv[1:3] + build_file_name, ffi_var_name = mod_spec.rsplit(':', 1) + + source_dir = os.path.dirname(os.path.abspath(build_file_name)) + sys._MEIPASS = source_dir # For pygit2. + sys.dont_write_bytecode = True + sys.path = [source_dir] + mod_vars = {'__name__': '__cffi__', '__file__': build_file_name} + execfile(build_file_name, mod_vars) + + ffi = mod_vars[ffi_var_name] + if callable(ffi): + ffi = ffi() + ffi.emit_c_code(c_file) + + +if __name__ == '__main__': + main() diff --git a/contrib/python/cffi/gen/ya.make b/contrib/python/cffi/gen/ya.make index 69abc89af0..66f8030b9b 100644 --- a/contrib/python/cffi/gen/ya.make +++ b/contrib/python/cffi/gen/ya.make @@ -1,17 +1,17 @@ PY3_PROGRAM(cffigen) - -OWNER(orivej) - -DISABLE(PYTHON_SQLITE3) - -PEERDIR( - contrib/python/cffi/gen/lib -) - + +OWNER(orivej) + +DISABLE(PYTHON_SQLITE3) + +PEERDIR( + contrib/python/cffi/gen/lib +) + INDUCED_DEPS(cpp ${ARCADIA_ROOT}/contrib/python/cffi/cffi/_cffi_include.h) - -END() - -RECURSE( - lib -) + +END() + +RECURSE( + lib +) diff --git a/contrib/python/cffi/ya.make b/contrib/python/cffi/ya.make index 4d3c045bcf..7bff9477f9 100644 --- a/contrib/python/cffi/ya.make +++ b/contrib/python/cffi/ya.make @@ -2,22 +2,22 @@ PY23_LIBRARY() LICENSE(MIT) -OWNER(g:python-contrib) +OWNER(g:python-contrib) VERSION(1.15.0) - -PEERDIR( + +PEERDIR( contrib/restricted/libffi - contrib/python/pycparser -) - -ADDINCL( + contrib/python/pycparser +) + +ADDINCL( contrib/restricted/libffi/include -) - +) + NO_COMPILER_WARNINGS() -NO_LINT() - +NO_LINT() + SUPPRESSIONS(lsan.supp) SRCS( @@ -29,32 +29,32 @@ PY_REGISTER(_cffi_backend) PY_SRCS( TOP_LEVEL cffi/__init__.py - cffi/api.py - cffi/backend_ctypes.py + cffi/api.py + cffi/backend_ctypes.py cffi/cffi_opcode.py cffi/commontypes.py cffi/cparser.py cffi/error.py cffi/ffiplatform.py cffi/lock.py - cffi/model.py + cffi/model.py cffi/pkgconfig.py cffi/recompiler.py - cffi/setuptools_ext.py - cffi/vengine_cpy.py - cffi/vengine_gen.py - cffi/verifier.py + cffi/setuptools_ext.py + cffi/vengine_cpy.py + cffi/vengine_gen.py + cffi/verifier.py ) -RESOURCE_FILES( - PREFIX contrib/python/cffi/ +RESOURCE_FILES( + PREFIX contrib/python/cffi/ .dist-info/METADATA .dist-info/entry_points.txt .dist-info/top_level.txt cffi/_cffi_errors.h - cffi/_cffi_include.h - cffi/_embedding.h - cffi/parse_c_type.h -) - + cffi/_cffi_include.h + cffi/_embedding.h + cffi/parse_c_type.h +) + END() |