Drop support for EOL Python 3.6

This commit is contained in:
Hugo van Kemenade 2021-10-15 13:07:53 +03:00
parent 862be7cbcd
commit 716a0baf74
12 changed files with 50 additions and 75 deletions

View File

@ -13,7 +13,7 @@ environment:
- PYTHON: C:/Python39
ARCHITECTURE: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- PYTHON: C:/Python36-x64
- PYTHON: C:/Python37-x64
ARCHITECTURE: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017

View File

@ -18,12 +18,8 @@ jobs:
alpine,
amazon-2-amd64,
arch,
centos-7-amd64,
centos-8-amd64,
centos-stream-8-amd64,
debian-10-buster-x86,
fedora-34-amd64,
ubuntu-18.04-bionic-amd64,
ubuntu-20.04-focal-amd64,
]
dockerTag: [main]

View File

@ -3,7 +3,7 @@ repos:
rev: 911470a610e47d9da5ea938b0887c3df62819b85 # frozen: 21.9b0
hooks:
- id: black
args: ["--target-version", "py36"]
args: ["--target-version", "py37"]
# Only .py files, until https://github.com/psf/black/issues/402 resolved
files: \.py$
types: []

View File

@ -121,5 +121,5 @@ lint:
.PHONY: lint-fix
lint-fix:
black --target-version py36 .
black --target-version py37 .
isort .

View File

@ -1,7 +1,6 @@
import io
import os
import shutil
import sys
import tempfile
import pytest
@ -782,9 +781,6 @@ class TestImage:
34665: 196,
}
@pytest.mark.skipif(
sys.version_info < (3, 7), reason="Python 3.7 or greater required"
)
def test_categories_deprecation(self):
with pytest.warns(DeprecationWarning):
assert hopper().category == 0

View File

@ -18,7 +18,9 @@ Pillow supports these Python versions.
+----------------------+-----+-----+-----+-----+-----+-----+-----+-----+
| Python |3.10 | 3.9 | 3.8 | 3.7 | 3.6 | 3.5 | 3.4 | 2.7 |
+======================+=====+=====+=====+=====+=====+=====+=====+=====+
| Pillow >= 8.3.2 | Yes | Yes | Yes | Yes | Yes | | | |
| Pillow >= 9.0 | Yes | Yes | Yes | Yes | | | | |
+----------------------+-----+-----+-----+-----+-----+-----+-----+-----+
| Pillow 8.3.2 - 8.4 | Yes | Yes | Yes | Yes | Yes | | | |
+----------------------+-----+-----+-----+-----+-----+-----+-----+-----+
| Pillow 8.0 - 8.3.1 | | Yes | Yes | Yes | Yes | | | |
+----------------------+-----+-----+-----+-----+-----+-----+-----+-----+
@ -443,40 +445,32 @@ Continuous Integration Targets
These platforms are built and tested for every change.
+----------------------------------+---------------------------------+---------------------+
| Operating system | Tested Python versions | Tested architecture |
+==================================+=================================+=====================+
| Alpine | 3.9 | x86-64 |
+----------------------------------+---------------------------------+---------------------+
| Amazon Linux 2 | 3.7 | x86-64 |
+----------------------------------+---------------------------------+---------------------+
| Arch | 3.9 | x86-64 |
+----------------------------------+---------------------------------+---------------------+
| CentOS 7 | 3.6 | x86-64 |
+----------------------------------+---------------------------------+---------------------+
| CentOS 8 | 3.6 | x86-64 |
+----------------------------------+---------------------------------+---------------------+
| CentOS Stream 8 | 3.6 | x86-64 |
+----------------------------------+---------------------------------+---------------------+
| Debian 10 Buster | 3.7 | x86 |
+----------------------------------+---------------------------------+---------------------+
| Fedora 34 | 3.9 | x86-64 |
+----------------------------------+---------------------------------+---------------------+
| macOS 10.15 Catalina | 3.6, 3.7, 3.8, 3.9, 3.10, PyPy3 | x86-64 |
+----------------------------------+---------------------------------+---------------------+
| Ubuntu Linux 18.04 LTS (Bionic) | 3.6 | x86-64 |
+----------------------------------+---------------------------------+---------------------+
| Ubuntu Linux 20.04 LTS (Focal) | 3.6, 3.7, 3.8, 3.9, 3.10, PyPy3 | x86-64 |
| +---------------------------------+---------------------+
| | 3.8 | arm64v8, ppc64le, |
| | | s390x |
+----------------------------------+---------------------------------+---------------------+
| Windows Server 2016 | 3.6 | x86-64 |
+----------------------------------+---------------------------------+---------------------+
| Windows Server 2019 | 3.6, 3.7, 3.8, 3.9, 3.10, PyPy3 | x86, x86-64 |
| +---------------------------------+---------------------+
| | 3.9/MinGW | x86, x86-64 |
+----------------------------------+---------------------------------+---------------------+
+----------------------------------+----------------------------+---------------------+
| Operating system | Tested Python versions | Tested architecture |
+==================================+============================+=====================+
| Alpine | 3.9 | x86-64 |
+----------------------------------+----------------------------+---------------------+
| Amazon Linux 2 | 3.7 | x86-64 |
+----------------------------------+----------------------------+---------------------+
| Arch | 3.9 | x86-64 |
+----------------------------------+----------------------------+---------------------+
| Debian 10 Buster | 3.7 | x86 |
+----------------------------------+----------------------------+---------------------+
| Fedora 34 | 3.9 | x86-64 |
+----------------------------------+----------------------------+---------------------+
| macOS 10.15 Catalina | 3.7, 3.8, 3.9, 3.10, PyPy3 | x86-64 |
+----------------------------------+----------------------------+---------------------+
| Ubuntu Linux 20.04 LTS (Focal) | 3.7, 3.8, 3.9, 3.10, PyPy3 | x86-64 |
| +----------------------------+---------------------+
| | 3.8 | arm64v8, ppc64le, |
| | | s390x |
+----------------------------------+----------------------------+---------------------+
| Windows Server 2016 | 3.7 | x86-64 |
+----------------------------------+----------------------------+---------------------+
| Windows Server 2019 | 3.7, 3.8, 3.9, 3.10, PyPy3 | x86, x86-64 |
| +----------------------------+---------------------+
| | 3.9/MinGW | x86, x86-64 |
+----------------------------------+----------------------------+---------------------+
Other Platforms

