Skip to content

Commit

Permalink
Merge pull request #556 from weaviate/add-explicit-type-ignore-for-ty…
Browse files Browse the repository at this point in the history
…peshed

Add `# type: ignore` instead of ignoring in `pyproject.toml`
  • Loading branch information
tsmith023 authored Sep 25, 2023
2 parents a4ad50d + e634851 commit 7b7f1ad
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
cache: 'pip' # caching pip dependencies
- run: pip install -r requirements-devel.txt
- name: Run mypy
run: mypy --python-version ${{matrix.version}} ${{ matrix.folder }}
run: mypy --warn-unused-ignores --python-version ${{matrix.version}} ${{ matrix.folder }}

unit-tests:
name: Run Unit Tests
Expand Down
14 changes: 1 addition & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,4 @@ exclude = ["weaviate_grpc", "docs", "mock_tests", "test", "integration"]

[[tool.mypy.overrides]]
module = "weaviate_grpc.*"
ignore_errors = true

[[tool.mypy.overrides]]
module = "grpc.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "validators.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "authlib.integrations.requests_client.*"
ignore_missing_imports = true
ignore_errors = true
1 change: 1 addition & 0 deletions requirements-devel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pytest-httpserver>=1.0.8
mypy>=1.5.1<2.0.0
mypy-extensions==1.0.0
tomli>=2.0.1<3.0.0
types-protobuf>=4.24.0.1<5.0.0
types-requests>=2.31.0.2<3.0.0
types-urllib3>=1.26.25.14<2.0.0
typing_extensions>=4.7.1<5.0.0
Expand Down
2 changes: 1 addition & 1 deletion weaviate/connect/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import TYPE_CHECKING

import requests
from authlib.integrations.requests_client import OAuth2Session
from authlib.integrations.requests_client import OAuth2Session # type: ignore

from weaviate.auth import (
AuthCredentials,
Expand Down
4 changes: 2 additions & 2 deletions weaviate/connect/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from urllib.parse import urlparse

import requests
from authlib.integrations.requests_client import OAuth2Session
from authlib.integrations.requests_client import OAuth2Session # type: ignore
from requests.adapters import HTTPAdapter
from requests.exceptions import ConnectionError as RequestsConnectionError, ReadTimeout
from requests.exceptions import HTTPError as RequestsHTTPError
Expand All @@ -39,7 +39,7 @@
from weaviate.warnings import _Warnings

try:
import grpc
import grpc # type: ignore
from weaviate_grpc import weaviate_pb2_grpc

has_grpc = True
Expand Down
2 changes: 1 addition & 1 deletion weaviate/embedded.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from typing import Dict, Optional

import requests
import validators
import validators # type: ignore

from weaviate import exceptions
from weaviate.exceptions import WeaviateStartUpError
Expand Down
2 changes: 1 addition & 1 deletion weaviate/gql/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

try:
from weaviate_grpc import weaviate_pb2
import grpc
import grpc # type: ignore
except ImportError:
pass

Expand Down
2 changes: 1 addition & 1 deletion weaviate/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import requests
import uuid as uuid_lib
import validators
import validators # type: ignore
from requests.exceptions import JSONDecodeError

from weaviate.exceptions import (
Expand Down

0 comments on commit 7b7f1ad

Please sign in to comment.