From c293bb19b324b628c5564338b71c8aae406e5c40 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Sun, 16 Oct 2022 15:56:34 -0700 Subject: [PATCH] Add ./script/test-module support for poetry and sukiyaki/octodns-netbox to the actions module list --- .github/workflows/modules.yml | 1 + script/test-module | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/modules.yml b/.github/workflows/modules.yml index 8be6247..97d2fab 100644 --- a/.github/workflows/modules.yml +++ b/.github/workflows/modules.yml @@ -36,6 +36,7 @@ jobs: - octodns/octodns-selectel - octodns/octodns-transip - octodns/octodns-ultra + - sukiyaki/octodns-netbox steps: - uses: actions/checkout@master - name: Setup python diff --git a/script/test-module b/script/test-module index dff26e8..261e59f 100755 --- a/script/test-module +++ b/script/test-module @@ -25,8 +25,24 @@ cd $TMP_DIR git clone "https://github.com/${module}.git" cd $(basename $module) echo "## install module dev requirements #############################################" -pip install -e .[dev] -export PYTHONPATH=.:$PYTHONPATH +if [ -e setup.py ]; then + pip install -e .[dev] +elif [ -f poetry.toml ]; then + # install poetry + pip install poetry + # make sure that poetry doesn't blow away our locally installed octodns + sed -i '' '/^octodns =/d' pyproject.toml + # now install all the deps + poetry install --no-root -v +else + echo "Unrecognized module management. Supports setup.py and poetry" + exit 1 +fi echo "## run module tests ############################################################" -pytest --disable-network +export PYTHONPATH=.:$PYTHONPATH +if [ -e setup.py ]; then + pytest --disable-network +elif [ -f poetry.toml ]; then + poetry run pytest [] +fi echo "## complete ####################################################################"