From f093ca33404710fac6728522b9013f449f4584d0 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 + pyproject.toml | 6 ++++++ setup.py | 7 ++++++- 3 files changed, 13 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/pyproject.toml b/pyproject.toml index acccf615c8a..5478396b5ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,3 +11,9 @@ issue_format = "`#{issue} `_ test-command = "" # don't build PyPy wheels, install from source instead skip = "pp*" + +[build-system] +requires = [ + "setuptools>=46.4.0", +] +build-backend = "setuptools.build_meta" 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()