From 9d2548c70bf2e4490cc13b47508f8dc9db1ea7fb Mon Sep 17 00:00:00 2001 From: A_D Date: Tue, 28 Jul 2020 11:24:49 +0200 Subject: [PATCH] Removed keyring dependency This remove all dependencies on the keyring lib, updates the requirements.txt to reflect that, and ensures that setup.py does not attempt to package it. Any use of the "old" keyring code will now return None and warn about its deprecation. --- config.py | 19 ++++--------------- requirements.txt | 1 - setup.py | 2 -- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/config.py b/config.py index f6ad1acf..b0b887ec 100644 --- a/config.py +++ b/config.py @@ -1,5 +1,6 @@ import numbers import sys +import warnings from os import getenv, makedirs, mkdir, pardir from os.path import expanduser, dirname, exists, isdir, join, normpath from sys import platform @@ -367,25 +368,13 @@ class Config(object): # Common def get_password(self, account): - try: - import keyring - return keyring.get_password(self.identifier, account) - except ImportError: - return None + warnings.warn("password subsystem is no longer supported", DeprecationWarning) def set_password(self, account, password): - try: - import keyring - keyring.set_password(self.identifier, account, password) - except ImportError: - pass + warnings.warn("password subsystem is no longer supported", DeprecationWarning) def delete_password(self, account): - try: - import keyring - keyring.delete_password(self.identifier, account) - except: - pass # don't care - silently fail + warnings.warn("password subsystem is no longer supported", DeprecationWarning) # singleton config = Config() diff --git a/requirements.txt b/requirements.txt index 5fa59d6a..bf29adc9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ certifi==2019.9.11 -keyring==19.2.0 requests>=2.11.1 watchdog>=0.8.3 # argh==0.26.2 watchdog dep diff --git a/setup.py b/setup.py index be40d655..6bf35f8e 100755 --- a/setup.py +++ b/setup.py @@ -73,7 +73,6 @@ if sys.platform=='darwin': 'optimize': 2, 'packages': [ 'requests', - 'keyring.backends', 'sqlite3', # Included for plugins ], 'includes': [ @@ -119,7 +118,6 @@ elif sys.platform=='win32': 'optimize': 2, 'packages': [ 'requests', - 'keyring.backends', 'sqlite3', # Included for plugins ], 'includes': [