From 68d00d95d9447956d61b75d2b52b7755d6456066 Mon Sep 17 00:00:00 2001 From: "Michael A. Smith" Date: Fri, 21 Jul 2023 15:05:30 -0400 Subject: [PATCH] AVRO-3808: Drop Python 3.6, Update Pypy (#2373) * AVRO-3808: Drop Python 3.6 * AVRO-3808 Test with Pypy 3.8-3.10 --- .github/workflows/test-lang-py.yml | 10 ++++++---- lang/py/setup.cfg | 3 +-- lang/py/tox.ini | 5 +++-- share/docker/Dockerfile | 23 +++++++++++++++++++---- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-lang-py.yml b/.github/workflows/test-lang-py.yml index 137a6b8c071..8358d37e430 100644 --- a/.github/workflows/test-lang-py.yml +++ b/.github/workflows/test-lang-py.yml @@ -45,9 +45,10 @@ jobs: - '3.9' - '3.8' - '3.7' - - '3.6' - 'pypy-3.7' - - 'pypy-3.6' + - 'pypy-3.8' + - 'pypy-3.9' + - 'pypy-3.10' steps: - uses: actions/checkout@v3 @@ -92,9 +93,10 @@ jobs: - '3.9' - '3.8' - '3.7' - - '3.6' - 'pypy-3.7' - - 'pypy-3.6' + - 'pypy-3.8' + - 'pypy-3.9' + - 'pypy-3.10' steps: - uses: actions/checkout@v3 diff --git a/lang/py/setup.cfg b/lang/py/setup.cfg index d6d910005b0..5b2a6c78080 100644 --- a/lang/py/setup.cfg +++ b/lang/py/setup.cfg @@ -33,7 +33,6 @@ license_files = avro/LICENSE license = Apache License 2.0 classifiers = License :: OSI Approved :: Apache Software License - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -57,7 +56,7 @@ include_package_data = true install_requires = typing-extensions;python_version<"3.8" zip_safe = true -python_requires = >=3.6 +python_requires = >=3.7 [options.entry_points] console_scripts = diff --git a/lang/py/tox.ini b/lang/py/tox.ini index b02678ce8c1..38c5e6d8350 100644 --- a/lang/py/tox.ini +++ b/lang/py/tox.ini @@ -21,14 +21,15 @@ envlist = docs lint typechecks - py36 py37 py38 py39 py310 py311 - pypy3.6 pypy3.7 + pypy3.8 + pypy3.9 + pypy3.10 [coverage:run] diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile index c43b1942d76..2a1cf2b46c2 100644 --- a/share/docker/Dockerfile +++ b/share/docker/Dockerfile @@ -67,7 +67,6 @@ RUN apt-get -qqy update \ python3-wheel \ python3.10 \ python3.11 \ - python3.6 \ python3.7 \ python3.8 \ python3.9 \ @@ -175,10 +174,26 @@ RUN curl -sSL https://cpanmin.us \ Module::Install::Repository \ && rm -rf .cpanm -# Install Python packages -ENV PIP_NO_CACHE_DIR=off +# Install Python3 +ENV PATH="${PATH}:/opt/pypy3.8/bin:/opt/pypy3.9/bin:/opt/pypy3.10/bin" \ + PIP_NO_CACHE_DIR=off + +# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope +ARG BUILDARCH +RUN case "${BUILDARCH:?}" in \ + arm64) pypyarch=aarch64;; \ + *) pypyarch=linux64;; \ + esac \ + && cd /opt \ + && for url in https://downloads.python.org/pypy/pypy3.8-v7.3.11-"$pypyarch".tar.bz2 \ + https://downloads.python.org/pypy/pypy3.9-v7.3.12-"$pypyarch".tar.bz2 \ + https://downloads.python.org/pypy/pypy3.10-v7.3.12-"$pypyarch".tar.bz2; \ + do curl -fsSL "$url" | tar -xvjpf -; \ + done \ + && ln -s pypy3.8* pypy3.8 \ + && ln -s pypy3.9* pypy3.9 \ + && ln -s pypy3.10* pypy3.10 -# Install Python3 packages RUN python3 -m pip install --upgrade pip setuptools wheel \ && python3 -m pip install tox zstandard