python3Packages.pyowm: enable tests

This commit is contained in:
Fabian Affolter 2021-02-25 10:14:23 +01:00
parent 65b91f617f
commit cb8a87a701

View File

@ -1,10 +1,11 @@
{ lib { lib
, buildPythonPackage , buildPythonPackage
, fetchPypi , fetchFromGitHub
, pythonOlder
, requests
, geojson , geojson
, pysocks , pysocks
, pythonOlder
, requests
, pytestCheckHook
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -12,9 +13,11 @@ buildPythonPackage rec {
version = "3.2.0"; version = "3.2.0";
disabled = pythonOlder "3.7"; disabled = pythonOlder "3.7";
src = fetchPypi { src = fetchFromGitHub {
inherit pname version; owner = "csparpa";
sha256 = "sha256-o9QL2KtZdRa/uFq+tq8LDm5jRovNuma96qOSDK/hqN4="; repo = pname;
rev = version;
sha256 = "0sq8rxcgdiayl5gy4qhkvvsdq1d93sbzn0nfg8f1vr8qxh8qkfq4";
}; };
propagatedBuildInputs = [ propagatedBuildInputs = [
@ -23,19 +26,17 @@ buildPythonPackage rec {
requests requests
]; ];
# This may actually break the package. checkInputs = [ pytestCheckHook ];
postPatch = ''
substituteInPlace setup.py \
--replace "requests>=2.18.2,<2.19" "requests"
'';
# No tests in archive # Run only tests which don't require network access
doCheck = false; pytestFlagsArray = [ "tests/unit" ];
pythonImportsCheck = [ "" ];
pythonImportsCheck = [ "pyowm" ];
meta = with lib; { meta = with lib; {
description = "Python wrapper around the OpenWeatherMap web API"; description = "Python wrapper around the OpenWeatherMap web API";
homepage = "https://pyowm.readthedocs.io/"; homepage = "https://pyowm.readthedocs.io/";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ fab ];
}; };
} }