Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Nov 8, 2024
2 parents 30764b3 + 37bd312 commit f860cae
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ exclude: .asv

repos:
- repo: https://github.com/crate-ci/typos
rev: v1.27.0
rev: typos-dict-v0.11.35
hooks:
- id: typos

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
rev: v0.7.3
hooks:
- id: ruff
args: [--fix, --unsafe-fixes]
Expand Down
2 changes: 1 addition & 1 deletion src/psygnal/_dataclass_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def is_attrs_class(obj: object) -> TypeGuard[type[AttrsType]]:
"""Return True if the class is an attrs class."""
attr = sys.modules.get("attr", None)
cls = obj if isinstance(obj, type) else type(obj)
return attr.has(cls) if attr is not None else False # type: ignore [no-any-return]
return attr.has(cls) if attr is not None else False


@overload
Expand Down
8 changes: 4 additions & 4 deletions src/psygnal/_evented_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def c(self, val: Sequence[int]):
self.a, self.b = val
class Config:
property_dependencies={'c': ['a', 'b']}
field_dependencies={'c': ['a', 'b']}
"""
deps: Dict[str, Set[str]] = {}

Expand All @@ -330,7 +330,7 @@ class Config:
if cfg_deps:
if not isinstance(cfg_deps, dict): # pragma: no cover
raise TypeError(
f"Config property_dependencies must be a dict, not {cfg_deps!r}"
f"Config field_dependencies must be a dict, not {cfg_deps!r}"
)
for prop, fields in cfg_deps.items():
if prop not in {*model_fields, *cls.__property_setters__}:
Expand All @@ -345,7 +345,7 @@ class Config:
)
deps.setdefault(field, set()).add(prop)
if model_config.get(GUESS_PROPERTY_DEPENDENCIES, False):
# if property_dependencies haven't been explicitly defined, we can glean
# if field_dependencies haven't been explicitly defined, we can glean
# them from the property.fget code object:
# SKIP THIS MAGIC FOR NOW?
for prop, setter in cls.__property_setters__.items():
Expand Down Expand Up @@ -383,7 +383,7 @@ class EventedModel(pydantic.BaseModel, metaclass=EventedMetaclass):
one of the model fields it depends on is mutated you must set one of the
following options in the `Config`:
- `property_dependencies` may be a `Dict[str, List[str]]`, where the
- `field_dependencies` may be a `Dict[str, List[str]]`, where the
keys are the names of properties, and the values are a list of field names
(strings) that the property depends on for its value
- `guess_property_dependencies` may be set to `True` to "guess" property
Expand Down
2 changes: 1 addition & 1 deletion src/psygnal/_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ def _check_nargs(
except ValueError as e:
warnings.warn(
f"{e}. To silence this warning, connect with " "`check_nargs=False`",
stacklevel=2,
stacklevel=4,
)
return None, None, False
try:
Expand Down

0 comments on commit f860cae

Please sign in to comment.