|
1 | 1 | #!/bin/bash |
2 | 2 | PYTHON_VERSIONS="cp27-cp27m cp35-cp35m cp36-cp36m" |
3 | 3 |
|
| 4 | +POETRY_PYTHON="cp36-cp36m" |
| 5 | +POETRY_VENV="/opt/python/poetry" |
| 6 | +echo "Create Poetry's virtualenv" |
| 7 | +/opt/python/${POETRY_PYTHON}/bin/pip install virtualenv |
| 8 | +/opt/python/${POETRY_PYTHON}/bin/virtualenv --python /opt/python/${POETRY_PYTHON}/bin/python ${POETRY_VENV} |
| 9 | +${POETRY_VENV}/bin/pip install poetry --pre |
| 10 | + |
| 11 | +RELEASE=$(sed -n "s/VERSION = '\(.*\)'/\1/p" /io/pendulum/version.py) |
| 12 | + |
4 | 13 | echo "Compile wheels" |
5 | 14 | for PYTHON in ${PYTHON_VERSIONS}; do |
6 | 15 | cd /io |
7 | | - /opt/python/${PYTHON}/bin/pip install -r wheels-requirements.txt |
8 | | - /opt/python/${PYTHON}/bin/pip install -r tests-requirements.txt |
9 | | - /opt/python/${PYTHON}/bin/python setup.py sdist --dist-dir wheelhouse --formats=gztar |
10 | | - /opt/python/${PYTHON}/bin/pip wheel --no-index --no-deps --wheel-dir wheelhouse wheelhouse/*.tar.gz |
| 16 | + /opt/python/${POETRY_PYTHON}/bin/virtualenv --python /opt/python/${PYTHON}/bin/python /opt/python/venv-${PYTHON} |
| 17 | + . /opt/python/venv-${PYTHON}/bin/activate |
| 18 | + ${POETRY_VENV}/bin/poetry install -v |
| 19 | + ${POETRY_VENV}/bin/poetry build -v |
| 20 | + mv dist/*-${RELEASE}-*.whl wheelhouse/ |
| 21 | + deactivate |
11 | 22 | cd - |
12 | 23 | done |
13 | 24 |
|
14 | 25 | echo "Bundle external shared libraries into the wheels" |
15 | | -for whl in /io/wheelhouse/*.whl; do |
| 26 | +for whl in /io/wheelhouse/pendulum-${RELEASE}-*.whl; do |
16 | 27 | auditwheel repair $whl -w /io/wheelhouse/ |
| 28 | + rm -f $whl |
17 | 29 | done |
18 | 30 |
|
19 | 31 | echo "Install packages and test" |
20 | 32 | for PYTHON in ${PYTHON_VERSIONS}; do |
21 | | - /opt/python/${PYTHON}/bin/pip install pendulum --no-index -f /io/wheelhouse |
| 33 | + . /opt/python/venv-${PYTHON}/bin/activate |
| 34 | + pip install pendulum==${RELEASE} --no-index --find-links /io/wheelhouse |
22 | 35 | find ./io/tests | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf |
23 | | - /opt/python/${PYTHON}/bin/py.test /io/tests |
| 36 | + pytest /io/tests |
24 | 37 | find ./io/tests | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf |
| 38 | + deactivate |
25 | 39 | done |
0 commit comments