Skip to content

Make config_sources a classmethod rather than a class property #109

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sneakers-the-rat
Copy link
Collaborator

@sneakers-the-rat sneakers-the-rat commented Feb 23, 2025

python 3.13 removed the ability to use @classmethods and @property together - https://docs.python.org/3.13/library/functions.html#classmethod

This causes a bug when using ids to load configs like:

>       globs = [src.rglob("*.y*ml") for src in cls.config_sources]
E       TypeError: 'method' object is not iterable

so this is just a PR to switch it to being a classmethod.

first committing updated ci action that tests against 3.13 to confirm failure, then committing fix.

While refactoring the method, i noticed that usages were not being detected correctly by pycharm. this was because of the generic TypeVar i was using incorrectly rather than the Self annotation, which is the correct annotation for classmethods that behave like constructors of subclasses, so i also fixed that.


📚 Documentation preview 📚: https://miniscope-io--109.org.readthedocs.build/en/109/

@sneakers-the-rat sneakers-the-rat added the bug Something isn't working label Feb 23, 2025
@coveralls
Copy link
Collaborator

coveralls commented Feb 23, 2025

Coverage Status

coverage: 79.599% (+0.08%) from 79.516%
when pulling bb09028 on bugfix-config-sources-property
into 975151f on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants