-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcibuild-setup-py
executable file
·27 lines (24 loc) · 1.16 KB
/
cibuild-setup-py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
set -e
cd "$(dirname "$0")/.."
VERSION="$(grep "^__version__" "./octodns_autodns/__init__.py" | sed -e "s/.* = '//" -e "s/'$//")"
echo "## create test venv ############################################################"
TMP_DIR=$(mktemp -d -t ci-XXXXXXXXXX)
python3 -m venv $TMP_DIR
. "$TMP_DIR/bin/activate"
pip install build setuptools
echo "## environment & versions ######################################################"
python --version
pip --version
echo "## validate setup.py build #####################################################"
python -m build --sdist --wheel
echo "## validate wheel install ###################################################"
pip install dist/*$VERSION*.whl
echo "## validate tests can run against installed code ###############################"
# filename needs to resolved independently as pip requires quoting and doesn't support
# wildcards when installing extra requirements
# (see: https://pip.pypa.io/en/stable/user_guide/#installing-from-wheels)
wheel_file=$(ls dist/*$VERSION*.whl)
pip install "${wheel_file}[test]"
pytest --disable-network
echo "## complete ####################################################################"