From 717020f3f6f23312f79d9c221039430c86d0c93f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 10 Jan 2021 11:01:22 +0100 Subject: [PATCH 1/2] python3Packages.awesomeversion: init at 20.12.5 --- .../python-modules/awesomeversion/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/awesomeversion/default.nix diff --git a/pkgs/development/python-modules/awesomeversion/default.nix b/pkgs/development/python-modules/awesomeversion/default.nix new file mode 100644 index 000000000000..a49e55abe107 --- /dev/null +++ b/pkgs/development/python-modules/awesomeversion/default.nix @@ -0,0 +1,39 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +, requests +}: + +buildPythonPackage rec { + pname = "awesomeversion"; + version = "20.12.5"; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "ludeeus"; + repo = pname; + rev = version; + sha256 = "1jwlfqnrqlxjp30fj9bcqh7vgicmpdbn5kjdcmll4srnl87lalfg"; + }; + + postPatch = '' + substituteInPlace setup.py --replace "main" ${version} + ''; + + propagatedBuildInputs = [ requests ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "awesomeversion" ]; + + meta = with lib; { + description = "Python module to deal with versions"; + homepage = "https://github.com/ludeeus/awesomeversion"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ce7daebb8723..696fa6296731 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -541,6 +541,8 @@ in { awesome-slugify = callPackage ../development/python-modules/awesome-slugify { }; + awesomeversion = callPackage ../development/python-modules/awesomeversion { }; + awkward0 = callPackage ../development/python-modules/awkward0 { }; awkward = callPackage ../development/python-modules/awkward { }; From 0b371941a1d8044fa09919a30daaeb00c55a8f16 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 10 Jan 2021 11:01:43 +0100 Subject: [PATCH 2/2] python3Packages.pyhaversion: 3.4.2 -> 20.12.1 --- .../python-modules/pyhaversion/default.nix | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/pyhaversion/default.nix b/pkgs/development/python-modules/pyhaversion/default.nix index 27d750a5df76..3af6b3a263e8 100644 --- a/pkgs/development/python-modules/pyhaversion/default.nix +++ b/pkgs/development/python-modules/pyhaversion/default.nix @@ -1,40 +1,49 @@ { lib -, buildPythonPackage -, fetchPypi -, pythonOlder , aiohttp +, aresponses , async-timeout -, semantic-version -, pytestrunner +, awesomeversion +, buildPythonPackage +, fetchFromGitHub +, pythonAtLeast +, pytest-asyncio +, pytestCheckHook }: + buildPythonPackage rec { pname = "pyhaversion"; - version = "3.4.2"; - disabled = pythonOlder "3.8"; + version = "20.12.1"; - src = fetchPypi { - inherit pname version; - sha256 = "b4e49dfa0f9dae10edd072e630d902e5497daa312baad58b7df7618efe863377"; + # Only 3.8.0 and beyond are supported + disabled = pythonAtLeast "3.8"; + + src = fetchFromGitHub { + owner = "ludeeus"; + repo = pname; + rev = version; + sha256 = "17yl67dgw75dghljcfwzblm11kqnh6sxf47w62mxz86aq9zrvcxd"; }; propagatedBuildInputs = [ aiohttp async-timeout - semantic-version + awesomeversion ]; - buildInputs = [ - pytestrunner + checkInputs = [ + aresponses + awesomeversion + pytest-asyncio + pytestCheckHook ]; - # no tests - doCheck = false; pythonImportsCheck = [ "pyhaversion" ]; meta = with lib; { - description = "A python module to the newest version number of Home Assistant"; + description = "Python module to the newest version number of Home Assistant"; homepage = "https://github.com/ludeeus/pyhaversion"; + changelog = "https://github.com/ludeeus/pyhaversion/releases/tag/${version}"; license = with licenses; [ mit ]; - maintainers = [ maintainers.makefu ]; + maintainers = with maintainers; [ makefu ]; }; }