Skip to content

Commit d707e0d

Browse files
authored
Updated API, switched to black in precommit, added precommit to dependabot (#137)
1 parent d3f4186 commit d707e0d

File tree

120 files changed

+871
-287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+871
-287
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ updates:
88
directory: "/"
99
schedule:
1010
interval: "daily"
11+
- package-ecosystem: "pre-commit"
12+
directory: "/"
13+
schedule:
14+
interval: "daily"

.pre-commit-config.yaml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
11
repos:
2-
# - repo: https://github.com/psf/black
3-
# rev: 24.10.0
4-
# hooks:
5-
# - id: black
6-
# exclude: ^(src/nebius/api|.direnv|.eggs|.git|.hg|.ipynb_checkpoints|.mypy_cache|.nox|.pytest_cache|.ruff_cache|.tox|.svn|.venv|.vscode|pypackages|_build|buck-out|build|dist|venv)/
2+
- repo: https://github.com/psf/black
3+
rev: 26.1.0
4+
hooks:
5+
- id: black
6+
exclude: ^(docs/generated|src/nebius/api|.direnv|.eggs|.git|.hg|.ipynb_checkpoints|.mypy_cache|.nox|.pytest_cache|.ruff_cache|.tox|.svn|.venv|.vscode|pypackages|_build|buck-out|build|dist|venv)/
77

88
# - repo: https://github.com/pre-commit/mirrors-mypy
99
# rev: v1.13.0
1010
# hooks:
1111
# - id: mypy
1212
# exclude: ^(src/nebius/api|.direnv|.eggs|.git|.hg|.ipynb_checkpoints|.mypy_cache|.nox|.pytest_cache|.ruff_cache|.tox|.svn|.venv|.vscode|pypackages|_build|buck-out|build|dist|venv)/
13-
14-
1513
- repo: https://github.com/astral-sh/ruff-pre-commit
1614
# Ruff version.
17-
rev: v0.7.2
15+
rev: v0.14.13
1816
hooks:
1917
# Run the linter.
2018
- id: ruff
2119
args: [ --fix ]
2220
exclude: ^(docs/generated|src/nebius/api|.direnv|.eggs|.git|.hg|.ipynb_checkpoints|.mypy_cache|.nox|.pytest_cache|.ruff_cache|.tox|.svn|.venv|.vscode|pypackages|_build|buck-out|build|dist|venv)/
23-
2421
# Run the formatter.
25-
- id: ruff-format
26-
exclude: ^(docs/generated|src/nebius/api|.direnv|.eggs|.git|.hg|.ipynb_checkpoints|.mypy_cache|.nox|.pytest_cache|.ruff_cache|.tox|.svn|.venv|.vscode|pypackages|_build|buck-out|build|dist|venv)/
22+
# - id: ruff-format
23+
# exclude: ^(docs/generated|src/nebius/api|.direnv|.eggs|.git|.hg|.ipynb_checkpoints|.mypy_cache|.nox|.pytest_cache|.ruff_cache|.tox|.svn|.venv|.vscode|pypackages|_build|buck-out|build|dist|venv)/
2724

2825
- repo: https://github.com/pre-commit/pre-commit-hooks
29-
rev: v5.0.0
26+
rev: v6.0.0
3027
hooks:
3128
- id: end-of-file-fixer
3229
exclude: ^(docs/generated|src/nebius/api|.direnv|.eggs|.git|.hg|.ipynb_checkpoints|.mypy_cache|.nox|.pytest_cache|.ruff_cache|.tox|.svn|.venv|.vscode|pypackages|_build|buck-out|build|dist|venv)/

nebius-api

Submodule nebius-api updated 104 files

src/nebius/aio/cli_config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ def parent_id(self) -> str:
160160
raise NoParentIdError("Missing parent-id in the profile.")
161161
if not isinstance(self._profile["parent-id"], str):
162162
raise ConfigError(
163-
"Parent id should be a string, got "
164-
f"{type(self._profile['parent-id'])}."
163+
f"Parent id should be a string, got {type(self._profile['parent-id'])}."
165164
)
166165
if self._profile["parent-id"] == "":
167166
raise NoParentIdError("Parent id is empty.")

src/nebius/aio/token/exchangeable.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ class UnsupportedResponseError(SDKError):
6060
def __init__(self, expected: str, resp: Any) -> None:
6161
"""Initialize the error."""
6262
super().__init__(
63-
f"Unsupported response received: expected {expected},"
64-
f" received {type(resp)}"
63+
f"Unsupported response received: expected {expected}, received {type(resp)}"
6564
)
6665

6766

src/nebius/aio/token/file_cache/async_renewable_bearer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ async def _fetch(
107107
:returns: A :class:`Token` instance.
108108
"""
109109
self._trial += 1
110-
log.debug(
111-
f"token fetch requested, attempt: {self._trial}," f"timeout: {timeout}"
112-
)
110+
log.debug(f"token fetch requested, attempt: {self._trial},timeout: {timeout}")
113111
return await self._parent.fetch(timeout=timeout, options=options)
114112

115113
def can_retry(

src/nebius/aio/token/renewable.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ async def _fetch(
172172
:returns: The fetched :class:`Token`.
173173
"""
174174
self._trial += 1
175-
log.debug(
176-
f"token fetch requested, attempt: {self._trial}," f"timeout: {timeout}"
177-
)
175+
log.debug(f"token fetch requested, attempt: {self._trial},timeout: {timeout}")
178176
return await self._parent.fetch(timeout=timeout, options=options)
179177

180178
def can_retry(

0 commit comments

Comments
 (0)