Skip to content

Commit

Permalink
Loosen a dependency package version restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Apr 30, 2019
1 parent 5c066db commit 5682d59
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get_release_command_class():
extras_require={
"build": ["twine", "wheel"],
"docs": docs_requires,
"logging": ["Logbook>=1.1.0,<2.0.0"],
"logging": ["Logbook>=0.12.3,<2.0.0"],
"release": ["releasecmd>=0.0.18,<0.1.0"],
"test": tests_requires,
},
Expand Down
16 changes: 13 additions & 3 deletions subprocrunner/_logger/_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@
from ._null_logger import NullLogger


def _disable_logger(l):
try:
l.disable()
except AttributeError:
l.disabled = True # to support Logbook<1.0.0


try:
import logbook

logger = logbook.Logger("subprocrunner")
logger.disable()
_disable_logger(logger)
LOGBOOK_INSTALLED = True
DEFAULT_ERROR_LOG_LEVEL = logbook.WARNING
except ImportError:
Expand Down Expand Up @@ -50,9 +57,12 @@ def set_logger(is_enable):
return

if is_enable:
logger.enable()
try:
logger.enable()
except AttributeError:
logger.disabled = False # to support Logbook<1.0.0
else:
logger.disable()
_disable_logger(logger)


def set_log_level(log_level):
Expand Down

0 comments on commit 5682d59

Please sign in to comment.