From b552e4ada4f7131de0f53f1e842ed2cb104f8376 Mon Sep 17 00:00:00 2001 From: Austin Butler Date: Wed, 2 Jun 2021 19:25:55 -0700 Subject: [PATCH 1/2] python3Packages.notify-py: 0.3.1 -> 0.3.3 --- .../python-modules/notify-py/default.nix | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/notify-py/default.nix b/pkgs/development/python-modules/notify-py/default.nix index 46c72fb6979..ea9f0485bef 100644 --- a/pkgs/development/python-modules/notify-py/default.nix +++ b/pkgs/development/python-modules/notify-py/default.nix @@ -1,33 +1,37 @@ -{ lib, buildPythonPackage, fetchPypi, isPy3k, alsaUtils, libnotify, which, loguru, pytest }: +{ lib, stdenv, buildPythonPackage, fetchFromGitHub, isPy3k, coreutils, alsaUtils +, libnotify, which, jeepney, loguru, pytestCheckHook }: buildPythonPackage rec { - pname = "notify_py"; - version = "0.3.1"; + pname = "notify-py"; + version = "0.3.3"; disabled = !isPy3k; - src = fetchPypi { - inherit pname version; - sha256 = "5ba696d18ffe1d7070f3d0a5b4923fee4d6c863de6843af105bec0ce9915ebad"; + src = fetchFromGitHub { + owner = "ms7m"; + repo = pname; + rev = "v${version}"; + sha256 = "1n35adwsyhz304n4ifnsz6qzkymwhyqc8sg8d76qv5psv2xsnzlf"; }; - postPatch = '' - substituteInPlace setup.py \ - --replace "loguru==0.4.1" "loguru~=0.5.0" - ''; + propagatedNativeBuildInputs = [ which ] + ++ lib.optionals stdenv.isLinux [ alsaUtils libnotify ]; + propagatedBuildInputs = [ loguru ] + ++ lib.optionals stdenv.isLinux [ jeepney ]; - propagatedBuildInputs = [ alsaUtils libnotify loguru which ]; + checkInputs = [ coreutils pytestCheckHook ]; - checkInputs = [ alsaUtils libnotify pytest which ]; - - checkPhase = '' - pytest + # Tests search for "afplay" binary which is built in to MacOS and not available in nixpkgs + preCheck = '' + mkdir $TMP/bin + ln -s ${coreutils}/bin/true $TMP/bin/afplay + export PATH="$TMP/bin:$PATH" ''; pythonImportsCheck = [ "notifypy" ]; meta = with lib; { - description = " Python Module for sending cross-platform desktop notifications on Windows, macOS, and Linux."; + description = "Python Module for sending cross-platform desktop notifications on Windows, macOS, and Linux."; homepage = "https://github.com/ms7m/notify-py/"; license = licenses.mit; maintainers = with maintainers; [ austinbutler ]; From b9fb66d635670bc548daac19ffc8a2d0141d0cb1 Mon Sep 17 00:00:00 2001 From: Austin Butler Date: Thu, 3 Jun 2021 12:00:32 -0700 Subject: [PATCH 2/2] python3Packages.toggl-cli: 2.4.1 -> 2.4.2 --- .../python-modules/toggl-cli/default.nix | 47 +++++++------------ 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/pkgs/development/python-modules/toggl-cli/default.nix b/pkgs/development/python-modules/toggl-cli/default.nix index d7eece65002..d8225e7031e 100644 --- a/pkgs/development/python-modules/toggl-cli/default.nix +++ b/pkgs/development/python-modules/toggl-cli/default.nix @@ -1,54 +1,41 @@ -{ lib, buildPythonPackage, fetchPypi, pythonAtLeast, pythonOlder -, click -, click-completion -, factory_boy -, faker -, inquirer -, notify-py -, pbr -, pendulum -, ptable -, pytest -, pytestcov -, pytest-mock -, requests -, twine -, validate-email -}: - +{ lib, buildPythonPackage, fetchPypi, pythonAtLeast, pythonOlder, click +, click-completion, factory_boy, faker, inquirer, notify-py, pbr, pendulum +, ptable, pytestCheckHook, pytestcov, pytest-mock, requests, twine +, validate-email }: buildPythonPackage rec { pname = "toggl-cli"; - version = "2.4.1"; + version = "2.4.2"; disabled = pythonOlder "3.5"; src = fetchPypi { pname = "togglCli"; inherit version; - sha256 = "19lry8adcznzmzbvghyid3yl4j05db6931bw38af5vrkkyzyf62i"; + sha256 = "1wgh231r16jyvaj1ch1pajvl9szflb4srs505pfdwdlqvz7rzww8"; }; postPatch = '' - substituteInPlace requirements.txt \ - --replace "inquirer==2.6.3" "inquirer>=2.6.3" \ - --replace "notify-py==0.2.2" "notify-py>=0.2.2" + substituteInPlace requirements.txt \ + --replace "notify-py==0.3.1" "notify-py>=0.3.1" ''; nativeBuildInputs = [ pbr twine ]; - checkInputs = [ pbr pytest pytestcov pytest-mock faker factory_boy ]; + checkInputs = [ pbr pytestCheckHook pytestcov pytest-mock faker factory_boy ]; preCheck = '' export TOGGL_API_TOKEN=your_api_token export TOGGL_PASSWORD=toggl_password export TOGGL_USERNAME=user@example.com - ''; - - checkPhase = '' - runHook preCheck - pytest -k "not premium and not TestDateTimeType and not TestDateTimeField" tests/unit --maxfail=20 - runHook postCheck ''; + disabledTests = [ + "integration" + "premium" + "test_parsing" + "test_type_check" + "test_now" + ]; + propagatedBuildInputs = [ click click-completion