From e495633aeb743c288a776bf4dab1efdcaf7a48bf Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Thu, 27 Jan 2022 12:27:26 -0800 Subject: [PATCH 1/6] Fully vet the setup.py requirements and installed code during cibuild --- script/cibuild | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/script/cibuild b/script/cibuild index f356a84..e3a4996 100755 --- a/script/cibuild +++ b/script/cibuild @@ -1,4 +1,5 @@ #!/bin/sh + set -e cd "$(dirname "$0")/.." @@ -27,4 +28,15 @@ echo "## tests/coverage ######################################################## script/coverage echo "## validate setup.py build #####################################################" python setup.py build +echo "## validate setup.py install ###################################################" +deactivate +TMP_DIR=$(mktemp -d -t ci-XXXXXXXXXX) +python3 -m venv $TMP_DIR +source "$TMP_DIR/bin/activate" +python setup.py install +octodns-sync --help +echo "## validate tests can run against installed code ###############################" +pip install .[dev] +cd $TMP_DIR +pytest --disable-network echo "## complete ####################################################################" From 32f0092263d336e29dfe4e3c602b5a5c4c2ba787 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Thu, 27 Jan 2022 12:30:25 -0800 Subject: [PATCH 2/6] Don't change into the venv, won't find tests there --- script/cibuild | 1 - 1 file changed, 1 deletion(-) diff --git a/script/cibuild b/script/cibuild index e3a4996..b234789 100755 --- a/script/cibuild +++ b/script/cibuild @@ -37,6 +37,5 @@ python setup.py install octodns-sync --help echo "## validate tests can run against installed code ###############################" pip install .[dev] -cd $TMP_DIR pytest --disable-network echo "## complete ####################################################################" From b92b23d6079d620f4773d91dfb267d31c9fd48f8 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Thu, 27 Jan 2022 12:33:24 -0800 Subject: [PATCH 3/6] Use . rather than source, latter is not always available --- script/cibuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild b/script/cibuild index b234789..1b5ca37 100755 --- a/script/cibuild +++ b/script/cibuild @@ -32,7 +32,7 @@ echo "## validate setup.py install ############################################# deactivate TMP_DIR=$(mktemp -d -t ci-XXXXXXXXXX) python3 -m venv $TMP_DIR -source "$TMP_DIR/bin/activate" +. "$TMP_DIR/bin/activate" python setup.py install octodns-sync --help echo "## validate tests can run against installed code ###############################" From 68aca50aa77e2230ea8fc335cf5073375864b56b Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Thu, 27 Jan 2022 13:03:53 -0800 Subject: [PATCH 4/6] env and versions after the source --- script/cibuild | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/cibuild b/script/cibuild index 1b5ca37..de887eb 100755 --- a/script/cibuild +++ b/script/cibuild @@ -7,16 +7,16 @@ cd "$(dirname "$0")/.." echo "## bootstrap ###################################################################" script/bootstrap -echo "## environment & versions ######################################################" -python --version -python -m pip --version - if [ -z "$VENV_NAME" ]; then VENV_NAME="env" fi . "$VENV_NAME/bin/activate" +echo "## environment & versions ######################################################" +python --version +pip --version + echo "## clean up ####################################################################" find octodns tests -name "*.pyc" -exec rm {} \; rm -f *.pyc From fb7addcf3fc0ea62df32e6a64074f195da46c55f Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Thu, 27 Jan 2022 13:15:48 -0800 Subject: [PATCH 5/6] .[dev] install defeats the purpose and file installs octodns --- script/cibuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/cibuild b/script/cibuild index de887eb..e49e62a 100755 --- a/script/cibuild +++ b/script/cibuild @@ -36,6 +36,6 @@ python3 -m venv $TMP_DIR python setup.py install octodns-sync --help echo "## validate tests can run against installed code ###############################" -pip install .[dev] -pytest --disable-network +pip install pytest pytest-network +pytest echo "## complete ####################################################################" From 83c0454a88a5361964cd7da4e4e06eecd86690fd Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Fri, 28 Jan 2022 12:29:30 -0800 Subject: [PATCH 6/6] Include --disable-network flag in ci installed test --- script/cibuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild b/script/cibuild index e49e62a..2826596 100755 --- a/script/cibuild +++ b/script/cibuild @@ -37,5 +37,5 @@ python setup.py install octodns-sync --help echo "## validate tests can run against installed code ###############################" pip install pytest pytest-network -pytest +pytest --disable-network echo "## complete ####################################################################"