Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.5.4
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -40,14 +40,14 @@ repos:
- id: yesqa

- repo: https://github.com/crate-ci/typos
rev: v1.22.9
rev: v1.23.3
hooks:
- id: typos
args: []
verbose: true

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
rev: v1.11.0
hooks:
- id: mypy
files: jsonargparse.*/.*.py
Expand Down Expand Up @@ -88,7 +88,7 @@ repos:
if [ "$CHANGELOG" != "$EXPECTED" ] && [ $(echo $BUMPVERSION_NEW_VERSION | grep -cE "[0-9.]+(\.dev|rc)[0-9]+") = 0 ]; then
if [ $(grep -c "^v$BUMPVERSION_NEW_VERSION " CHANGELOG.rst) = 1 ]; then
echo "Updating the date for v$BUMPVERSION_NEW_VERSION in CHANGELOG.rst";
sed -ir "s|^v$BUMPVERSION_NEW_VERSION .*|$EXPECTED|" CHANGELOG.rst;
sed -i "s|^v$BUMPVERSION_NEW_VERSION .*|$EXPECTED|" CHANGELOG.rst;
git add CHANGELOG.rst;
else
echo "Expected release in CHANGELOG.rst to be "$EXPECTED" or not have a definitive date.";
Expand Down Expand Up @@ -137,9 +137,9 @@ repos:
cd "$TEST_DIR";
pip install "pydantic<2";
pytest test_dataclass_like.py;
sed -ir "s|import pydantic|import pydantic.v1 as pydantic|" test_dataclass_like.py;
sed -ir "s|^annotated = .*|annotated = False|" test_dataclass_like.py;
sed -ir "s|test_pydantic_types|_test_pydantic_types|" test_dataclass_like.py;
sed -i "s|import pydantic|import pydantic.v1 as pydantic|" test_dataclass_like.py;
sed -i "s|^annotated = .*|annotated = False|" test_dataclass_like.py;
sed -i "s|test_pydantic_types|_test_pydantic_types|" test_dataclass_like.py;
pip install "pydantic>=2";
pytest test_dataclass_like.py;'
stages: [pre-push]
Expand Down
2 changes: 1 addition & 1 deletion jsonargparse/_postponed_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def visit_BinOp(self, node: ast.BinOp) -> Union[ast.BinOp, ast.Subscript]:
self.append_union_elts(node.right, elts)
out_node = ast.Subscript(
value=self.new_name_load(union_map),
slice=ast.Index(
slice=ast.Index( # type: ignore[arg-type,call-arg]
value=ast.Tuple(elts=elts, ctx=ast.Load()),
ctx=ast.Load(),
),
Expand Down
4 changes: 2 additions & 2 deletions jsonargparse/_stubs_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def find(self, node: ast.AST, module_path: str) -> Dict[str, Tuple[Optional[str]
def ast_annassign_to_assign(node: ast.AnnAssign) -> ast.Assign:
return ast.Assign(
targets=[node.target],
value=node.value,
type_ignores=[],
value=node.value, # type: ignore[arg-type]
type_ignores=[], # type: ignore[call-arg]
lineno=node.lineno,
end_lineno=node.lineno,
)
Expand Down