From b9d5df0632008f0bafe8fd1f3355b4e4c11d0f3d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 14 Nov 2021 12:08:24 +0100 Subject: [PATCH] python3Packages.aiohttp-remotes: switch to pytestCheckHook --- .../aiohttp-remotes/default.nix | 43 ++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/aiohttp-remotes/default.nix b/pkgs/development/python-modules/aiohttp-remotes/default.nix index 70e3923ee726..1867567178e4 100644 --- a/pkgs/development/python-modules/aiohttp-remotes/default.nix +++ b/pkgs/development/python-modules/aiohttp-remotes/default.nix @@ -1,27 +1,50 @@ -{ lib, buildPythonPackage, fetchPypi -, aiohttp, pytest, pytest-cov, pytest-aiohttp +{ lib +, aiohttp +, buildPythonPackage +, fetchPypi +, pytest-aiohttp +, pytestCheckHook +, pythonOlder +, typing-extensions }: buildPythonPackage rec { - pname = "aiohttp_remotes"; + pname = "aiohttp-remotes"; version = "1.1.0"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; src = fetchPypi { - inherit pname version; + pname = "aiohttp_remotes"; + inherit version; sha256 = "e44f2c5fd5fc3305477c89bb25f14570589100cc58c48b36745d4239839d3174"; }; - propagatedBuildInputs = [ aiohttp ]; + propagatedBuildInputs = [ + aiohttp + ] ++ lib.optionals (pythonOlder "3.7") [ + typing-extensions + ]; - checkInputs = [ pytest pytest-cov pytest-aiohttp ]; - checkPhase = '' - python -m pytest + checkInputs = [ + pytest-aiohttp + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace " --no-cov-on-fail --cov-branch --cov=aiohttp_remotes --cov-report=term --cov-report=html" "" ''; + pythonImportsCheck = [ + "aiohttp_remotes" + ]; + meta = with lib; { - homepage = "https://github.com/wikibusiness/aiohttp-remotes"; description = "A set of useful tools for aiohttp.web server"; + homepage = "https://github.com/wikibusiness/aiohttp-remotes"; license = licenses.mit; - maintainers = [ maintainers.qyliss ]; + maintainers = with maintainers; [ qyliss ]; }; }