Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
0d04223ccd build(deps): bump mypy from 1.10.1 to 1.11.0 in /lib/spack/docs (#45337)
Bumps [mypy](https://github.com/python/mypy) from 1.10.1 to 1.11.0.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.10.1...v1.11)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-20 11:25:31 -05:00
2 changed files with 3 additions and 5 deletions

View File

@@ -10,4 +10,4 @@ pytest==8.2.2
isort==5.13.2
black==24.4.2
flake8==7.1.0
mypy==1.10.1
mypy==1.11.0

View File

@@ -358,14 +358,12 @@ def on_package_attributes(**attr_dict):
def _execute_under_condition(func):
@functools.wraps(func)
def _wrapper(instance, *args, **kwargs):
# Support both builders and packages
pkg = instance.pkg if isinstance(instance, spack.builder.Builder) else instance
# If all the attributes have the value we require, then execute
has_all_attributes = all([hasattr(pkg, key) for key in attr_dict])
has_all_attributes = all([hasattr(instance, key) for key in attr_dict])
if has_all_attributes:
has_the_right_values = all(
[
getattr(pkg, key) == value for key, value in attr_dict.items()
getattr(instance, key) == value for key, value in attr_dict.items()
] # NOQA: ignore=E501
)
if has_the_right_values: