Skip to content

Commit

Permalink
Merge pull request #57 from common-workflow-language/py3
Browse files Browse the repository at this point in the history
allow for testing of py3 as well
  • Loading branch information
mr-c authored Feb 9, 2018
2 parents a1fb4c6 + 654895a commit a99e17e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ mypy3: ${PYSOURCES}
${MODULE}

release: FORCE
./release-test.sh
PYVER=2.7 ./release-test.sh
PYVER=3 ./release-test.sh
. testenv2/bin/activate && \
testenv2/src/${MODULE}/setup.py sdist bdist_wheel
. testenv2/bin/activate && \
Expand Down
27 changes: 14 additions & 13 deletions release-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,33 @@ repo=https://github.com/common-workflow-language/cwltest.git
run_tests="py.test --pyarg ${module}"
pipver=8.0.1 # minimum required version of pip
setupver=20.10.1 # minimum required version of setuptools
PYVER=${PYVER:=2.7}

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

export HEAD=`git rev-parse HEAD`
virtualenv testenv1
virtualenv testenv2
virtualenv testenv3
virtualenv testenv4
virtualenv testenv${PYVER}_1 -p python${PYVER}
virtualenv testenv${PYVER}_2 -p python${PYVER}
virtualenv testenv${PYVER}_3 -p python${PYVER}
virtualenv testenv${PYVER}_4 -p python${PYVER}

# First we test the head
source testenv1/bin/activate
rm testenv1/lib/python-wheels/setuptools* \
source testenv${PYVER}_1/bin/activate
rm testenv${PYVER}_1/lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
&& pip install setuptools==${setupver} wheel
make install-dependencies
make test
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
mkdir testenv1/not-${module}
mkdir testenv${PYVER}_1/not-${module}
# if there is a subdir named '${module}' py.test will execute tests
# there instead of the installed module's tests
pushd testenv1/not-${module}; ../bin/${run_tests}; popd
pushd testenv${PYVER}_1/not-${module}; ../bin/${run_tests}; popd


# Secondly we test via pip

cd testenv2
cd testenv${PYVER}_2
source bin/activate
rm lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
Expand All @@ -44,15 +45,15 @@ cd src/${package}
make install-dependencies
make dist
make test
cp dist/${package}*tar.gz ../../../testenv3/
cp dist/${package}*tar.gz ../../../testenv${PYVER}_3/
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
cd ../.. # no subdir named ${proj} here, safe for py.testing the installed module
bin/${run_tests}

# Is the distribution in testenv2 complete enough to build another
# Is the distribution in testenv${PYVER}_2 complete enough to build another
# functional distribution?

cd ../testenv3/
cd ../testenv${PYVER}_3/
source bin/activate
rm lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
Expand Down

0 comments on commit a99e17e

Please sign in to comment.