Skip to content

Commit 55f8eeb

Browse files
committed
update release test
1 parent 1bfd7e2 commit 55f8eeb

File tree

5 files changed

+34
-35
lines changed

5 files changed

+34
-35
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ diff-cover.html: coverage.xml
139139
diff-cover $^ --html-report $@
140140

141141
## test : run the ${MODULE} test suite
142-
test: FORCE
143-
python setup.py test # --addopts "-n auto --dist=loadfile"
142+
test: dev
143+
pytest # --addopts "-n auto --dist=loadfile"
144144

145145
## testcov : run the ${MODULE} test suite and collect coverage
146146
testcov: $(pysources)
147-
python setup.py test --addopts "--cov ${MODULE}" # -n auto --dist=loadfile"
147+
pytest --cov ${MODULE} # -n auto --dist=loadfile"
148148

149149
sloccount.sc: ${PYSOURCES} Makefile
150150
sloccount --duplicates --wide --details $^ > $@

release-test.sh

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,41 @@ fi
1919
run_tests="bin/py.test --pyargs ${module}"
2020
pipver=20.3b1 # minimum required version of pip for Python 3.9
2121
setuptoolsver=41.1.0 # required for Python 3.9
22-
PYVER=${PYVER:=3}
22+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
23+
24+
rm -Rf testenv? || /bin/true
2325

24-
rm -Rf "testenv${PYVER}_"? || /bin/true
2526

2627
if [ "${RELEASE_SKIP}" != "head" ]
2728
then
28-
"python${PYVER}" -m venv "testenv${PYVER}_1"
29+
python3 -m venv testenv1
2930
# First we test the head
3031
# shellcheck source=/dev/null
31-
source "testenv${PYVER}_1/bin/activate"
32-
rm -f "testenv${PYVER}_1/lib/python-wheels/setuptools"*
33-
pip install --force-reinstall -U pip==${pipver}
34-
pip install setuptools==${setuptoolsver} wheel
35-
pip install pytest\<7 pytest-xdist -rrequirements.txt
32+
source testenv1/bin/activate
33+
rm -Rf testenv1/local
34+
rm -f testenv1/lib/python-wheels/setuptools* \
35+
&& pip install --force-reinstall -U pip==${pipver} \
36+
&& pip install setuptools==${setuptoolsver} wheel
37+
pip install -rtest-requirements.txt
3638
make test
37-
pip uninstall -y ${package} || true; pip uninstall -y ${package} \
38-
|| true; make install
39-
mkdir "testenv${PYVER}_1/not-${module}"
39+
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
40+
mkdir testenv1/not-${module}
4041
# if there is a subdir named '${module}' py.test will execute tests
4142
# there instead of the installed module's tests
42-
43-
pushd "testenv${PYVER}_1/not-${module}"
43+
pushd testenv1/not-${module}
4444
# shellcheck disable=SC2086
4545
../${run_tests}; popd
4646
fi
4747

48-
49-
"python${PYVER}" -m venv "testenv${PYVER}_2"
50-
"python${PYVER}" -m venv "testenv${PYVER}_3"
51-
"python${PYVER}" -m venv "testenv${PYVER}_4"
52-
"python${PYVER}" -m venv "testenv${PYVER}_5"
53-
48+
python3 -m venv testenv2
49+
python3 -m venv testenv3
50+
python3 -m venv testenv4
51+
python3 -m venv testenv5
52+
rm -Rf testenv[2345]/local
5453

5554
# Secondly we test via pip
5655

57-
pushd "testenv${PYVER}_2"
56+
pushd testenv2
5857
# shellcheck source=/dev/null
5958
source bin/activate
6059
rm -f lib/python-wheels/setuptools* \
@@ -63,28 +62,29 @@ rm -f lib/python-wheels/setuptools* \
6362
# The following can fail if you haven't pushed your commits to ${repo}
6463
pip install -e "git+${repo}@${HEAD}#egg=${package}"
6564
pushd src/${package}
66-
pip install pytest\<7 pytest-xdist
65+
pip install -rtest-requirements.txt
6766
make dist
6867
make test
69-
cp dist/${package}*tar.gz "../../../testenv${PYVER}_3/"
70-
cp dist/${module}*whl "../../../testenv${PYVER}_4/"
68+
cp dist/${package}*tar.gz ../../../testenv3/
69+
cp dist/${module}*whl ../../../testenv4/
7170
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
7271
popd # ../.. no subdir named ${proj} here, safe for py.testing the installed module
7372
# shellcheck disable=SC2086
7473
${run_tests}
7574
popd
7675

77-
# Is the source distribution in testenv${PYVER}_2 complete enough to build
76+
# Is the source distribution in testenv2 complete enough to build
7877
# another functional distribution?
7978

80-
pushd "testenv${PYVER}_3/"
79+
pushd testenv3/
8180
# shellcheck source=/dev/null
8281
source bin/activate
8382
rm -f lib/python-wheels/setuptools* \
8483
&& pip install --force-reinstall -U pip==${pipver} \
8584
&& pip install setuptools==${setuptoolsver} wheel
86-
pip install ${package}*tar.gz
87-
pip install pytest\<7 pytest-xdist
85+
package_tar=$(find . -name "${package}*tar.gz")
86+
pip install "-r${DIR}/test-requirements.txt"
87+
pip install "${package_tar}"
8888
mkdir out
8989
tar --extract --directory=out -z -f ${package}*.tar.gz
9090
pushd out/${package}*
@@ -98,16 +98,16 @@ pushd ../not-${module}
9898
popd
9999
popd
100100

101-
# Is the wheel in testenv${PYVER}_2 installable and will it pass the tests
101+
# Is the wheel in testenv2 installable and will it pass the tests
102102

103-
pushd "testenv${PYVER}_4/"
103+
pushd testenv4/
104104
# shellcheck source=/dev/null
105105
source bin/activate
106106
rm -f lib/python-wheels/setuptools* \
107107
&& pip install --force-reinstall -U pip==${pipver} \
108108
&& pip install setuptools==${setuptoolsver} wheel
109109
pip install ${module}*.whl
110-
pip install pytest\<7 pytest-xdist
110+
pip install "-r${DIR}/test-requirements.txt"
111111
mkdir not-${module}
112112
pushd not-${module}
113113
# shellcheck disable=SC2086

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
ruamel.yaml>=0.12.4,<0.17.10
21
requests
32
schema-salad >= 7, < 8
43
typing_extensions

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
include_package_data=True,
1919
python_requires=">=3.6",
2020
install_requires=[
21-
"ruamel.yaml>=0.12.4,<0.17.10",
2221
"requests",
2322
"schema-salad >= 7, < 8",
2423
"typing_extensions",

test-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pytest < 7
22
pytest-cov
3+
pytest-xdist

0 commit comments

Comments
 (0)