From 297b2f617d7ea4d03cc1b9431c06e6d1e31371b6 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 26 Nov 2023 13:56:47 +0000 Subject: [PATCH 1/3] python311Packages.python-hosts: 1.0.4 -> 1.0.5 --- pkgs/development/python-modules/python-hosts/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/python-hosts/default.nix b/pkgs/development/python-modules/python-hosts/default.nix index e3c1b155c90b..efcad1bd325f 100644 --- a/pkgs/development/python-modules/python-hosts/default.nix +++ b/pkgs/development/python-modules/python-hosts/default.nix @@ -2,11 +2,11 @@ buildPythonPackage rec { pname = "python-hosts"; - version = "1.0.4"; + version = "1.0.5"; src = fetchPypi { inherit pname version; - hash = "sha256-y7d7CuGuKYEUCjFHvWb+iDI6oDeVsTzBNPSySzxu1Zk="; + hash = "sha256-xabbGnvzXNiE0koQVq9dmEib5Cv7kg1JjpZAyb7IZM0="; }; # win_inet_pton is required for windows support From fcaba88b2b1cfaf42ce59633898c014d6ede710b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 26 Nov 2023 16:16:39 +0100 Subject: [PATCH 2/3] python311Packages.python-hosts: add changelog to meta --- pkgs/development/python-modules/python-hosts/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/python-hosts/default.nix b/pkgs/development/python-modules/python-hosts/default.nix index efcad1bd325f..a9870a74beb8 100644 --- a/pkgs/development/python-modules/python-hosts/default.nix +++ b/pkgs/development/python-modules/python-hosts/default.nix @@ -26,6 +26,7 @@ buildPythonPackage rec { meta = with lib; { description = "A library for managing a hosts file. It enables adding and removing entries, or importing them from a file or URL"; homepage = "https://github.com/jonhadfield/python-hosts"; + changelog = "https://github.com/jonhadfield/python-hosts/blob/${version}/CHANGELOG.md"; license = licenses.mit; maintainers = with maintainers; [ psyanticy ]; }; From effbef4d5c0901be88f2d049ffeb7a438f02b1e5 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 26 Nov 2023 16:26:48 +0100 Subject: [PATCH 3/3] python311Packages.python-hosts: refactor - switch to pytestCheckHook - add pythonImportsCheck - use longDescription - update ordering --- .../python-modules/python-hosts/default.nix | 51 +++++++++++++++---- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/python-hosts/default.nix b/pkgs/development/python-modules/python-hosts/default.nix index a9870a74beb8..7452abb860c3 100644 --- a/pkgs/development/python-modules/python-hosts/default.nix +++ b/pkgs/development/python-modules/python-hosts/default.nix @@ -1,30 +1,59 @@ -{ lib, buildPythonPackage, fetchPypi, pyyaml, pytest, pytest-cov }: +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, pythonOlder +, pyyaml +, setuptools +}: buildPythonPackage rec { pname = "python-hosts"; version = "1.0.5"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; hash = "sha256-xabbGnvzXNiE0koQVq9dmEib5Cv7kg1JjpZAyb7IZM0="; }; - # win_inet_pton is required for windows support + # win_inet_pton is required for Windows support prePatch = '' - substituteInPlace setup.py --replace "install_requires=['win_inet_pton']," "" - substituteInPlace python_hosts/utils.py --replace "import win_inet_pton" "" + substituteInPlace setup.py \ + --replace "install_requires=['win_inet_pton']," "" + substituteInPlace python_hosts/utils.py \ + --replace "import win_inet_pton" "" ''; - nativeCheckInputs = [ pyyaml pytest pytest-cov ]; + nativeBuildInputs = [ + setuptools + ]; - # Removing 1 test file (it requires internet connection) and keeping the other two - checkPhase = '' - pytest tests/test_hosts_entry.py - pytest tests/test_utils.py - ''; + nativeCheckInputs = [ + pyyaml + pytestCheckHook + ]; + + pythonImportsCheck = [ + "python_hosts" + ]; + + disabledTests = [ + # Tests require network access + "test_import_from_url_counters_for_part_success" + "test_import_from_url_with_force" + "test_import_from_url_without_force" + "test_import_from_url" + ]; meta = with lib; { - description = "A library for managing a hosts file. It enables adding and removing entries, or importing them from a file or URL"; + description = "Library for managing a hosts file"; + longDescription = '' + python-hosts is a Python library for managing a hosts file. It enables you to add + and remove entries, or import them from a file or URL. + ''; homepage = "https://github.com/jonhadfield/python-hosts"; changelog = "https://github.com/jonhadfield/python-hosts/blob/${version}/CHANGELOG.md"; license = licenses.mit;