summaryrefslogtreecommitdiffstats
path: root/scripts/poe-tasks
diff options
context:
space:
mode:
authorAleš Mrázek <ales.mrazek@nic.cz>2024-09-18 00:33:17 +0200
committerAleš Mrázek <ales.mrazek@nic.cz>2024-09-30 11:16:07 +0200
commit7c6871ce11b079aef2f3993a6d7cdd0b68415305 (patch)
tree9cb242854b26728584be0afc382d7ec86a61974b /scripts/poe-tasks
parentscripts/poe-tasks: _env.sh improvements and formatting (diff)
downloadknot-resolver-7c6871ce11b079aef2f3993a6d7cdd0b68415305.tar.xz
knot-resolver-7c6871ce11b079aef2f3993a6d7cdd0b68415305.zip
scripts/poe-tasks: created gen-constantspy script
New script to build constants.py module using Meson. Also check that the module is the current one.
Diffstat (limited to 'scripts/poe-tasks')
-rwxr-xr-xscripts/poe-tasks/check8
-rwxr-xr-xscripts/poe-tasks/gen-constantspy14
2 files changed, 22 insertions, 0 deletions
diff --git a/scripts/poe-tasks/check b/scripts/poe-tasks/check
index d7766c20..7acd65b7 100755
--- a/scripts/poe-tasks/check
+++ b/scripts/poe-tasks/check
@@ -68,6 +68,13 @@ python setup.py --help > /dev/null
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
@@ -82,6 +89,7 @@ else
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
diff --git a/scripts/poe-tasks/gen-constantspy b/scripts/poe-tasks/gen-constantspy
new file mode 100755
index 00000000..f71f1577
--- /dev/null
+++ b/scripts/poe-tasks/gen-constantspy
@@ -0,0 +1,14 @@
+#!/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