From b5fde732b417a6e53262b197f905346242c1bfe2 Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Thu, 10 Aug 2023 22:53:24 -0700 Subject: [PATCH] python3.pkgs.aiohttp: fix tests with setuptools 67.5.0+ (#247310) --- .../python-modules/aiohttp/default.nix | 4 +++ .../setuptools-67.5.0-compatibility.diff | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 pkgs/development/python-modules/aiohttp/setuptools-67.5.0-compatibility.diff diff --git a/pkgs/development/python-modules/aiohttp/default.nix b/pkgs/development/python-modules/aiohttp/default.nix index e2e2ebac9ae5..b988abe60108 100644 --- a/pkgs/development/python-modules/aiohttp/default.nix +++ b/pkgs/development/python-modules/aiohttp/default.nix @@ -6,6 +6,7 @@ , pythonOlder # build_requires , setuptools +, wheel # install_requires , attrs , charset-normalizer @@ -49,6 +50,8 @@ buildPythonPackage rec { url = "https://github.com/aio-libs/aiohttp/commit/7dcc235cafe0c4521bbbf92f76aecc82fee33e8b.patch"; hash = "sha256-ZzhlE50bmA+e2XX2RH1FuWQHZIAa6Dk/hZjxPoX5t4g="; }) + # https://github.com/aio-libs/aiohttp/pull/7454 but does not merge cleanly + ./setuptools-67.5.0-compatibility.diff ]; postPatch = '' @@ -57,6 +60,7 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools + wheel ]; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/aiohttp/setuptools-67.5.0-compatibility.diff b/pkgs/development/python-modules/aiohttp/setuptools-67.5.0-compatibility.diff new file mode 100644 index 000000000000..2f75b6b4c136 --- /dev/null +++ b/pkgs/development/python-modules/aiohttp/setuptools-67.5.0-compatibility.diff @@ -0,0 +1,27 @@ +diff --git a/setup.cfg b/setup.cfg +index 6944b7e2..dfa65d69 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -128,6 +128,7 @@ filterwarnings = + ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:: + ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing + ignore:path is deprecated. Use files.. instead. Refer to https.//importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.:DeprecationWarning:certifi.core ++ ignore:pkg_resources is deprecated as an API:DeprecationWarning + junit_suite_name = aiohttp_test_suite + norecursedirs = dist docs build .tox .eggs + minversion = 3.8.2 +diff --git a/tests/test_circular_imports.py b/tests/test_circular_imports.py +index 22e5ea47..a655fd1d 100644 +--- a/tests/test_circular_imports.py ++++ b/tests/test_circular_imports.py +@@ -113,6 +113,10 @@ def test_no_warnings(import_path: str) -> None: + "-W", + "ignore:Creating a LegacyVersion has been deprecated and will " + "be removed in the next major release:DeprecationWarning:", ++ # Deprecation warning emitted by setuptools v67.5.0+ triggered by importing ++ # `gunicorn.util`. ++ "-W", "ignore:pkg_resources is deprecated as an API:" ++ "DeprecationWarning", + "-c", f"import {import_path!s}", + # fmt: on + )