-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce typing and run mypy checks - cloes #474
- Loading branch information
Showing
14 changed files
with
239 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ jobs: | |
pipenv-install-options: "--skip-lock" | ||
ruff: true | ||
black: true | ||
mypy: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[mypy] | ||
allow_redefinition = False | ||
allow_untyped_globals = False | ||
check_untyped_defs = True | ||
disallow_incomplete_defs = True | ||
disallow_subclassing_any = True | ||
disallow_untyped_calls = True | ||
disallow_untyped_decorators = True | ||
disallow_untyped_defs = True | ||
follow_imports = silent | ||
ignore_missing_imports = False | ||
implicit_reexport = False | ||
no_implicit_optional = True | ||
pretty = True | ||
show_error_codes = True | ||
strict_equality = True | ||
warn_no_return = True | ||
warn_return_any = True | ||
warn_unreachable = True | ||
warn_unused_ignores = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Dropped support for python 3.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Package is fully typed and mypy checked. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Configuration for pytest-elasticsearch.""" | ||
from pathlib import Path | ||
from typing import Any, Optional, TypedDict | ||
|
||
from pytest import FixtureRequest | ||
|
||
|
||
class ElasticsearchConfigDict(TypedDict): | ||
"""Typed Config dictionary.""" | ||
|
||
executable: Path | ||
host: str | ||
port: Optional[int] | ||
transport_tcp_port: Optional[int] | ||
cluster_name: str | ||
network_publish_host: str | ||
index_store_type: str | ||
|
||
|
||
def get_config(request: FixtureRequest) -> ElasticsearchConfigDict: | ||
"""Return a dictionary with config options.""" | ||
|
||
def get_elasticsearch_option(option: str) -> Any: | ||
name = "elasticsearch_" + option | ||
return request.config.getoption(name) or request.config.getini(name) | ||
|
||
return ElasticsearchConfigDict( | ||
executable=get_elasticsearch_option("executable"), | ||
host=get_elasticsearch_option("host"), | ||
port=get_elasticsearch_option("port"), | ||
transport_tcp_port=get_elasticsearch_option("transport_tcp_port"), | ||
cluster_name=get_elasticsearch_option("cluster_name"), | ||
network_publish_host=get_elasticsearch_option("network_publish_host"), | ||
index_store_type=get_elasticsearch_option("index_store_type"), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.