Skip to content
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

AVRO-3952: Auto-install tox #2853

Merged
merged 1 commit into from
Apr 16, 2024
Merged
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
18 changes: 15 additions & 3 deletions lang/py/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ doc() {
local doc_dir
local version=$(cat ../../share/VERSION.txt)
doc_dir="../../build/avro-doc-$version/api/py"
python3 -m tox -e docs
_tox -e docs
mkdir -p "$doc_dir"
cp -a docs/build/* "$doc_dir"
}
Expand All @@ -72,11 +72,11 @@ interop-data-test() {
}

lint() {
python3 -m tox -e lint
_tox -e lint
}

test_() {
TOX_SKIP_ENV=lint python3 -m tox --skip-missing-interpreters
TOX_SKIP_ENV=lint _tox --skip-missing-interpreters
}

main() {
Expand All @@ -95,4 +95,16 @@ main() {
done
}

_tox() {
if command -v tox 2> /dev/null; then
tox "$@"
else
echo 'Your experience will improve if you install tox'
virtualenv="$(mktemp -d)"
python3 -m venv "$virtualenv"
"$virtualenv/bin/python3" -m pip install tox
"$virtualenv/bin/tox" "$@"
fi
}

main "$@"
Loading