Skip to content

Commit

Permalink
AVRO-3832: [Python] Make Python test work with Docker (apache#2444)
Browse files Browse the repository at this point in the history
* AVRO-3832: [Python] Make Python test work with Docker.

* Use contextlib.closing.
  • Loading branch information
sarutak authored and Ranbir Kumar committed May 13, 2024
1 parent 67a5a95 commit 370fcaa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ do

docker-test)
tar -cf- share/docker/Dockerfile $DOCKER_EXTRA_CONTEXT |
docker build -t avro-test -f share/docker/Dockerfile -
DOCKER_BUILDKIT=1 docker build -t avro-test -f share/docker/Dockerfile -
docker run --rm -v "${PWD}:/avro${DOCKER_MOUNT_FLAG}" --env "JAVA=${JAVA:-8}" avro-test /avro/share/docker/run-tests.sh
;;

Expand Down
4 changes: 3 additions & 1 deletion lang/py/avro/test/gen_interop_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import io
import json
import os
from contextlib import closing
from pathlib import Path
from typing import IO, TextIO

Expand Down Expand Up @@ -93,7 +94,8 @@ def _parse_args() -> argparse.Namespace:

def main() -> int:
args = _parse_args()
generate(args.schema_path, args.output_path)
with closing(args.output_path) as op:
generate(args.schema_path, op)
return 0


Expand Down
2 changes: 2 additions & 0 deletions share/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ RUN apt-get -qqy update \
python3-wheel \
python3.10 \
python3.11 \
python3.11-dev \
python3.7 \
python3.7-distutils \
python3.8 \
python3.9 \
source-highlight \
Expand Down

0 comments on commit 370fcaa

Please sign in to comment.