Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#243)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: huong-li-nguyen <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and huong-li-nguyen authored Jan 3, 2024
1 parent 02369a0 commit fe28b9d
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 15 deletions.
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
Expand Down Expand Up @@ -37,44 +37,44 @@ repos:

# Linter for json, yaml, md, css and more
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
rev: v4.0.0-alpha.8
hooks:
- id: prettier

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: d2425a6
rev: v2.12.0
hooks:
- id: pretty-format-toml
args: [--autofix]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.261
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.12.1
hooks:
- id: black

- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
rev: 1.7.6
hooks:
- id: bandit
args: [-c, pyproject.toml, -ll]
additional_dependencies: ["bandit[toml]"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
rev: v1.8.0
hooks:
- id: mypy
files: ^vizro-core/src/
additional_dependencies:
- pydantic>=1.10.13, <2 # deliberately pinned to <2 until we bump our pydantic requirement to strictly >=2

- repo: https://github.com/gitleaks/gitleaks
rev: v8.16.4
rev: v8.18.1
hooks:
- id: gitleaks
name: gitleaks (protect)
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ target-version = "py38"
known-first-party = ["vizro"]

[tool.ruff.per-file-ignores]
# Ignore current false positives for pydantic models subclassing across files
# See: https://github.com/astral-sh/ruff/issues/5243#issuecomment-1860776975
"**/models/**" = ["RUF012"]
# Tests can use magic values, assertions, and relative imports, ignore missing docstrings,
# compare to empty string
"**/tests/**" = ["PLR2004", "S101", "TID252", "D100", "D101", "D102", "D103", "PLC1901"]
"**/tests/**" = ["PLR2004", "S101", "TID252", "D100", "D101", "D102", "D103", "PLC1901", "RUF012"]
# Ignore import violations in all __init__.py files
"__init__.py" = ["E402", "F401"]

Expand Down
2 changes: 1 addition & 1 deletion tools/check_package_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ def _check_no_dev_version(package_name, package_version):
package_version = attempted_package_version

with open(env_file, "a") as f:
f.write(f"NEW_RELEASE={str(new_release)}\n")
f.write(f"NEW_RELEASE={new_release!s}\n")
if new_release:
f.write(f"PACKAGE_NAME={package_name}\nPACKAGE_VERSION={package_version}\n")
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨
- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Removed
- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Added
- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Changed
- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Deprecated
- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Fixed
- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Security
- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
2 changes: 1 addition & 1 deletion vizro-core/src/vizro/models/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _is_discriminated_union(field):
new_annotation = _add_to_discriminated_union(field.outer_type_)
elif sub_field is not None and _is_discriminated_union(sub_field):
# Field is a list of discriminated union e.g. components: List[ComponentType].
new_annotation = List[_add_to_discriminated_union(sub_field.outer_type_)] # type: ignore[misc,index]
new_annotation = List[_add_to_discriminated_union(sub_field.outer_type_)] # type: ignore[misc]
else:
raise ValueError(
f"Field '{field_name}' must be a discriminated union or list of discriminated union type. "
Expand Down
6 changes: 3 additions & 3 deletions vizro-core/src/vizro/models/_components/_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ def _make_form_layout(self, component_container):
style={
"gridRowGap": self.layout.row_gap,
"gridColumnGap": self.layout.col_gap,
"gridTemplateColumns": f"repeat({len(self.layout.grid[0])}, minmax({self.layout.col_min_width}, 1fr))", # noqa: E501
"gridTemplateRows": f"repeat({len(self.layout.grid)}, minmax({self.layout.row_min_height}, 1fr))", # noqa: E501
"gridTemplateColumns": f"repeat({len(self.layout.grid[0])}, minmax({self.layout.col_min_width}, 1fr))",
"gridTemplateRows": f"repeat({len(self.layout.grid)}, minmax({self.layout.row_min_height}, 1fr))",
},
className="component_container_grid",
id=self.id,
)


if __name__ == "__main__":
from vizro.models import Layout # noqa: F811
from vizro.models import Layout

Form.update_forward_refs(Layout=Layout)

Expand Down

0 comments on commit fe28b9d

Please sign in to comment.