aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhukoff-pavel <zhukoff-pavel@yandex-team.com>2023-03-27 16:12:29 +0300
committerzhukoff-pavel <zhukoff-pavel@yandex-team.com>2023-03-27 16:12:29 +0300
commit5b79440688392ac5b53af0652dad5e95de3551f5 (patch)
treecd2dd4681d7485103b18e8447a0a96dbe04d733a
parenta35222ff6479216e673af377f4e0ae0aa789d4a3 (diff)
downloadydb-5b79440688392ac5b53af0652dad5e95de3551f5.tar.gz
[build/plugins] Add CYTHONIZE_PY notice
-rw-r--r--build/plugins/pybuild.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py
index 93e6c826aa..803f6d93ab 100644
--- a/build/plugins/pybuild.py
+++ b/build/plugins/pybuild.py
@@ -194,12 +194,13 @@ def py_program(unit, py3):
def onpy_srcs(unit, *args):
"""
- @usage PY_SRCS({| CYTHON_C} { | TOP_LEVEL | NAMESPACE ns} Files...)
+ @usage PY_SRCS({| CYTHONIZE_PY} {| CYTHON_C} { | TOP_LEVEL | NAMESPACE ns} Files...)
PY_SRCS() - is rule to build extended versions of Python interpreters and containing all application code in its executable file. It can be used to collect only the executables but not shared libraries, and, in particular, not to collect the modules that are imported using import directive.
The main disadvantage is the lack of IDE support; There is also no readline yet.
The application can be collect from any of the sources from which the C library, and with the help of PY_SRCS .py , .pyx,.proto and .swg files.
At the same time extensions for Python on C language generating from .pyx and .swg, will be registered in Python's as built-in modules, and sources on .py are stored as static data: when the interpreter starts, the initialization code will add a custom loader of these modules to sys.meta_path.
+ You can compile .py files as Cython sources with CYTHONIZE_PY directive (Use carefully, as build can get too slow). However, with it you won't have profiling info by default. To enable it, add "# cython: profile=True" line to the beginning of every cythonized source.
By default .pyx files are collected as C++-extensions. To collect them as C (similar to BUILDWITH_CYTHON_C, but with the ability to specify namespace), you must specify the Directive CYTHON_C.
Building with pyx automatically registers modules, you do not need to call PY_REGISTER for them
__init__.py never required, but if present (and specified in PY_SRCS), it will be imported when you import package modules with __init__.py Oh.