Skip to content

Config IO abstraction - #140

Merged
semohr merged 9 commits into
mainfrom
config-loader
Oct 18, 2026
Merged

semohr merged 9 commits into
mainfrom
config-loader

Conversation

@semohr

@semohr semohr commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@semohr
semohr changed the base branch from seperate_config to main October 11, 2026 17:45

@pSpitzner pSpitzner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good, but see my few comments

Comment thread plistsync/core/playlist.py Resolved
Comment thread plistsync/services/traktor/playlist.py Resolved
Comment thread plistsync/cli/context.py Resolved
Comment thread plistsync/core/config.py
Comment on lines +76 to +88
if TYPE_CHECKING:
# Set by the typing machinery when instantiated via ``FileIO[X](...)``.
__orig_class__: ClassVar[Any]

def _model_type(self) -> type[M]:
"""Model class carried by the generic subscription."""
try:
return self.__orig_class__.__args__[0]
except AttributeError:
raise TypeError(
f"{type(self).__name__} must be parameterized with a model class, "
"e.g. JsonFileIO[SomeModel](path)."
) from None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like how small this ended up.

One question: this only forces us to use pydantic base models as parents for tokens (but not config classes), right?

I think being to easy-going and making "everything" a pydantic model is bad practice.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

One question: this only forces us to use pydantic base models as parents for tokens (but not config classes), right?

Currently every field we want to use in JsonFileIO should be a pydantic model. I think dataclasses might also work tho 🤔

No need to onboard every other class to pydantic too, I agree we should indeed keep it only for classes that really need the capabilities.

@semohr
semohr changed the base branch from main to seperate_config October 11, 2026 22:00
@semohr

semohr commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Changed the base to seperate_config. Changes should be more clear now

semohr added a commit that referenced this pull request Oct 12, 2026
@semohr
semohr changed the base branch from seperate_config to main October 12, 2026 17:59
@semohr
semohr added this pull request to stack #143 October 15, 2026 10:26
@semohr
semohr merged commit 1b18312 into main Oct 18, 2026
9 of 14 checks passed

This branch had an error being deployed

1 failed deployment
integration_tests — b6398bd8 Deployed Oct 12, 2026 by semohr via test-notebooks (tidal) #568
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