1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Add ./script/test-module support for poetry and sukiyaki/octodns-netbox to the actions module list

This commit is contained in:
Ross McFarland
2022-10-16 15:56:34 -07:00
parent da81c8a7d5
commit c293bb19b3
2 changed files with 20 additions and 3 deletions

View File

@@ -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 ####################################################################"