Skip to content

Fixes for shell scripts according to output from shellcheck #614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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