New script to build constants.py module using Meson. Also check that the module is the current one.
test = { cmd = "scripts/poe-tasks/test", help = "Run pytest unit tests" }
check = { cmd = "scripts/poe-tasks/check", help = "Check that all dependencies are installed and run static code analysis" }
examples = { cmd = "scripts/poe-tasks/examples", help = "Validate all configuration examples using 'kresctl validate' utility" }
+gen-constantspy = { cmd = "scripts/poe-tasks/gen-constantspy", help = "Generate 'constants.py' module using Meson configured options" }
gen-setuppy = { cmd = "scripts/poe-tasks/gen-setuppy", help = "Generate 'setup.py' file for backwards compatibility" }
format = { cmd = "scripts/poe-tasks/format", help = "Run code formatter" }
kresctl = { cmd = "scripts/poe-tasks/kresctl", help="Run kresctl utility" }
check_rv $?
echo
+# check python/knot_resolver/constants.py
+echo -e "${yellow}python/knot_resolver/constants.py${reset}"
+meson_setup_configure > /dev/null
+diff python/knot_resolver/constants.py $build_dir/python/constants.py
+check_rv $?
+echo
+
# check that doc/_static/config.schema.json is the latest
echo -e "${yellow}Checking doc/_static/config.schema.json${reset}"
python -m knot_resolver.client schema | diff - doc/_static/config.schema.json
echo -e "${red}These commands might help you:${reset}"
echo -e "${red}\tpoe format${reset}"
echo -e "${red}\tpoe gen-setuppy${reset}"
+ echo -e "${red}\tpoe gen-constantspy${reset}"
echo -e "${red}\tpoe doc-schema${reset}"
echo -e "${red}That's not great. Could you please fix that?${reset} 😲😟"
fi
--- /dev/null
+#!/usr/bin/env bash
+
+# ensure consistent behaviour
+src_dir="$(dirname "$(realpath "$0")")"
+source $src_dir/utils/_env.sh
+
+echo
+meson_setup_configure
+echo
+echo -----------------------------------------------
+echo Copying constants.py module configured by Meson
+echo -----------------------------------------------
+cp -v $build_dir/python/constants.py $gitroot/python/knot_resolver/constants.py
+echo
\ No newline at end of file