-
Notifications
You must be signed in to change notification settings - Fork 32
Allow installation of current 'structlog' major version 21.x #75
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need a processors=processors,
line added here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thank you @grelleum for the PR
@glennmatthews do you think we are good to merge ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR allows using
structlog
major version 21 to be installed withdiffsync
.This fixes issue: #74
Three changes are made:
pylint
version to 2.6.x so thatinvoke tests
will complete successfully after runningpoetry lock
.structlog
versioning to allow 20.x.x or 21.x.x. Ran complete tests to verify compatibility.poetry.lock
file to include currentstructlog
version.