This is an automated email from the ASF dual-hosted git repository.
kojiromike pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/master by this push:
new 171166180 AVRO-3832: [Python] Make Python test work with Docker (#2444)
171166180 is described below
commit 171166180b13469e550c181eaa11cfe95cbb703a
Author: Kousuke Saruta <[email protected]>
AuthorDate: Fri Aug 18 10:53:30 2023 +0900
AVRO-3832: [Python] Make Python test work with Docker (#2444)
* AVRO-3832: [Python] Make Python test work with Docker.
* Use contextlib.closing.
---
build.sh | 2 +-
lang/py/avro/test/gen_interop_data.py | 4 +++-
share/docker/Dockerfile | 2 ++
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/build.sh b/build.sh
index 0bd1e1880..09b02f8da 100755
--- a/build.sh
+++ b/build.sh
@@ -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
;;
diff --git a/lang/py/avro/test/gen_interop_data.py
b/lang/py/avro/test/gen_interop_data.py
index 1993b0128..1bde7ff87 100644
--- a/lang/py/avro/test/gen_interop_data.py
+++ b/lang/py/avro/test/gen_interop_data.py
@@ -23,6 +23,7 @@ import base64
import io
import json
import os
+from contextlib import closing
from pathlib import Path
from typing import IO, TextIO
@@ -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
diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile
index 2a1cf2b46..51e91eab8 100644
--- a/share/docker/Dockerfile
+++ b/share/docker/Dockerfile
@@ -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 \