From 7e952c3321bec026a10e3bf0e04b7e3c82ac126d Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sat, 23 Nov 2019 14:51:19 +0000 Subject: [PATCH] python: keyring: support Python 2 --- pkgs/development/python-modules/keyring/2.nix | 33 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 5 ++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/python-modules/keyring/2.nix diff --git a/pkgs/development/python-modules/keyring/2.nix b/pkgs/development/python-modules/keyring/2.nix new file mode 100644 index 000000000000..ce4aa145e8ee --- /dev/null +++ b/pkgs/development/python-modules/keyring/2.nix @@ -0,0 +1,33 @@ +{ stdenv, buildPythonPackage, fetchPypi +, dbus-python, setuptools_scm, entrypoints, secretstorage +, pytest, pytest-flake8 }: + +buildPythonPackage rec { + pname = "keyring"; + version = "18.0.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "0f58jq58jhfzlhix7x2zz7c4ycdvcs1z3sgs4lkr4xxx680wrmk7"; + }; + + nativeBuildInputs = [ setuptools_scm ]; + + checkInputs = [ pytest pytest-flake8 ]; + + propagatedBuildInputs = [ dbus-python entrypoints ] ++ stdenv.lib.optional stdenv.isLinux secretstorage; + + doCheck = !stdenv.isDarwin; + + checkPhase = '' + py.test + ''; + + meta = with stdenv.lib; { + description = "Store and access your passwords safely"; + homepage = "https://pypi.python.org/pypi/keyring"; + license = licenses.psfl; + maintainers = with maintainers; [ lovek323 orivej ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index be26781312a5..37ee3bf7e1c0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3686,7 +3686,10 @@ in { jupyterhub-ldapauthenticator = callPackage ../development/python-modules/jupyterhub-ldapauthenticator { }; - keyring = callPackage ../development/python-modules/keyring { }; + keyring = if isPy3k then + callPackage ../development/python-modules/keyring { } + else + callPackage ../development/python-modules/keyring/2.nix { }; keyutils = callPackage ../development/python-modules/keyutils { inherit (pkgs) keyutils; };