Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ line-length = 79
lint.select = [
"ALL",
]
lint.extend-select = [ "ANN", "PGH003", "PYI" ]
lint.ignore = [
# Ruff warns that this conflicts with the formatter.
"COM812",
Expand All @@ -135,6 +136,7 @@ lint.ignore = [
# helping.
"PLR0913",
]
lint.explicit-preview-rules = true
lint.per-file-ignores."doccmd_*.py" = [
# Allow asserts in docs.
"S101",
Expand All @@ -158,6 +160,7 @@ lint.flake8-tidy-imports.banned-api."typing.cast".msg = """\
typing.cast is banned: use explicit type narrowing or a typed variable instead.\
"""
lint.pydocstyle.convention = "google"
lint.preview = true

[tool.pylint]
# Disable the message, report, category or checker with the given id(s). You
Expand Down Expand Up @@ -405,6 +408,23 @@ typeCheckingMode = "strict"
enableTypeIgnoreComments = false
reportUnnecessaryTypeIgnoreComment = true

[tool.ty]
rules.blanket-ignore-comment = "error"
rules.division-by-zero = "warn"
rules.dynamic-function-decorator-return = "error"
rules.missing-type-argument = "error"
rules.possibly-missing-attribute = "warn"
rules.possibly-missing-import = "warn"
rules.possibly-unresolved-reference = "warn"
rules.unsound-assignment = "error"
rules.unsound-return-statement = "error"
rules.unsound-yield = "error"
rules.unsupported-dynamic-base = "warn"
terminal.error-on-warning = true
analysis.respect-type-ignore-comments = false
analysis.strict-equality-semantics = true
analysis.strict-generic-narrowing = true

[tool.pytest]
log_cli = true
xfail_strict = true
Expand Down
1 change: 1 addition & 0 deletions spelling_private_dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ todo
traceback
travis
txt
ty
unmocked
untyped
url
Expand Down
2 changes: 1 addition & 1 deletion src/vws/_model_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def access_token_from_response(*, response: Response) -> tuple[str, float]:
raise ModelTargetOAuth2Error(response=response)

response_data = dict(json.loads(s=response.text))
return response_data["access_token"], float(response_data["expires_in"])
return response_data["access_token"], float(response_data["expires_in"]) # ty: ignore[unsound-return-statement]


@beartype(conf=BeartypeConf(is_pep484_tower=True))
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def fixture_image_file(
file = tmp_path / "image.jpg"
buffer = high_quality_image.getvalue()
_ = file.write_bytes(data=buffer)
mode: Literal["r+b", "rb"] = request.param
mode: Literal["r+b", "rb"] = request.param # ty: ignore[unsound-assignment]
with file.open(mode=mode) as file_obj:
yield file_obj

Expand Down