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

Eliminate jsonmerge dependency #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pharmapsychotic
Copy link

A change for your consideration which removes the jsonmerge dependency.

The jsonmerge library depends on the Rust persistent data structures rpds library which can only be imported into a process once. This creates a problem if you have an application which uses multiple libraries that each use k-diffusion (like diffusers + stablecore for example) and results in PyO3 modules may only be initialized once per interpreter process exception on the second time k-diffusion gets imported.

Since jsonmerge is only used to merge config settings with default settings, this change replaces it with a small equivalent merge_config function.

@akx
Copy link

akx commented Jul 17, 2023

FWIW, jsonmerge only depends on rpds because newer versions of jsonschema (4.18.0+) depend on it.

You can install jsonschema<4.18.0 to not require rpds, which is what jsonmerge==1.9.1 does: avian2/jsonmerge@c002c91

That said, a dependency chain less in favor of 10 lines of code is a win in my books 😁

@akx
Copy link

akx commented Feb 13, 2024

@pharmapsychotic Could you rebase this to fix the conflict? Might eventually get this merged.. 😅

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.

2 participants