diff options
author | serjflint <serjflint@yandex-team.com> | 2024-02-21 10:20:34 +0300 |
---|---|---|
committer | serjflint <serjflint@yandex-team.com> | 2024-02-21 10:36:02 +0300 |
commit | a1553506adf1e8b9ad08854f902771b6208142db (patch) | |
tree | 99898e342fbf5d03f34d788ca66f1f0143e45af2 | |
parent | 87190c082e81c449f0e200fe241490434c99f9cc (diff) | |
download | ydb-a1553506adf1e8b9ad08854f902771b6208142db.tar.gz |
fix ruff: cache workaround
ab4d963587a138f7006ed415c33a2dc8c35a75d8
-rw-r--r-- | build/conf/python.conf | 2 | ||||
-rw-r--r-- | build/plugins/pybuild.py | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/build/conf/python.conf b/build/conf/python.conf index 6ca4fae83a..26b1ee8287 100644 --- a/build/conf/python.conf +++ b/build/conf/python.conf @@ -238,11 +238,13 @@ macro STYLE_PYTHON(pyproject...) { # tag:python-specific tag:test STYLE_RUFF_VALUE=no +RUFF_CONFIG_PATHS_FILE=build/config/tests/ruff/ruff_config_paths.json ### @usage: STYLE_RUFF() ### ### Check python3 sources for style issues using ruff. macro STYLE_RUFF() { SET(STYLE_RUFF_VALUE yes) + SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${RUFF_CONFIG_PATHS_FILE}) } # tag:python-specific tag:test diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py index 04d00e4c4b..399dac5102 100644 --- a/build/plugins/pybuild.py +++ b/build/plugins/pybuild.py @@ -12,7 +12,6 @@ YA_IDE_VENV_VAR = 'YA_IDE_VENV' PY_NAMESPACE_PREFIX = 'py/namespace' BUILTIN_PROTO = 'builtin_proto' DEFAULT_FLAKE8_FILE_PROCESSING_TIME = "1.5" # in seconds -RUFF_CONFIG_PATHS_FILE = 'build/config/tests/ruff/ruff_config_paths.json' def _split_macro_call(macro_call, data, item_size, chunk_size=1024): @@ -139,7 +138,8 @@ def get_srcdir(path, unit): @lazy def get_ruff_configs(unit): - arc_config_path = unit.resolve_arc_path(RUFF_CONFIG_PATHS_FILE) + rel_config_path = rootrel_arc_src(unit.get('RUFF_CONFIG_PATHS_FILE'), unit) + arc_config_path = unit.resolve_arc_path(rel_config_path) abs_config_path = unit.resolve(arc_config_path) with open(abs_config_path, 'r') as fd: return list(json.load(fd).values()) @@ -220,7 +220,7 @@ def add_python_lint_checks(unit, py_ver, files): params = ["ruff", "tools/ruff_linter/bin/ruff_linter"] params += ["FILES"] + resolved_files params += ["GLOBAL_RESOURCES", resource] - configs = [RUFF_CONFIG_PATHS_FILE, 'build/config/tests/ruff/ruff.toml'] + get_ruff_configs(unit) + configs = [unit.get('RUFF_CONFIG_PATHS_FILE'), 'build/config/tests/ruff/ruff.toml'] + get_ruff_configs(unit) params += ['CONFIGS'] + configs unit.on_add_linter_check(params) @@ -480,7 +480,10 @@ def onpy_srcs(unit, *args): # generated if with_ext is None: cpp_files2res.add( - (os.path.splitext(filename)[0] + out_suffix, os.path.splitext(path)[0] + out_suffix) + ( + os.path.splitext(filename)[0] + out_suffix, + os.path.splitext(path)[0] + out_suffix, + ) ) else: cpp_files2res.add((filename + with_ext + out_suffix, path + with_ext + out_suffix)) |