-#!/bin/sh
+#!/usr/bin/env bash
script_dir="$(dirname "$(readlink -f "$0")")"
-exec poetry --directory "$script_dir" run -- poe --root "$script_dir" "$@"
+poe --root "$script_dir" "$@"
# check that all dependencies are installed correctly
echo -e "${yellow}Checking that all dependencies are properly installed...${reset}"
-poetry install --dry-run --only main,dev,lint | grep "0 install" > /dev/null
+! python -m pip install --dry-run ".[prometheus,watchdog,dev,test,lint,docs]" | grep -qE "^Would install .{20,}$"
check_rv $?
echo
# early exit when dependencies are not installed
if test "$aggregated_rv" -ne "0"; then
echo -e "${red}Dependencies are not properly installed. Run this command to fix it:${reset}"
- echo -e " ${red}poetry install${reset}"
+ echo -e " ${red}python -m pip install ".[prometheus,watchdog,dev,test,lint,docs]"${reset}"
exit 1
fi
echo ------------------------------------
mkdir -vp $KRES_DEV_INSTALL_DIR/run/knot-resolver $KRES_DEV_INSTALL_DIR/var/cache/knot-resolver
echo
-echo ---------------------------------------
-echo Building Python komponents using Poetry
-echo ---------------------------------------
-poetry build
-# copy native modules from build directory to source directory
-shopt -s globstar
-shopt -s nullglob
-for d in build/lib*; do
- for f in "python/$d/"**/*.so; do
- cp -v "$f" ${f#"python/$d/"}
- done
-done
-shopt -u globstar
-shopt -u nullglob
-
+echo ------------------------------------------------------
+echo Building/installing Python components using setuptools
+echo ------------------------------------------------------
+python -m pip install -e .
echo
-echo --------------------------------------
-echo Starting Knot Resolver wit the Manager
-echo --------------------------------------
-python3 -m knot_resolver.manager --config "$KRES_DEV_CONFIG_FILE" "$@"
+echo ----------------------
+echo Starting Knot Resolver
+echo ----------------------
+knot-resolver --config "$KRES_DEV_CONFIG_FILE" "$@"