From 65b91f617fd26bd8d9d804bc1c4e057fdf40f58e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 25 Feb 2021 10:05:10 +0100 Subject: [PATCH 1/2] python3Packages.pyowm: 3.1.1 -> 3.2.0 --- .../python-modules/pyowm/default.nix | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/pyowm/default.nix b/pkgs/development/python-modules/pyowm/default.nix index 423d38ab25d..df222181e17 100644 --- a/pkgs/development/python-modules/pyowm/default.nix +++ b/pkgs/development/python-modules/pyowm/default.nix @@ -1,17 +1,27 @@ -{ lib, buildPythonPackage, fetchPypi, pythonOlder, requests, geojson }: +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, requests +, geojson +, pysocks +}: buildPythonPackage rec { pname = "pyowm"; - version = "3.1.1"; - - disabled = pythonOlder "3.3"; + version = "3.2.0"; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "a7b18297a9189dbe5f6b454b12d61a407e35c7eb9ca75bcabfe5e1c83245290d"; + sha256 = "sha256-o9QL2KtZdRa/uFq+tq8LDm5jRovNuma96qOSDK/hqN4="; }; - propagatedBuildInputs = [ requests geojson ]; + propagatedBuildInputs = [ + geojson + pysocks + requests + ]; # This may actually break the package. postPatch = '' @@ -21,9 +31,10 @@ buildPythonPackage rec { # No tests in archive doCheck = false; + pythonImportsCheck = [ "" ]; meta = with lib; { - description = "A Python wrapper around the OpenWeatherMap web API"; + description = "Python wrapper around the OpenWeatherMap web API"; homepage = "https://pyowm.readthedocs.io/"; license = licenses.mit; }; From cb8a87a701364e6586a4e4922710cca547193cbb Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 25 Feb 2021 10:14:23 +0100 Subject: [PATCH 2/2] python3Packages.pyowm: enable tests --- .../python-modules/pyowm/default.nix | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/pyowm/default.nix b/pkgs/development/python-modules/pyowm/default.nix index df222181e17..3cfb70e7b87 100644 --- a/pkgs/development/python-modules/pyowm/default.nix +++ b/pkgs/development/python-modules/pyowm/default.nix @@ -1,10 +1,11 @@ { lib , buildPythonPackage -, fetchPypi -, pythonOlder -, requests +, fetchFromGitHub , geojson , pysocks +, pythonOlder +, requests +, pytestCheckHook }: buildPythonPackage rec { @@ -12,9 +13,11 @@ buildPythonPackage rec { version = "3.2.0"; disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit pname version; - sha256 = "sha256-o9QL2KtZdRa/uFq+tq8LDm5jRovNuma96qOSDK/hqN4="; + src = fetchFromGitHub { + owner = "csparpa"; + repo = pname; + rev = version; + sha256 = "0sq8rxcgdiayl5gy4qhkvvsdq1d93sbzn0nfg8f1vr8qxh8qkfq4"; }; propagatedBuildInputs = [ @@ -23,19 +26,17 @@ buildPythonPackage rec { requests ]; - # This may actually break the package. - postPatch = '' - substituteInPlace setup.py \ - --replace "requests>=2.18.2,<2.19" "requests" - ''; + checkInputs = [ pytestCheckHook ]; - # No tests in archive - doCheck = false; - pythonImportsCheck = [ "" ]; + # Run only tests which don't require network access + pytestFlagsArray = [ "tests/unit" ]; + + pythonImportsCheck = [ "pyowm" ]; meta = with lib; { description = "Python wrapper around the OpenWeatherMap web API"; homepage = "https://pyowm.readthedocs.io/"; license = licenses.mit; + maintainers = with maintainers; [ fab ]; }; }