Skip to content

Commit

Permalink
Merge pull request #58 from common-workflow-language/split_wheel
Browse files Browse the repository at this point in the history
Split wheel into py2 & py3
  • Loading branch information
mr-c authored Feb 9, 2018
2 parents a99e17e + ab93b5d commit ca22197
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 19 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ install: FORCE
dist: dist/${MODULE}-$(VERSION).tar.gz

dist/${MODULE}-$(VERSION).tar.gz: $(SOURCES)
./setup.py sdist
./setup.py sdist bdist_wheel

## clean : clean up all temporary / machine-generated files
clean: FORCE
Expand Down Expand Up @@ -170,11 +170,12 @@ mypy3: ${PYSOURCES}
release: FORCE
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 && \
. testenv2.7_2/bin/activate && \
testenv2.7_2/src/${MODULE}/setup.py sdist bdist_wheel
. testenv2.7_2/bin/activate && \
pip install twine && \
twine upload testenv2/src/${MODULE}/dist/* && \
twine upload testenv2.7_2/src/${MODULE}/dist/* \
testenv3_2/src/${MODULE}/dist/*whl && \
git tag ${VERSION} && git push --tags

FORCE:
32 changes: 25 additions & 7 deletions release-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ 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}
virtualenv testenv${PYVER}_5 -p python${PYVER}

# First we test the head
source testenv${PYVER}_1/bin/activate
Expand All @@ -35,25 +36,27 @@ pushd testenv${PYVER}_1/not-${module}; ../bin/${run_tests}; popd

# Secondly we test via pip

cd testenv${PYVER}_2
pushd testenv${PYVER}_2
source bin/activate
rm lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
&& pip install setuptools==${setupver} wheel
pip install -e git+${repo}@${HEAD}#egg=${package}
cd src/${package}
pushd src/${package}
make install-dependencies
make dist
make test
cp dist/${package}*tar.gz ../../../testenv${PYVER}_3/
cp dist/${package}*whl ../../../testenv${PYVER}_4/
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
popd # ../.. no subdir named ${proj} here, safe for py.testing the installed module
bin/${run_tests}
popd

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

cd ../testenv${PYVER}_3/
pushd testenv${PYVER}_3/
source bin/activate
rm lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
Expand All @@ -62,9 +65,24 @@ pip install ${package}*tar.gz
pip install pytest
mkdir out
tar --extract --directory=out -z -f ${package}*.tar.gz
cd out/${package}*
pushd out/${package}*
make dist
make test
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
mkdir ../not-${module}
pushd ../not-${module} ; ../../bin/${run_tests}; popd
popd
popd

# Is the wheel in testenv${PYVER}_2 installable and will it pass the tests

pushd testenv${PYVER}_4/
source bin/activate
rm lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
&& pip install setuptools==${setupver} wheel
pip install ${package}*.whl
pip install pytest
mkdir not-${module}
pushd not-${module} ; ../bin/${run_tests}; popd
popd
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ignore = E124,E128,E129,E201,E202,E225,E226,E231,E265,E271,E302,E303,F401,E402,E
[easy_install]

[bdist_wheel]
universal = 1
universal = 0

[tool:pytest]
testpaths = tests
Expand Down
9 changes: 3 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []

if sys.version_info.major == 2:
install_requires.extend(['futures >= 3.0.5', 'subprocess32'])

if sys.version_info[:2] < (3, 5):
install_requires.append('typing >= 3.5.2')

setup(name='cwltest',
version='1.0',
description='Common workflow language testing framework',
Expand All @@ -52,4 +46,7 @@
},
zip_safe=True,
cmdclass={'egg_info': tagger},
extras_require={':python_version<"3"': [
'futures >= 3.0.5', 'subprocess32'],
':python_version<"3.5"': ['typing >= 3.5.2'] }
)

0 comments on commit ca22197

Please sign in to comment.