Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always install keyring dependency #1422

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions azure-devops/azext_devops/dev/common/credential_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from knack.log import get_logger
from six.moves import configparser
from .config import AZ_DEVOPS_GLOBAL_CONFIG_DIR
from .pip_helper import install_keyring
import keyring

logger = get_logger(__name__)

Expand All @@ -19,13 +19,6 @@ def __init__(self):
self._initialize_keyring()

def set_password(self, key, token):
try:
import keyring
except ImportError:
install_keyring()
self._initialize_keyring()
import keyring

try:
# check for and delete existing credential
old_token = keyring.get_password(key, self._USERNAME)
Expand All @@ -51,10 +44,6 @@ def set_password(self, key, token):
raise CLIError(ex)

def get_password(self, key):
try:
import keyring
except ImportError:
return None
token = None
try:
token = keyring.get_password(key, self._USERNAME)
Expand All @@ -70,12 +59,6 @@ def get_password(self, key):
return token

def clear_password(self, key):
try:
import keyring
except ImportError:
install_keyring()
self._initialize_keyring()
import keyring
if sys.platform.startswith(self._LINUX_PLATFORM):
keyring_token = None
file_token = None
Expand Down Expand Up @@ -140,10 +123,6 @@ def _commit_change(credential_list):

@staticmethod
def _initialize_keyring():
try:
import keyring
except ImportError:
return

def _only_builtin(backend):
return (
Expand Down
26 changes: 0 additions & 26 deletions azure-devops/azext_devops/dev/common/pip_helper.py

This file was deleted.

18 changes: 0 additions & 18 deletions azure-devops/azext_devops/test/common/test_pip_helper.py

This file was deleted.

3 changes: 2 additions & 1 deletion azure-devops/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
# http://pypi.python.org/pypi/setuptools

REQUIRES = [
'distro==1.3.0'
'distro==1.3.0',
'keyring~=17.1.1',
]

# Version extraction inspired from 'requests'
Expand Down