Closed Vivalldi closed 1 year ago
@Vivalldi is there a way to do this such that the branching logic for importing pydantic doesn't have to be done in every file?
@Vivalldi is there a way to do this such that the branching logic for importing pydantic doesn't have to be done in every file?
You could do the branching logic in one file and then reimport from all others.
src/merge/deps.py
try:
import pydantic.v1 as pydantic
except ImportError:
import pydantic
src/merge/somefile.py
from src.merge.deps import pydantic
Mobile so can't test but that should be the gist of it
I've gone ahead and created a branch with these same changes in the fern project. Haven't opened a PR yet as I figured you all are already looking into this and I haven't had a chance to test the results yet.
@Vivalldi you're crushing it 🔥
Work in upstream has already started. Will let team generate
Opening based on the recommendation of the readme and understand this'll likely not be merged. Addresses #46