diff --git a/dev-requirements.txt b/dev-requirements.txt index c812083..ed74603 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,3 @@ -requests==2.24.0 mypy==0.710 autoflake==1.3.1 black==19.10b0 diff --git a/slurm/install/setup.py b/slurm/install/setup.py index eea392f..76d3714 100644 --- a/slurm/install/setup.py +++ b/slurm/install/setup.py @@ -132,8 +132,7 @@ def run(self) -> None: }, install_requires=[ "typing_extensions==3.7.4.3", - "zipp==3.19.1", - "requests == 2.24.0", + "zipp==3.19.1" ], tests_require=["pytest==3.2.3"], cmdclass={"test": PyTest, "format": Formatter, "types": TypeChecking}, diff --git a/slurm/src/slurmcc/__init__.py b/slurm/src/slurmcc/__init__.py index 09633d7..1651e6e 100644 --- a/slurm/src/slurmcc/__init__.py +++ b/slurm/src/slurmcc/__init__.py @@ -5,7 +5,13 @@ import random from typing import Any, Callable, Optional -import requests +try: + from requests.exceptions import ConnectionError +except ImportError: + # this is only used during live testing with scalelib, so this should never happen + import logging + logging.exception() + ConnectionError = RuntimeError class AzureSlurmError(RuntimeError): @@ -22,7 +28,7 @@ def wrapped(func: Callable) -> Any: def chaos_mode(func: Callable, action: Optional[Callable] = None) -> Callable: def default_action() -> Any: raise random.choice( - [RuntimeError, ValueError, requests.exceptions.ConnectionError] + [RuntimeError, ValueError, ConnectionError] )("Random failure") action = action or default_action