diff options
author | zaverden <zaverden@yandex-team.com> | 2024-02-26 11:58:12 +0300 |
---|---|---|
committer | zaverden <zaverden@yandex-team.com> | 2024-02-26 12:16:26 +0300 |
commit | d180f9b302f71970d2e5cf0bf7cd26bdaa5aef12 (patch) | |
tree | 8a4b8a497a7296e4ff6977dd4dfa768b479aa647 /build/plugins/nots.py | |
parent | 2c831425e3b8e6331c6ed07081cd0111db18bf9d (diff) | |
download | ydb-d180f9b302f71970d2e5cf0bf7cd26bdaa5aef12.tar.gz |
feat(conf): configure used tarballs by own pnpm-lock.yaml
b61ff371d6ad2f8c646f2a04e4a7d0fa178a6541
Diffstat (limited to 'build/plugins/nots.py')
-rw-r--r-- | build/plugins/nots.py | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/build/plugins/nots.py b/build/plugins/nots.py index 6e99f5c10b..cc4561bb0b 100644 --- a/build/plugins/nots.py +++ b/build/plugins/nots.py @@ -422,10 +422,6 @@ def _add_test(unit, test_type, test_files, deps=None, test_record=None, test_cwd if test_record: full_test_record.update(test_record) - for k, v in full_test_record.items(): - if not isinstance(v, str): - logger.warn(k, "expected 'str', got:", type(v)) - data = ytest.dump_test(unit, full_test_record) if data: unit.set_property(["DART_DATA", data]) @@ -480,6 +476,23 @@ def _select_matching_version(erm_json, resource_name, range_str, dep_is_required @_with_report_configure_error +def on_prepare_deps_configure(unit): + pm = _create_pm(unit) + pj = pm.load_package_json_from_dir(pm.sources_path) + has_deps = pj.has_dependencies() + ins, outs = pm.calc_prepare_deps_inouts(unit.get("_TARBALLS_STORE"), has_deps) + + if pj.has_dependencies(): + unit.onpeerdir(pm.get_local_peers_from_package_json()) + __set_append(unit, "_PREPARE_DEPS_INOUTS", _build_directives("input", ["hide"], sorted(ins))) + __set_append(unit, "_PREPARE_DEPS_INOUTS", _build_directives("output", ["hide"], sorted(outs))) + + else: + __set_append(unit, "_PREPARE_DEPS_INOUTS", _build_directives("output", [], sorted(outs))) + unit.set(["_PREPARE_DEPS_CMD", "$_PREPARE_NO_DEPS_CMD"]) + + +@_with_report_configure_error def on_node_modules_configure(unit): pm = _create_pm(unit) pj = pm.load_package_json_from_dir(pm.sources_path) @@ -487,21 +500,11 @@ def on_node_modules_configure(unit): if pj.has_dependencies(): unit.onpeerdir(pm.get_local_peers_from_package_json()) local_cli = unit.get("TS_LOCAL_CLI") == "yes" - errors, ins, outs = pm.calc_node_modules_inouts(local_cli) - - if errors: - ymake.report_configure_error( - "There are some issues with lockfiles.\n" - + "Please contact support (https://nda.ya.ru/t/sNoSFsO76ygSXL),\n" - + "providing following details:\n" - + "\n---\n".join([str(err) for err in errors]) - ) - else: - unit.on_set_node_modules_ins_outs(["IN"] + sorted(ins) + ["OUT"] + sorted(outs)) + ins, outs = pm.calc_node_modules_inouts(local_cli) - __set_append(unit, "_NODE_MODULES_INOUTS", _build_directives("input", ["hide"], sorted(ins))) - if not unit.get("TS_TEST_FOR"): - __set_append(unit, "_NODE_MODULES_INOUTS", _build_directives("output", ["hide"], sorted(outs))) + __set_append(unit, "_NODE_MODULES_INOUTS", _build_directives("input", ["hide"], sorted(ins))) + if not unit.get("TS_TEST_FOR"): + __set_append(unit, "_NODE_MODULES_INOUTS", _build_directives("output", ["hide"], sorted(outs))) if pj.get_use_prebuilder(): lf = pm.load_lockfile_from_dir(pm.sources_path) @@ -526,10 +529,6 @@ def on_node_modules_configure(unit): ] ) - else: - # default "noop" command - unit.set(["_NODE_MODULES_CMD", "$TOUCH_UNIT"]) - @_with_report_configure_error def on_ts_test_for_configure(unit, test_runner, default_config, node_modules_filename): |