From dcb2f6ee23c62aee5d2cdcf892bbfb24253ce88d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 14 Jan 2021 13:40:54 +0100 Subject: [PATCH] python3Packages.requests_oauthlib: add license and enable tests --- .../requests-oauthlib/default.nix | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/requests-oauthlib/default.nix b/pkgs/development/python-modules/requests-oauthlib/default.nix index 5de13530f66d..aed6576c90df 100644 --- a/pkgs/development/python-modules/requests-oauthlib/default.nix +++ b/pkgs/development/python-modules/requests-oauthlib/default.nix @@ -1,21 +1,43 @@ -{ lib, stdenv, buildPythonPackage, fetchPypi -, oauthlib, requests }: +{ lib +, buildPythonPackage +, fetchPypi +, mock +, oauthlib +, pytestCheckHook +, requests +, requests-mock +}: buildPythonPackage rec { - version = "1.3.0"; pname = "requests-oauthlib"; + version = "1.3.0"; src = fetchPypi { inherit pname version; sha256 = "0smaxs5ixng4z0k6dsgmm6s972ka3p6a2ykdpnl23mqzlw0ic9ml"; }; - doCheck = false; # Internet tests fail when building in chroot propagatedBuildInputs = [ oauthlib requests ]; + checkInputs = [ + mock + pytestCheckHook + requests-mock + ]; + + # Exclude tests which require network access + disabledTests = [ + "testCanPostBinaryData" + "test_content_type_override" + "test_url_is_native_str" + ]; + + pythonImportsCheck = [ "requests_oauthlib" ]; + meta = with lib; { description = "OAuthlib authentication support for Requests"; homepage = "https://github.com/requests/requests-oauthlib"; + license = with licenses; [ isc ]; maintainers = with maintainers; [ prikhi ]; }; }