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

Decouple frozendict support from the library #59

Merged
merged 7 commits into from
Mar 14, 2023

Conversation

DMRobertson
Copy link
Contributor

@DMRobertson DMRobertson commented Mar 14, 2023

Commitwise reviewable.

Effectively fixes #58, by allowing consumers (Synapse) to register a preserialisation callback for immutabledict.

Breaking change; will need a semver major bump. Consumers can add back support for frozendict by registering a preserialisation callback.

Synapse 1.62 started requiring semver-bounds on canonicaljson in matrix-org/synapse#13082, and I couldn't see anything else which imports canonicaljson on my machine. So only brand-new PyPI installations of Synapse 1.61 or earlier should be broken by this change. (Indeed, the point of that PR was exactly to allow us to make this kind of change.)

@DMRobertson DMRobertson changed the title Dmr/decouple frozendict Decouple frozendict support from the library Mar 14, 2023
@DMRobertson DMRobertson marked this pull request as ready for review March 14, 2023 13:38
@DMRobertson DMRobertson requested a review from a team as a code owner March 14, 2023 13:38
Copy link
Contributor

@squahtx squahtx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good approach!

@DMRobertson
Copy link
Contributor Author

Thanks. I'll hold off from merging until I've tested this with Synapse.

README.rst Outdated Show resolved Hide resolved
Co-authored-by: Patrick Cloke <[email protected]>
DMRobertson pushed a commit to matrix-org/synapse that referenced this pull request Mar 14, 2023
@clokep clokep mentioned this pull request Mar 14, 2023
Comment on lines +63 to +64
A preserialisation hook allows you to encode objects which aren't encodable by the
standard library ``JSONEncoder``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you want to update the version or changelog in this PR or will do it separate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was going to leave it---I think we usually make bumping the version number part of a release

@DMRobertson
Copy link
Contributor Author

I tested Synapse against this in matrix-org/synapse@266370c and matrix-org/synapse@03e63ab. This passed trial and sytest, see https://github.com/matrix-org/synapse/actions/runs/4419129723/jobs/7747311770 (The other failures are due to me using a git+https:// dependency rather than a pypi one.) So I'm doubly encouraged that this change works.

@DMRobertson DMRobertson merged commit f17afae into main Mar 14, 2023
@DMRobertson DMRobertson deleted the dmr/decouple-frozendict branch March 14, 2023 19:32
DMRobertson pushed a commit to matrix-org/synapse that referenced this pull request Mar 15, 2023
DMRobertson pushed a commit to matrix-org/synapse that referenced this pull request Mar 15, 2023
DMRobertson pushed a commit to matrix-org/synapse that referenced this pull request Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for immutabledict
3 participants