Skip to content
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

Convert EventContext to attrs #6218

Merged
merged 7 commits into from Oct 28, 2019

Conversation

@richvdh
Copy link
Member

richvdh commented Oct 18, 2019

The main driver for this was to get a sensible __repr__, but the improved type-safety doesn't hurt.

@richvdh richvdh requested a review from matrix-org/synapse-core Oct 18, 2019
self.prev_state_events = []
self.rejected = False
self.app_service = None
state_group = attr.ib(default=None)

This comment has been minimized.

Copy link
@hawkowl

hawkowl Oct 19, 2019

Contributor

just a note: you can annotate the types in this with type= -- for the optional ones you want to use typing.Optional[int] or whatever. mypy can read that info, and also some editor IDEs can as well, so it can be worth it :)

This comment has been minimized.

Copy link
@richvdh

richvdh Oct 21, 2019

Author Member

mmm, good to know. I'll consider it next time ;)

Copy link
Contributor

hawkowl left a comment

On the old deps builders:

builtins.TypeError: attrib() got an unexpected keyword argument 'factory'

This is an 18.1.0 feature in attrs and we depend on a min of 17.4. We should probably upgrade to 18.1, or fix this here to use default=attrs.Factory() -- your choice (I prefer the former :) ).

@hawkowl hawkowl added this to In progress in Homeserver Task Board via automation Oct 19, 2019
@hawkowl hawkowl moved this from In progress to Review in Homeserver Task Board Oct 19, 2019
@richvdh richvdh requested review from hawkowl and matrix-org/synapse-core Oct 24, 2019
@hawkowl hawkowl dismissed their stale review Oct 28, 2019

old

@hawkowl hawkowl merged commit 9aee289 into develop Oct 28, 2019
18 checks passed
18 checks passed
buildkite/synapse Build #5089 passed (21 minutes, 7 seconds)
Details
buildkite/synapse/check-sample-config Passed (1 minute, 35 seconds)
Details
buildkite/synapse/check-style Passed (1 minute, 53 seconds)
Details
buildkite/synapse/isort Passed (41 seconds)
Details
buildkite/synapse/mypy Passed (46 seconds)
Details
buildkite/synapse/newspaper-newsfile Passed (21 seconds)
Details
buildkite/synapse/packaging Passed (41 seconds)
Details
buildkite/synapse/pipeline Passed (8 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-postgres-9-dot-5 Passed (18 minutes, 7 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite Passed (6 minutes, 24 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite-slash-old-deps Passed (9 minutes, 20 seconds)
Details
buildkite/synapse/python-3-dot-6-slash-sqlite Passed (6 minutes, 17 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-11 Passed (17 minutes, 2 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-9-dot-5 Passed (18 minutes, 31 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-sqlite Passed (6 minutes, 10 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-postgres-9-dot-6-slash-monolith Passed (14 minutes, 25 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-postgres-9-dot-6-slash-workers Passed (15 minutes, 48 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-sqlite-slash-monolith Passed (13 minutes, 56 seconds)
Details
Homeserver Task Board automation moved this from Review to Done Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3 participants
You can’t perform that action at this time.