From 1efdeb8767c60816a3fbf5c7cdd9f8e3e159f5e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 12 Sep 2021 20:32:02 +0200 Subject: [PATCH 1/2] python39Packages.autopage: init at 0.4.0 --- .../python-modules/autopage/default.nix | 22 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/development/python-modules/autopage/default.nix diff --git a/pkgs/development/python-modules/autopage/default.nix b/pkgs/development/python-modules/autopage/default.nix new file mode 100644 index 000000000000..9a2ca722a62b --- /dev/null +++ b/pkgs/development/python-modules/autopage/default.nix @@ -0,0 +1,22 @@ +{ lib, buildPythonPackage, fetchPypi }: + +buildPythonPackage rec { + pname = "autopage"; + version = "0.4.0"; + + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + sha256 = "18f511d8ef2e4d3cc22a986d345eab0e03f95b9fa80b74ca63b7fb001551dc42"; + }; + + pythonImportsCheck = [ "autopage" ]; + + meta = with lib; { + description = "A library to provide automatic paging for console output"; + homepage = "https://github.com/zaneb/autopage"; + license = licenses.asl20; + maintainers = teams.openstack.members; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 43b27274a3d0..2e3557201a26 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -687,6 +687,8 @@ in { automat = callPackage ../development/python-modules/automat { }; + autopage = callPackage ../development/python-modules/autopage { }; + autopep8 = callPackage ../development/python-modules/autopep8 { }; avahi = toPythonModule (pkgs.avahi.override { From 54cca75528fafcd8a45413b1323820c9128d01ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 12 Sep 2021 20:30:55 +0200 Subject: [PATCH 2/2] python39Packages.cliff: fix missing dependency, tests and adopt to openstack team --- .../python-modules/cliff/default.nix | 46 +++++++++---------- .../python-modules/cliff/tests.nix | 34 ++++++++++++++ 2 files changed, 56 insertions(+), 24 deletions(-) create mode 100644 pkgs/development/python-modules/cliff/tests.nix diff --git a/pkgs/development/python-modules/cliff/default.nix b/pkgs/development/python-modules/cliff/default.nix index 7eee574dad48..8b8f536bab6f 100644 --- a/pkgs/development/python-modules/cliff/default.nix +++ b/pkgs/development/python-modules/cliff/default.nix @@ -1,17 +1,14 @@ { lib , buildPythonPackage , fetchPypi +, autopage +, cmd2 , pbr , prettytable , pyparsing -, six -, stevedore , pyyaml -, cmd2 -, pytestCheckHook -, testtools -, fixtures -, which +, stevedore +, callPackage }: buildPythonPackage rec { @@ -23,34 +20,35 @@ buildPythonPackage rec { sha256 = "95363e9b43e2ec9599e33b5aea27a6953beda2d0673557916fa4f5796857daa3"; }; + postPatch = '' + # only a small portion of the listed packages are actually needed for running the tests + # so instead of removing them one by one remove everything + rm test-requirements.txt + ''; + propagatedBuildInputs = [ + autopage + cmd2 pbr prettytable pyparsing - six - stevedore pyyaml - cmd2 + stevedore ]; - postPatch = '' - sed -i -e '/cmd2/c\cmd2' -e '/PrettyTable/c\PrettyTable' requirements.txt - ''; + # check in passthru.tests.pytest to escape infinite recursion with stestr + doCheck = false; - checkInputs = [ fixtures pytestCheckHook testtools which ]; - # add some tests - pytestFlagsArray = [ - "cliff/tests/test_utils.py" - "cliff/tests/test_app.py" - "cliff/tests/test_command.py" - "cliff/tests/test_help.py" - "cliff/tests/test_lister.py" - ]; + pythonImportsCheck = [ "cliff" ]; + + passthru.tests = { + pytest = callPackage ./tests.nix { }; + }; meta = with lib; { description = "Command Line Interface Formulation Framework"; - homepage = "https://docs.openstack.org/cliff/latest/"; + homepage = "https://github.com/openstack/cliff"; license = licenses.asl20; - maintainers = [ maintainers.costrouc ]; + maintainers = teams.openstack.members; }; } diff --git a/pkgs/development/python-modules/cliff/tests.nix b/pkgs/development/python-modules/cliff/tests.nix new file mode 100644 index 000000000000..f7cc0226f2fc --- /dev/null +++ b/pkgs/development/python-modules/cliff/tests.nix @@ -0,0 +1,34 @@ +{ stdenv +, buildPythonPackage +, cliff +, docutils +, stestr +, testscenarios +}: + +buildPythonPackage rec { + pname = "cliff"; + inherit (cliff) version; + + src = cliff.src; + + postPatch = '' + # only a small portion of the listed packages are actually needed for running the tests + # so instead of removing them one by one remove everything + rm test-requirements.txt + ''; + + dontBuild = true; + dontInstall = true; + + checkInputs = [ + cliff + docutils + stestr + testscenarios + ]; + + checkPhase = '' + stestr run + ''; +}