Skip to content

Commit

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

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

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

Signed-off-by: dependabot[bot] <[email protected]>

* fix type errors

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Iwan Aucamp <[email protected]>
  • Loading branch information
dependabot[bot] and aucampia authored Mar 6, 2023
1 parent 889e8c9 commit a146e0a
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 40 deletions.
60 changes: 28 additions & 32 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 @@ -43,7 +43,7 @@ lxml = {version = "^4.3.0", optional = true}
[tool.poetry.group.dev.dependencies]
black = "22.12.0"
isort = "^5.10.0"
mypy = "0.991"
mypy = "1.0.1"
lxml-stubs = "^0.4.0"

[tool.poetry.group.tests.dependencies]
Expand Down
3 changes: 1 addition & 2 deletions rdflib/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1536,8 +1536,7 @@ def query(
except NotImplementedError:
pass # store has no own implementation

# type error: Subclass of "str" and "Result" cannot exist: would have incompatible method signatures
if not isinstance(result, query.Result): # type: ignore[unreachable]
if not isinstance(result, query.Result):
result = plugin.get(cast(str, result), query.Result)
if not isinstance(processor, query.Processor):
processor = plugin.get(processor, query.Processor)(self)
Expand Down
2 changes: 1 addition & 1 deletion rdflib/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def create_input_source(
location = str(source)
elif isinstance(source, bytes):
data = source
elif hasattr(source, "read") and not isinstance(source, Namespace): # type: ignore[unreachable]
elif hasattr(source, "read") and not isinstance(source, Namespace):
f = source
input_source = InputSource()
if hasattr(source, "encoding"):
Expand Down
4 changes: 4 additions & 0 deletions test/test_graph/test_graph_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ def test_content_negotiation(self) -> None:

with ctx_http_server(ContentNegotiationHandler) as server:
(host, port) = server.server_address
if isinstance(host, (bytes, bytearray)):
host = host.decode("utf-8")
url = f"http://{host}:{port}/foo"
for format in ("xml", "n3", "nt"):
graph = Graph()
Expand All @@ -121,6 +123,8 @@ def test_content_negotiation_no_format(self) -> None:

with ctx_http_server(ContentNegotiationHandler) as server:
(host, port) = server.server_address
if isinstance(host, (bytes, bytearray)):
host = host.decode("utf-8")
url = f"http://{host}:{port}/foo"
graph = Graph()
graph.parse(url)
Expand Down
3 changes: 1 addition & 2 deletions test/test_serializers/test_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ def test_serialize_badformat(simple_graph: Graph) -> None:

def narrow_dest_param(param: DestParmType) -> GraphDestParamType:
assert not (hasattr(param, "write") and hasattr(param, "encoding"))
# type error: Subclass of "IO[bytes]" and "TextIO" cannot exist: would have inconsistent method resolution order
assert not isinstance(param, TextIO) # type: ignore[unreachable]
assert not isinstance(param, TextIO)
return param


Expand Down
3 changes: 1 addition & 2 deletions test/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ def quad_set(
for sn, pn, on, gn in graph.quads((None, None, None, None)):
gn_id: Identifier
if isinstance(graph, Dataset):
# type error: Subclass of "Graph" and "Identifier" cannot exist: would have incompatible method signatures
assert isinstance(gn, Identifier) # type: ignore[unreachable]
assert isinstance(gn, Identifier)
gn_id = gn # type: ignore[unreachable]
elif isinstance(graph, ConjunctiveGraph):
assert isinstance(gn, Graph)
Expand Down
2 changes: 2 additions & 0 deletions test/utils/httpservermock.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ def stop(self) -> None:
@property
def address_string(self) -> str:
(host, port) = self.server.server_address
if isinstance(host, (bytes, bytearray)):
host = host.decode("utf-8")
return f"{host}:{port}"

@property
Expand Down

0 comments on commit a146e0a

Please sign in to comment.