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()