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 0552c67 AVRO-2914: Remove Python 2 Support (#943)
0552c67 is described below
commit 0552c674637dd15b8751ed5181387cdbd81480d5
Author: Michael A. Smith <[email protected]>
AuthorDate: Sun Aug 16 10:32:02 2020 -0400
AVRO-2914: Remove Python 2 Support (#943)
Per [the
vote](https://mail-archives.apache.org/mod_mbox/avro-dev/202008.mbox/%3cjira.13322769.1597417392000.221046.1597417440...@atlassian.jira%3e)
dropping Python 2 support as of this commit.
---
BUILD.md | 1 -
doc/src/content/xdocs/gettingstartedpython.xml | 8 ++++----
lang/py/avro/__init__.py | 4 +++-
lang/py/avro/codecs.py | 4 +++-
lang/py/avro/constants.py | 4 +++-
lang/py/avro/datafile.py | 4 +++-
lang/py/avro/errors.py | 4 +++-
lang/py/avro/io.py | 4 +++-
lang/py/avro/ipc.py | 4 +++-
lang/py/avro/protocol.py | 4 +++-
lang/py/avro/schema.py | 6 +++---
lang/py/avro/test/__init__.py | 4 +++-
lang/py/avro/test/av_bench.py | 4 +++-
lang/py/avro/test/gen_interop_data.py | 4 +++-
lang/py/avro/test/mock_tether_parent.py | 4 +++-
lang/py/avro/test/sample_http_client.py | 4 +++-
lang/py/avro/test/sample_http_server.py | 4 +++-
lang/py/avro/test/test_datafile.py | 4 +++-
lang/py/avro/test/test_datafile_interop.py | 4 +++-
lang/py/avro/test/test_init.py | 4 +++-
lang/py/avro/test/test_io.py | 4 +++-
lang/py/avro/test/test_ipc.py | 4 +++-
lang/py/avro/test/test_protocol.py | 4 +++-
lang/py/avro/test/test_schema.py | 4 +++-
lang/py/avro/test/test_script.py | 4 +++-
lang/py/avro/test/test_tether_task.py | 4 +++-
lang/py/avro/test/test_tether_task_runner.py | 4 +++-
lang/py/avro/test/test_tether_word_count.py | 4 +++-
lang/py/avro/test/txsample_http_client.py | 4 +++-
lang/py/avro/test/txsample_http_server.py | 4 +++-
lang/py/avro/test/word_count_task.py | 4 +++-
lang/py/avro/tether/__init__.py | 4 +++-
lang/py/avro/tether/tether_task.py | 4 +++-
lang/py/avro/tether/tether_task_runner.py | 4 +++-
lang/py/avro/tether/util.py | 4 +++-
lang/py/avro/timezones.py | 4 +++-
lang/py/avro/tool.py | 4 +++-
lang/py/avro/txipc.py | 4 +++-
lang/py/build.sh | 2 +-
lang/py/scripts/avro | 2 +-
lang/py/setup.cfg | 3 +--
lang/py/setup.py | 4 +++-
lang/py/tox.ini | 1 -
lang/py3/avro/schemanormalization.py | 2 +-
lang/py3/avro/tests/test_normalization.py | 2 +-
lang/py3/setup.py | 2 +-
share/docker/Dockerfile | 10 +---------
share/test/interop/bin/test_rpc_interop.sh | 12 +++++-------
48 files changed, 127 insertions(+), 68 deletions(-)
diff --git a/BUILD.md b/BUILD.md
index 0ed3395..d5febea 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -6,7 +6,6 @@ The following packages must be installed before Avro can be
built:
- Java: JDK 1.8, Maven 2 or better, protobuf-compile
- PHP: php5, phpunit, php5-gmp
- - Python 2: 2.7 or greater, python-setuptools for dist target
- Python 3: 3.5 or greater
- C: gcc, cmake, asciidoc, source-highlight, Jansson, pkg-config
- C++: cmake 3.7.2 or greater, g++, flex, bison, libboost-dev
diff --git a/doc/src/content/xdocs/gettingstartedpython.xml
b/doc/src/content/xdocs/gettingstartedpython.xml
index b3439f8..84fb838 100644
--- a/doc/src/content/xdocs/gettingstartedpython.xml
+++ b/doc/src/content/xdocs/gettingstartedpython.xml
@@ -38,7 +38,7 @@
<p>
A package called "avro-python3" had been provided to support
Python 3 previously, but the codebase was consolidated into
- the "avro" package and that supports both Python 2 and 3 now.
+ the "avro" package that supports Python 3 now.
The avro-python3 package will be removed in the near future,
so users should use the "avro" package instead.
@@ -70,8 +70,8 @@ $ python3 -m pip install avro
<source>
$ tar xvf avro-&AvroVersion;.tar.gz
$ cd avro-&AvroVersion;
-$ python setup.py install
-$ python
+$ python3 setup.py install
+$ python3
>>> import avro # should not raise ImportError
</source>
<p>
@@ -81,7 +81,7 @@ $ python
<source>
$ cd lang/py/
$ python3 -m pip install -e .
-$ python
+$ python3
</source>
</section>
diff --git a/lang/py/avro/__init__.py b/lang/py/avro/__init__.py
index 0fa46c5..b328aad 100644
--- a/lang/py/avro/__init__.py
+++ b/lang/py/avro/__init__.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/codecs.py b/lang/py/avro/codecs.py
index 2f3a3b5..d10d20c 100644
--- a/lang/py/avro/codecs.py
+++ b/lang/py/avro/codecs.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/constants.py b/lang/py/avro/constants.py
index 2197201..202a498 100644
--- a/lang/py/avro/constants.py
+++ b/lang/py/avro/constants.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/datafile.py b/lang/py/avro/datafile.py
index 3b41660..05deab6 100644
--- a/lang/py/avro/datafile.py
+++ b/lang/py/avro/datafile.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/errors.py b/lang/py/avro/errors.py
index 3e54bb1..4d5b7d9 100644
--- a/lang/py/avro/errors.py
+++ b/lang/py/avro/errors.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/io.py b/lang/py/avro/io.py
index 3ae01d0..d420c20 100644
--- a/lang/py/avro/io.py
+++ b/lang/py/avro/io.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/ipc.py b/lang/py/avro/ipc.py
index a52a5af..c2cc852 100644
--- a/lang/py/avro/ipc.py
+++ b/lang/py/avro/ipc.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/protocol.py b/lang/py/avro/protocol.py
index 09ecde2..279735c 100644
--- a/lang/py/avro/protocol.py
+++ b/lang/py/avro/protocol.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/schema.py b/lang/py/avro/schema.py
index 913d798..de66894 100644
--- a/lang/py/avro/schema.py
+++ b/lang/py/avro/schema.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
@@ -1119,8 +1121,6 @@ def parse(json_string, validate_enum_symbols=True):
msg = 'Error parsing JSON: {}, error = {}'.format(json_string, e)
new_exception = avro.errors.SchemaParseException(msg)
traceback = sys.exc_info()[2]
- if not hasattr(new_exception, 'with_traceback'):
- raise (new_exception, None, traceback) # Python 2 syntax
raise new_exception.with_traceback(traceback)
# Initialize the names object
diff --git a/lang/py/avro/test/__init__.py b/lang/py/avro/test/__init__.py
index a2a5bef..ea19c54 100644
--- a/lang/py/avro/test/__init__.py
+++ b/lang/py/avro/test/__init__.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/av_bench.py b/lang/py/avro/test/av_bench.py
index bc94ae4..936ec35 100644
--- a/lang/py/avro/test/av_bench.py
+++ b/lang/py/avro/test/av_bench.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/gen_interop_data.py
b/lang/py/avro/test/gen_interop_data.py
index 1bd5c76..802c4b0 100644
--- a/lang/py/avro/test/gen_interop_data.py
+++ b/lang/py/avro/test/gen_interop_data.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/mock_tether_parent.py
b/lang/py/avro/test/mock_tether_parent.py
index cc33bca..60dcaf1 100644
--- a/lang/py/avro/test/mock_tether_parent.py
+++ b/lang/py/avro/test/mock_tether_parent.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/sample_http_client.py
b/lang/py/avro/test/sample_http_client.py
index 819a9d3..6bc6902 100644
--- a/lang/py/avro/test/sample_http_client.py
+++ b/lang/py/avro/test/sample_http_client.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/sample_http_server.py
b/lang/py/avro/test/sample_http_server.py
index 387f907..2778173 100644
--- a/lang/py/avro/test/sample_http_server.py
+++ b/lang/py/avro/test/sample_http_server.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/test_datafile.py
b/lang/py/avro/test/test_datafile.py
index 174acb7..a823d58 100644
--- a/lang/py/avro/test/test_datafile.py
+++ b/lang/py/avro/test/test_datafile.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/test_datafile_interop.py
b/lang/py/avro/test/test_datafile_interop.py
index 2a9952a..76e8f5d 100644
--- a/lang/py/avro/test/test_datafile_interop.py
+++ b/lang/py/avro/test/test_datafile_interop.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/test_init.py b/lang/py/avro/test/test_init.py
index f41297f..7151a52 100644
--- a/lang/py/avro/test/test_init.py
+++ b/lang/py/avro/test/test_init.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/test_io.py b/lang/py/avro/test/test_io.py
index bc3b3c6..464d2ad 100644
--- a/lang/py/avro/test/test_io.py
+++ b/lang/py/avro/test/test_io.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/test_ipc.py b/lang/py/avro/test/test_ipc.py
index 1035617..4ae6bd7 100644
--- a/lang/py/avro/test/test_ipc.py
+++ b/lang/py/avro/test/test_ipc.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/test_protocol.py
b/lang/py/avro/test/test_protocol.py
index 0e1b2c1..0916a9b 100644
--- a/lang/py/avro/test/test_protocol.py
+++ b/lang/py/avro/test/test_protocol.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/test_schema.py b/lang/py/avro/test/test_schema.py
index 472ef41..6988801 100644
--- a/lang/py/avro/test/test_schema.py
+++ b/lang/py/avro/test/test_schema.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/test_script.py b/lang/py/avro/test/test_script.py
index def98ef..7f2d16e 100644
--- a/lang/py/avro/test/test_script.py
+++ b/lang/py/avro/test/test_script.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/test_tether_task.py
b/lang/py/avro/test/test_tether_task.py
index a9567f3..47ff6bb 100644
--- a/lang/py/avro/test/test_tether_task.py
+++ b/lang/py/avro/test/test_tether_task.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/test_tether_task_runner.py
b/lang/py/avro/test/test_tether_task_runner.py
index 90e01cb..5e7a0d8 100644
--- a/lang/py/avro/test/test_tether_task_runner.py
+++ b/lang/py/avro/test/test_tether_task_runner.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/test_tether_word_count.py
b/lang/py/avro/test/test_tether_word_count.py
index c2ec47c..becee00 100644
--- a/lang/py/avro/test/test_tether_word_count.py
+++ b/lang/py/avro/test/test_tether_word_count.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/txsample_http_client.py
b/lang/py/avro/test/txsample_http_client.py
index ef229ec..891d9de 100644
--- a/lang/py/avro/test/txsample_http_client.py
+++ b/lang/py/avro/test/txsample_http_client.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/txsample_http_server.py
b/lang/py/avro/test/txsample_http_server.py
index 67dedd6..3535e1c 100644
--- a/lang/py/avro/test/txsample_http_server.py
+++ b/lang/py/avro/test/txsample_http_server.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/test/word_count_task.py
b/lang/py/avro/test/word_count_task.py
index 34abaab..19c9b3d 100644
--- a/lang/py/avro/test/word_count_task.py
+++ b/lang/py/avro/test/word_count_task.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/tether/__init__.py b/lang/py/avro/tether/__init__.py
index c60edf9..6c61872 100644
--- a/lang/py/avro/tether/__init__.py
+++ b/lang/py/avro/tether/__init__.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/tether/tether_task.py
b/lang/py/avro/tether/tether_task.py
index 465b295..d4902d0 100644
--- a/lang/py/avro/tether/tether_task.py
+++ b/lang/py/avro/tether/tether_task.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/tether/tether_task_runner.py
b/lang/py/avro/tether/tether_task_runner.py
index d5d926c..f5f5767 100644
--- a/lang/py/avro/tether/tether_task_runner.py
+++ b/lang/py/avro/tether/tether_task_runner.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/tether/util.py b/lang/py/avro/tether/util.py
index 9bd4148..d8c3058 100644
--- a/lang/py/avro/tether/util.py
+++ b/lang/py/avro/tether/util.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/timezones.py b/lang/py/avro/timezones.py
index a6622c9..934965a 100644
--- a/lang/py/avro/timezones.py
+++ b/lang/py/avro/timezones.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/tool.py b/lang/py/avro/tool.py
index e64c674..2bcf5c3 100644
--- a/lang/py/avro/tool.py
+++ b/lang/py/avro/tool.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/avro/txipc.py b/lang/py/avro/txipc.py
index 6e597b9..83308ee 100644
--- a/lang/py/avro/txipc.py
+++ b/lang/py/avro/txipc.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/build.sh b/lang/py/build.sh
index 6121606..b8cc03b 100755
--- a/lang/py/build.sh
+++ b/lang/py/build.sh
@@ -47,7 +47,7 @@ interop-data-generate() {
interop-data-test() {
mkdir -p avro/test/interop ../../build/interop/data
cp -r ../../build/interop/data avro/test/interop
- python -m unittest avro.test.test_datafile_interop
+ python3 -m unittest avro.test.test_datafile_interop
}
lint() {
diff --git a/lang/py/scripts/avro b/lang/py/scripts/avro
index 6a069ee..29a2ffe 100755
--- a/lang/py/scripts/avro
+++ b/lang/py/scripts/avro
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
diff --git a/lang/py/setup.cfg b/lang/py/setup.cfg
index 0cc0344..de4657b 100644
--- a/lang/py/setup.cfg
+++ b/lang/py/setup.cfg
@@ -31,7 +31,6 @@ url = https://avro.apache.org/
license = Apache License 2.0
classifiers =
License :: OSI Approved :: Apache Software License
- Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
@@ -51,7 +50,7 @@ install_requires =
zip_safe = true
scripts =
scripts/avro
-python_requires = >=2.7
+python_requires = >=3.5
[options.package_data]
avro =
diff --git a/lang/py/setup.py b/lang/py/setup.py
index d3aa106..66ae91b 100755
--- a/lang/py/setup.py
+++ b/lang/py/setup.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# -*- mode: python -*-
+# -*- coding: utf-8 -*-
##
# Licensed to the Apache Software Foundation (ASF) under one
diff --git a/lang/py/tox.ini b/lang/py/tox.ini
index 68a033c..24f71a1 100644
--- a/lang/py/tox.ini
+++ b/lang/py/tox.ini
@@ -20,7 +20,6 @@ envlist =
# Fastest checks first
lint
typechecks
- py27
py35
py36
py37
diff --git a/lang/py3/avro/schemanormalization.py
b/lang/py3/avro/schemanormalization.py
index e0ce66e..46ec1d7 100644
--- a/lang/py3/avro/schemanormalization.py
+++ b/lang/py3/avro/schemanormalization.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- mode: python -*-
# -*- coding: utf-8 -*-
diff --git a/lang/py3/avro/tests/test_normalization.py
b/lang/py3/avro/tests/test_normalization.py
index bb9d382..4c3b25e 100644
--- a/lang/py3/avro/tests/test_normalization.py
+++ b/lang/py3/avro/tests/test_normalization.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- mode: python -*-
# -*- coding: utf-8 -*-
diff --git a/lang/py3/setup.py b/lang/py3/setup.py
index 1e60195..e982323 100755
--- a/lang/py3/setup.py
+++ b/lang/py3/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- mode: python -*-
# -*- coding: utf-8 -*-
diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile
index f26ee39..6cca331 100644
--- a/share/docker/Dockerfile
+++ b/share/docker/Dockerfile
@@ -53,11 +53,7 @@ RUN apt-get -qqy update \
mypy \
openjdk-8-jdk \
perl \
- python \
- python-pip \
- python-setuptools \
- python-snappy \
- python-wheel \
+ python3 \
python3-pip \
python3-setuptools \
python3-snappy \
@@ -142,10 +138,6 @@ RUN curl -sSL https://cpanmin.us \
# Install Python packages
ENV PIP_NO_CACHE_DIR=off
-# Install Python2 packages
-RUN python2 -m pip install --upgrade pip setuptools wheel \
- && python2 -m pip install zstandard
-
# Install Python3 packages
RUN python3 -m pip install --upgrade pip setuptools wheel \
&& python3 -m pip install tox zstandard
diff --git a/share/test/interop/bin/test_rpc_interop.sh
b/share/test/interop/bin/test_rpc_interop.sh
index 7ea16b2..9df5a64 100755
--- a/share/test/interop/bin/test_rpc_interop.sh
+++ b/share/test/interop/bin/test_rpc_interop.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@@ -25,10 +25,6 @@ java_tool() {
java -jar "lang/java/tools/target/avro-tools-$VERSION.jar" "$@"
}
-py_tool() {
- PYTHONPATH=lang/py python2 -m avro.tool "$@"
-}
-
py3_tool() {
PYTHONPATH=lang/py3 python3 -m avro.tool "$@"
}
@@ -37,6 +33,8 @@ ruby_tool() {
ruby -Ilang/ruby/lib lang/ruby/test/tool.rb "$@"
}
+tools=( {java,py3,ruby}_tool )
+
proto=share/test/schemas/simple.avpr
portfile="/tmp/interop_$$"
@@ -50,12 +48,12 @@ cleanup() {
trap 'cleanup' EXIT
-for server in {java,py,py3,ruby}_tool; do
+for server in "${tools[@]}"; do
for msgDir in share/test/interop/rpc/*; do
msg="${msgDir##*/}"
for c in "$msgDir/"*; do
echo "TEST: $c"
- for client in {java,py,py3,ruby}_tool; do
+ for client in "${tools[@]}"; do
rm -rf "$portfile"
"$server" rpcreceive 'http://127.0.0.1:0/' "$proto" "$msg" \
-file "$c/response.avro" > "$portfile" &