View File

@ -4,6 +4,11 @@
Backwards Incompatible Changes
==============================
Python 3.6
^^^^^^^^^^
Pillow has dropped support for Python 3.6, which reached end-of-life on 2021-12-23.
PILLOW_VERSION constant
^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1000,7 +1000,6 @@ try:
"Development Status :: 6 - Mature",
"License :: OSI Approved :: Historical Permission Notice and Disclaimer (HPND)", # noqa: E501
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
@ -1014,7 +1013,7 @@ try:
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
"Topic :: Multimedia :: Graphics :: Viewers",
],
python_requires=">=3.6",
python_requires=">=3.7",
cmdclass={"build_ext": pil_build_ext},
ext_modules=ext_modules,
include_package_data=True,

View File

@ -51,26 +51,18 @@ from . import ImageMode, TiffTags, UnidentifiedImageError, __version__, _plugins
from ._binary import i32le
from ._util import deferred_error, isPath
if sys.version_info >= (3, 7):
def __getattr__(name):
categories = {"NORMAL": 0, "SEQUENCE": 1, "CONTAINER": 2}
if name in categories:
warnings.warn(
"Image categories are deprecated and will be removed in Pillow 10 "
"(2023-01-02). Use is_animated instead.",
DeprecationWarning,
stacklevel=2,
)
return categories[name]
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
else:
# categories
NORMAL = 0
SEQUENCE = 1
CONTAINER = 2
def __getattr__(name):
categories = {"NORMAL": 0, "SEQUENCE": 1, "CONTAINER": 2}
if name in categories:
warnings.warn(
"Image categories are deprecated and will be removed in Pillow 10 "
"(2023-01-02). Use is_animated instead.",
DeprecationWarning,
stacklevel=2,
)
return categories[name]
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
logger = logging.getLogger(__name__)

View File

@ -9,12 +9,6 @@
#include "Python.h"
/* Workaround issue #2479 */
#if PY_VERSION_HEX < 0x03070000 && defined(PySlice_GetIndicesEx) && \
!defined(PYPY_VERSION)
#undef PySlice_GetIndicesEx
#endif
/* Check that we have an ANSI compliant compiler */
#ifndef HAVE_PROTOTYPES
#error Sorry, this library requires support for ANSI prototypes.

View File

@ -6,7 +6,7 @@
[tox]
envlist =
lint
py{36,37,38,39,310,py3}
py{37,38,39,310,py3}
minversion = 1.9
[testenv]

View File

@ -474,7 +474,6 @@ def build_pillow():
cmd_cd("{pillow_dir}"),
*prefs["header"],
cmd_set("DISTUTILS_USE_SDK", "1"), # use same compiler to build Pillow
cmd_set("MSSdk", "1"), # for PyPy3.6
cmd_set("py_vcruntime_redist", "true"), # use /MD, not /MT
r'"{python_dir}\{python_exe}" setup.py build_ext --vendor-raqm --vendor-fribidi %*', # noqa: E501
]