From 534b168eaad40e3684aaf0379bf453b997fcca78 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 9 Aug 2022 00:49:26 +0200 Subject: [PATCH] python310Packages.pyipma: 3.0.0 -> 3.0.2 --- .../python-modules/pyipma/default.nix | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/pyipma/default.nix b/pkgs/development/python-modules/pyipma/default.nix index 83e09317661f..6a9847d3778f 100644 --- a/pkgs/development/python-modules/pyipma/default.nix +++ b/pkgs/development/python-modules/pyipma/default.nix @@ -1,20 +1,28 @@ { lib , aiohttp +, aioresponses , buildPythonPackage -, fetchPypi +, fetchFromGitHub +, freezegun +, mock , geopy +, pytest-asyncio +, pytestCheckHook , pythonOlder }: buildPythonPackage rec { pname = "pyipma"; - version = "3.0.0"; + version = "3.0.2"; + format = "setuptools"; + disabled = pythonOlder "3.7"; - # Request for GitHub releases, https://github.com/dgomes/pyipma/issues/10 - src = fetchPypi { - inherit pname version; - sha256 = "sha256-LfnatA8CimHIXH3f3T4PatDBIEhh6vlQtI080iu8UEg="; + src = fetchFromGitHub { + owner = "dgomes"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-AF4bwEsAwJ5MoBQieNDFQ00LILJu+bZZttw4T5+6gkk="; }; propagatedBuildInputs = [ @@ -22,13 +30,27 @@ buildPythonPackage rec { geopy ]; - # Project has no tests included in the PyPI releases - doCheck = false; + checkInputs = [ + aioresponses + freezegun + mock + pytest-asyncio + pytestCheckHook + ]; - pythonImportsCheck = [ "pyipma" ]; + pythonImportsCheck = [ + "pyipma" + ]; + + disabledTestPaths = [ + # Tests require network access + "tests/test_auxiliar.py" + "tests/test_location.py" + "tests/test_sea_forecast.py" + ]; meta = with lib; { - description = "Python library to retrieve information from Instituto Português do Mar e Atmosfera"; + description = "Library to retrieve information from Instituto Português do Mar e Atmosfera"; homepage = "https://github.com/dgomes/pyipma"; license = with licenses; [ mit ]; maintainers = with maintainers; [ fab ];