Skip to content

Commit f5f2422

Browse files
authored
Fix sed commands and update versions (#553)
1 parent aa5e458 commit f5f2422

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
- id: black
3030

3131
- repo: https://github.com/astral-sh/ruff-pre-commit
32-
rev: v0.5.0
32+
rev: v0.5.4
3333
hooks:
3434
- id: ruff
3535
args: ["--fix"]
@@ -40,14 +40,14 @@ repos:
4040
- id: yesqa
4141

4242
- repo: https://github.com/crate-ci/typos
43-
rev: v1.22.9
43+
rev: v1.23.3
4444
hooks:
4545
- id: typos
4646
args: []
4747
verbose: true
4848

4949
- repo: https://github.com/pre-commit/mirrors-mypy
50-
rev: v1.10.1
50+
rev: v1.11.0
5151
hooks:
5252
- id: mypy
5353
files: jsonargparse.*/.*.py
@@ -88,7 +88,7 @@ repos:
8888
if [ "$CHANGELOG" != "$EXPECTED" ] && [ $(echo $BUMPVERSION_NEW_VERSION | grep -cE "[0-9.]+(\.dev|rc)[0-9]+") = 0 ]; then
8989
if [ $(grep -c "^v$BUMPVERSION_NEW_VERSION " CHANGELOG.rst) = 1 ]; then
9090
echo "Updating the date for v$BUMPVERSION_NEW_VERSION in CHANGELOG.rst";
91-
sed -ir "s|^v$BUMPVERSION_NEW_VERSION .*|$EXPECTED|" CHANGELOG.rst;
91+
sed -i "s|^v$BUMPVERSION_NEW_VERSION .*|$EXPECTED|" CHANGELOG.rst;
9292
git add CHANGELOG.rst;
9393
else
9494
echo "Expected release in CHANGELOG.rst to be "$EXPECTED" or not have a definitive date.";
@@ -137,9 +137,9 @@ repos:
137137
cd "$TEST_DIR";
138138
pip install "pydantic<2";
139139
pytest test_dataclass_like.py;
140-
sed -ir "s|import pydantic|import pydantic.v1 as pydantic|" test_dataclass_like.py;
141-
sed -ir "s|^annotated = .*|annotated = False|" test_dataclass_like.py;
142-
sed -ir "s|test_pydantic_types|_test_pydantic_types|" test_dataclass_like.py;
140+
sed -i "s|import pydantic|import pydantic.v1 as pydantic|" test_dataclass_like.py;
141+
sed -i "s|^annotated = .*|annotated = False|" test_dataclass_like.py;
142+
sed -i "s|test_pydantic_types|_test_pydantic_types|" test_dataclass_like.py;
143143
pip install "pydantic>=2";
144144
pytest test_dataclass_like.py;'
145145
stages: [pre-push]

jsonargparse/_postponed_annotations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def visit_BinOp(self, node: ast.BinOp) -> Union[ast.BinOp, ast.Subscript]:
5151
self.append_union_elts(node.right, elts)
5252
out_node = ast.Subscript(
5353
value=self.new_name_load(union_map),
54-
slice=ast.Index(
54+
slice=ast.Index( # type: ignore[arg-type,call-arg]
5555
value=ast.Tuple(elts=elts, ctx=ast.Load()),
5656
ctx=ast.Load(),
5757
),

jsonargparse/_stubs_resolver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def find(self, node: ast.AST, module_path: str) -> Dict[str, Tuple[Optional[str]
5050
def ast_annassign_to_assign(node: ast.AnnAssign) -> ast.Assign:
5151
return ast.Assign(
5252
targets=[node.target],
53-
value=node.value,
54-
type_ignores=[],
53+
value=node.value, # type: ignore[arg-type]
54+
type_ignores=[], # type: ignore[call-arg]
5555
lineno=node.lineno,
5656
end_lineno=node.lineno,
5757
)

0 commit comments

Comments
 (0)