diff --git a/.gitignore b/.gitignore index 2bdb6fa3..fe28fb15 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,6 @@ tmp/ # VS Code .vscode + +# PyCharm +.idea diff --git a/did/plugins/confluence.py b/did/plugins/confluence.py index 34c48a3f..3fb225b0 100644 --- a/did/plugins/confluence.py +++ b/did/plugins/confluence.py @@ -38,7 +38,8 @@ import urllib.parse import requests -from requests.packages.urllib3.exceptions import InsecureRequestWarning +import urllib3 +from urllib3.exceptions import InsecureRequestWarning from requests_gssapi import DISABLED, HTTPSPNEGOAuth from did.base import Config, ReportError @@ -245,8 +246,7 @@ def session(self): log.debug("Connecting to {0}".format(self.auth_url)) # Disable SSL warning when ssl_verify is False if not self.ssl_verify: - requests.packages.urllib3.disable_warnings( - InsecureRequestWarning) + urllib3.disable_warnings(InsecureRequestWarning) if self.auth_type == "basic": basic_auth = (self.auth_username, self.auth_password) response = self._session.get( diff --git a/did/plugins/gitlab.py b/did/plugins/gitlab.py index fc0bec3d..9060cd60 100644 --- a/did/plugins/gitlab.py +++ b/did/plugins/gitlab.py @@ -29,7 +29,8 @@ import dateutil import requests -from requests.packages.urllib3.exceptions import InsecureRequestWarning +import urllib3 +from urllib3.exceptions import InsecureRequestWarning from did.base import Config, ReportError, get_token from did.stats import Stats, StatsGroup @@ -387,7 +388,7 @@ def __init__(self, option, name=None, parent=None, user=None): except KeyError: self.ssl_verify = GITLAB_SSL_VERIFY if not self.ssl_verify: - requests.packages.urllib3.disable_warnings(InsecureRequestWarning) + urllib3.disable_warnings(InsecureRequestWarning) self.gitlab = GitLab(self.url, self.token, self.ssl_verify) # Create the list of stats self.stats = [ diff --git a/did/plugins/jira.py b/did/plugins/jira.py index c9098864..382d8a8e 100644 --- a/did/plugins/jira.py +++ b/did/plugins/jira.py @@ -85,7 +85,8 @@ import dateutil.parser import requests -from requests.packages.urllib3.exceptions import InsecureRequestWarning +import urllib3 +from urllib3.exceptions import InsecureRequestWarning from requests_gssapi import DISABLED, HTTPSPNEGOAuth from did.base import Config, ReportError, get_token @@ -390,8 +391,7 @@ def session(self): log.debug("Connecting to {0}".format(self.auth_url)) # Disable SSL warning when ssl_verify is False if not self.ssl_verify: - requests.packages.urllib3.disable_warnings( - InsecureRequestWarning) + urllib3.disable_warnings(InsecureRequestWarning) if self.auth_type == 'basic': basic_auth = (self.auth_username, self.auth_password) response = self._session.get( diff --git a/did/stats.py b/did/stats.py index 051e52cd..a3012650 100644 --- a/did/stats.py +++ b/did/stats.py @@ -188,7 +188,7 @@ def __init__(self, user=None, options=None, config=None): self.stats = self.configured_plugins(config) except did.base.ConfigFileError as error: # Missing config file is OK if building options (--help). - # Otherwise raise the expection to suggest config example. + # Otherwise, raise the exception to suggest config example. if options is None: log.debug(error) log.debug("This is OK for now as we're just building options.") diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..d6558d27 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,10 @@ +certifi==2023.11.17 +charset-normalizer==3.3.2 +decorator==5.1.1 +gssapi==1.8.3 +idna==3.6 +python-dateutil==2.8.2 +requests==2.31.0 +requests-gssapi==1.2.3 +six==1.16.0 +urllib3==2.1.0 diff --git a/setup.py b/setup.py index 7aa9bec7..783f9e7c 100755 --- a/setup.py +++ b/setup.py @@ -16,6 +16,8 @@ install_requires = [ 'python_dateutil', 'requests', + 'requests-gssapi', + 'urllib3' ] extras_require = { 'bodhi': ['bodhi-client'],