From 6a34b7913a30e17810cb8f94d6cdb19fe670d261 Mon Sep 17 00:00:00 2001 From: James Hilliard Date: Tue, 2 Nov 2021 01:12:42 -0600 Subject: [PATCH] Add check for compatible setuptools version. In order to avoid a recursive dependency issue when parsing the aiohttp version during install setuptools needs: https://github.com/pypa/setuptools/commit/c457e68319555b7266e5e0802946c5b1b63e4d61 This implies we need setuptools 46.4.0 or newer. --- CHANGES/6205.bugfix | 1 + setup.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 CHANGES/6205.bugfix diff --git a/CHANGES/6205.bugfix b/CHANGES/6205.bugfix new file mode 100644 index 00000000000..3569919c712 --- /dev/null +++ b/CHANGES/6205.bugfix @@ -0,0 +1 @@ +Add check for compatible ``setuptools`` version. diff --git a/setup.py b/setup.py index 17d51cbdd57..e82a0b27f9c 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,18 @@ import os import pathlib import sys +from distutils.version import StrictVersion -from setuptools import Extension, setup +from setuptools import Extension, __version__ as setuptools_version, setup if sys.version_info < (3, 7): raise RuntimeError("aiohttp 4.x requires Python 3.7+") +if StrictVersion(setuptools_version) < StrictVersion("46.4.0"): + raise RuntimeError("aiohttp 4.x requires setuptools 46.4.0+") + + NO_EXTENSIONS = bool(os.environ.get("AIOHTTP_NO_EXTENSIONS")) # type: bool HERE = pathlib.Path(__file__).parent IS_GIT_REPO = (HERE / ".git").exists()