Allow installation of current 'structlog' major version 21.x#75
Conversation
|
Looks like there is a breaking change that we need to account for Line 45 in 3c3060f |
|
Thanks @dgarros - I will look further into this as see how these changes affects DiffSync. |
…ry/except clause.
diffsync/logging.py
Outdated
| structlog_float_version = float(".".join(structlog.__version__.split(".")[:2])) | ||
| if structlog_float_version < 21.2: | ||
| return True |
There was a problem hiding this comment.
This looks pretty gross. Can we use packaging.Version objects here instead? Something like:
from packaging import version
if version.parse(structlog.__version__) < version.Version("21.2.0"):There was a problem hiding this comment.
Great suggestion - I've implemented the change.
| structlog.processors.StackInfoRenderer(), | ||
| structlog.processors.format_exc_info, | ||
| structlog.dev.ConsoleRenderer(), | ||
| ], |
There was a problem hiding this comment.
Don't we need a processors=processors, line added here?
There was a problem hiding this comment.
Indeed, it got lost somewhere in the experimentation phase. Added this back in.
|
The structlog change in 21.2.0 and above changes behavior with regards to the use of When using 21.2.0 or newer and either The code added here determines if the |
|
Found another issue in my code. It looks like |
|
For compatibility with Python 3.9, I changed: to |
dgarros
left a comment
There was a problem hiding this comment.
LGTM thank you @grelleum for the PR
@glennmatthews do you think we are good to merge ?

This PR allows using
structlogmajor version 21 to be installed withdiffsync.This fixes issue: #74
Three changes are made:
pylintversion to 2.6.x so thatinvoke testswill complete successfully after runningpoetry lock.structlogversioning to allow 20.x.x or 21.x.x. Ran complete tests to verify compatibility.poetry.lockfile to include currentstructlogversion.