Skip to content

Commit

Permalink
Merge pull request #614 from slycordinator/shellcheck_fixes
Browse files Browse the repository at this point in the history
Fixes for shell scripts according to output from shellcheck
  • Loading branch information
edschofield committed Feb 21, 2024
2 parents bcced95 + 3a56f1f commit 6153844
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
9 changes: 5 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/sh
# XXX: TODO: we should make this include -e once tests pass
set -xuo pipefail
set -xu

DOCKER_IMAGE=jmadler/python-future-builder
# XXX: TODO: Perhaps this version shouldn't be hardcoded
version=0.18.4

docker build . -t $DOCKER_IMAGE
#docker push $DOCKER_IMAGE:latest
docker build . -t "$DOCKER_IMAGE"
#docker push "$DOCKER_IMAGE:latest"

for i in cp27-cp27m cp35-cp35m cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39; do
docker run -ti -v $(realpath dist):/root/python-future/dist $DOCKER_IMAGE /root/python-future/setup.sh $version $(basename $i)
docker run -ti -v "$(realpath dist)":/root/python-future/dist "$DOCKER_IMAGE" /root/python-future/setup.sh "$version" $(basename $i)
done

python setup.py sdist
Expand Down
1 change: 1 addition & 0 deletions lint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# TODO: Run under Python 2.7 and 3.7
flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics || true
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics || true
28 changes: 17 additions & 11 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
#!/bin/bash
#!/bin/sh

set -exo pipefail
set -ex

version=$1
pyabitag=$2

py="/opt/python/${pyabitag}/bin/python"
pytag=${pyabitag%-*}
pytag="${pytag//cp/py}"
$py -m pip install pytest unittest2
$py setup.py bdist_wheel --python-tag=$pytag
$py -m pip install dist/future-$version-$pytag-none-any.whl
pytag=$2

if [ "$pytag" = 'py33' ]; then
pip3 install virtualenv==16.2.0
fi

. /root/"$pytag"/bin/activate

if [ "$pytag" = 'py26' ]; then
pip install importlib
fi
pip install pytest unittest2
python setup.py bdist_wheel --python-tag="$pytag"
pip install "dist/future-$version-$pytag-none-any.whl"
# Ignore test failures for now
$py -m pytest tests/ || true
pytest tests/ || true

0 comments on commit 6153844

Please sign in to comment.