Skip to content

Commit

Permalink
build(deps-dev): bump mypy from 1.0.1 to 1.1.1 (#2274)
Browse files Browse the repository at this point in the history
build(deps-dev): bump mypy from 1.0.1 to 1.1.1

Bumps [mypy](https://github.com/python/mypy) from 1.0.1 to 1.1.1.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](python/mypy@v1.0.1...v1.1.1)

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

Also added type ignores for newly detected type errors.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Iwan Aucamp <aucampia@gmail.com>
  • Loading branch information
dependabot[bot] and aucampia authored Mar 19, 2023
1 parent 394fb50 commit 192e6d1
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 36 deletions.
58 changes: 29 additions & 29 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ lxml = {version = "^4.3.0", optional = true}
[tool.poetry.group.dev.dependencies]
black = "23.1.0"
isort = "^5.10.0"
mypy = "1.0.1"
mypy = "^1.1.0"
lxml-stubs = "^0.4.0"

[tool.poetry.group.tests.dependencies]
Expand Down
3 changes: 2 additions & 1 deletion rdflib/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ def _urlopen(req: Request) -> Any:
# This custom error handling should be removed once all
# supported versions of python support 308.
if ex.code == 308:
req.full_url = ex.headers.get("Location")
# type error: Incompatible types in assignment (expression has type "Optional[Any]", variable has type "str")
req.full_url = ex.headers.get("Location") # type: ignore[assignment]
return _urlopen(req)
else:
raise
Expand Down
4 changes: 2 additions & 2 deletions rdflib/plugins/sparql/aggregates.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, aggregation: CompValue):
self.expr = aggregation.vars
if not aggregation.distinct:
# type error: Cannot assign to a method
self.use_row = self.dont_care # type: ignore[assignment]
self.use_row = self.dont_care # type: ignore[method-assign]
self.distinct = False
else:
self.distinct = aggregation.distinct
Expand Down Expand Up @@ -184,7 +184,7 @@ def __init__(self, aggregation: CompValue):
self.value: Any = None
# DISTINCT would not change the value for MIN or MAX
# type error: Cannot assign to a method
self.use_row = self.dont_care # type: ignore[assignment]
self.use_row = self.dont_care # type: ignore[method-assign]

def set_value(self, bindings: MutableMapping[Variable, Identifier]) -> None:
if self.value is not None:
Expand Down
5 changes: 3 additions & 2 deletions rdflib/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ class ResultRow(Tuple["Identifier", ...]):
def __new__(
cls, values: Mapping["Variable", "Identifier"], labels: List["Variable"]
):
# type error: Generator has incompatible item type "Optional[Any]"; expected "_T_co"
instance = super(ResultRow, cls).__new__(cls, (values.get(v) for v in labels)) # type: ignore[misc]
# type error: Value of type variable "Self" of "__new__" of "tuple" cannot be "ResultRow" [type-var]
# type error: Generator has incompatible item type "Optional[Identifier]"; expected "_T_co" [misc]
instance = super(ResultRow, cls).__new__(cls, (values.get(v) for v in labels)) # type: ignore[type-var, misc]
instance.labels = dict((str(x[1]), x[0]) for x in enumerate(labels))
return instance

Expand Down
3 changes: 2 additions & 1 deletion test/test_graph/test_graph_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def test_3xx(self) -> None:
httpmock.mocks[MethodName.GET].assert_called()
assert len(httpmock.requests[MethodName.GET]) == 10
for request in httpmock.requests[MethodName.GET]:
assert re.match(r"text/turtle", request.headers.get("Accept"))
# type error: Argument 2 to "match" has incompatible type "Optional[Any]"; expected "str"
assert re.match(r"text/turtle", request.headers.get("Accept")) # type: ignore[arg-type]

request_paths = [
request.path for request in httpmock.requests[MethodName.GET]
Expand Down

0 comments on commit 192e6d1

Please sign in to comment.