From e2a56aaed7dc4fec55338d626bee689bf1243c47 Mon Sep 17 00:00:00 2001 From: p Date: Mon, 23 Nov 2026 12:56:14 +0100 Subject: [PATCH 1/3] dependencies pinned to master on master (mkn.mod.version, parse.yaml.version): a bare dep is the default branch, the rolling latest, whose mkn.kul differs from a master project's --- mkn.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mkn.yaml b/mkn.yaml index 4f1a389..72e7055 100644 --- a/mkn.yaml +++ b/mkn.yaml @@ -1,6 +1,11 @@ #! clean build -g 0 -W 9 -O 9 name: lang.python3 +property: + # dependency versions: master on master (not the default branch: mkn.mod's and parse.yaml's is + # the rolling latest, whose mkn.kul differs from a master project's) + mkn.mod.version: master + parse.yaml.version: master version: master parent: base @@ -9,10 +14,10 @@ mode: shared profile: - name: base - dep: mkn.mod + dep: mkn.mod#${mkn.mod.version} if_dep: - bsd: parse.yaml[lib] - win: parse.yaml[lib] + bsd: parse.yaml#${parse.yaml.version}[lib] + win: parse.yaml#${parse.yaml.version}[lib] if_arg: shared: -DMKN_KUL_SHARED win_static: -DYAML_CPP_STATIC_DEFINE From adc7b0e67da5da60baac6a14ff5589936427794b Mon Sep 17 00:00:00 2001 From: p Date: Mon, 23 Nov 2026 13:13:14 +0100 Subject: [PATCH 2/3] dependencies and modules pinned to master on master: deps and list form mods through version properties, inline mod strings (bon: no ${...}) with a literal #master. A bare name is the default branch: latest for the repos with releases, so a master tree got two mkn.kul versions --- mkn.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkn.yaml b/mkn.yaml index 72e7055..970cd35 100644 --- a/mkn.yaml +++ b/mkn.yaml @@ -24,4 +24,4 @@ profile: - name: format mod: | - clang.format{init:{style: google, paths: .}} + clang.format#master{init:{style: google, paths: .}} From fdea084b251fe3718345d8123bdcf50e666c6636 Mon Sep 17 00:00:00 2001 From: p Date: Mon, 23 Nov 2026 13:52:56 +0100 Subject: [PATCH 3/3] configuration as a mkn::mod::Node (mkn::kul::bon::Node) instead of a YAML::Node: find() for optional keys, str() for values, bon::validate for the allowed keys; no parse.yaml / yaml-cpp dependency --- mkn.yaml | 7 +------ mod.cpp | 25 +++++++++---------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/mkn.yaml b/mkn.yaml index 970cd35..cad5db5 100644 --- a/mkn.yaml +++ b/mkn.yaml @@ -2,10 +2,9 @@ name: lang.python3 property: - # dependency versions: master on master (not the default branch: mkn.mod's and parse.yaml's is + # dependency versions: master on master (not the default branch: mkn.mod's is # the rolling latest, whose mkn.kul differs from a master project's) mkn.mod.version: master - parse.yaml.version: master version: master parent: base @@ -15,12 +14,8 @@ mode: shared profile: - name: base dep: mkn.mod#${mkn.mod.version} - if_dep: - bsd: parse.yaml#${parse.yaml.version}[lib] - win: parse.yaml#${parse.yaml.version}[lib] if_arg: shared: -DMKN_KUL_SHARED - win_static: -DYAML_CPP_STATIC_DEFINE - name: format mod: | diff --git a/mod.cpp b/mod.cpp index 4bd54c2..642ebbe 100644 --- a/mod.cpp +++ b/mod.cpp @@ -29,13 +29,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "mkn/mod/init.hpp" // IWYU pragma: keep +#include "mkn/kul/bon.hpp" #include "mkn/kul/os.hpp" // for Dir, WHICH, PushDir #include "mkn/kul/env.hpp" // for GET, SET, Var, Var::Mode #include "mkn/kul/log.hpp" // for KERR #include "mkn/kul/defs.hpp" // for MKN_KUL_PUBLISH #include "mkn/kul/proc.hpp" // for Process, ProcessCapture, AProcess -#include "mkn/kul/yaml.hpp" // for NodeValidator, Validator #include "mkn/kul/except.hpp" // for Exception, KEXCEPT, KTHROW #include "mkn/kul/string.hpp" // for String @@ -113,8 +113,8 @@ std::string pyexec_for_string(std::string const& cmd) { class Python3Module : public mkn::mod::Module { public: - void compile(mkn::mod::Context& a, YAML::Node const& node) KTHROW(std::exception) override; - void link(mkn::mod::Context& a, YAML::Node const& node) KTHROW(std::exception) override; + void compile(mkn::mod::Context& a, mkn::mod::Node const& node) KTHROW(std::exception) override; + void link(mkn::mod::Context& a, mkn::mod::Node const& node) KTHROW(std::exception) override; private: auto py_include() const { @@ -160,19 +160,12 @@ class Python3Module : public mkn::mod::Module { return version; } - static void VALIDATE_NODE(YAML::Node const& node) { - using namespace kul::yaml; - Validator({ - NodeValidator("args"), - NodeValidator("delete"), - NodeValidator("with"), - NodeValidator("min"), - }) - .validate(node); + static void VALIDATE_NODE(mkn::mod::Node const& node) { + mkn::kul::bon::validate(node, {"args", "delete", "with", "min"}); } }; -void Python3Module::compile(mkn::mod::Context& a, YAML::Node const& node) KTHROW(std::exception) { +void Python3Module::compile(mkn::mod::Context& a, mkn::mod::Node const& node) KTHROW(std::exception) { VALIDATE_NODE(node); std::vector incs{py_include()}; @@ -181,8 +174,8 @@ void Python3Module::compile(mkn::mod::Context& a, YAML::Node const& node) KTHROW #endif try { - if (node["with"]) { - for (auto const& with : kul::cli::asArgs(node["with"].Scalar())) { + if (node.find("with")) { + for (auto const& with : kul::cli::asArgs(node["with"].str())) { // std::stringstream import; auto const import = std::string{"import "} + with + "; print(" + with + ".get_include())"; // auto outs = pyexec_for_string(import); @@ -210,7 +203,7 @@ void Python3Module::compile(mkn::mod::Context& a, YAML::Node const& node) KTHROW } } -void Python3Module::link(mkn::mod::Context& a, YAML::Node const& node) KTHROW(std::exception) { +void Python3Module::link(mkn::mod::Context& a, mkn::mod::Node const& node) KTHROW(std::exception) { VALIDATE_NODE(node); auto const embed = kul::String::BOOL(kul::env::GET("MKN_PYTHON_LIB_EMBED", "0"));