Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #2193

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
- markdown
- rst
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.6
hooks:
- id: ruff-format
- id: ruff
Expand All @@ -47,7 +47,7 @@ repos:
docs/spelling_wordlist.txt|
.gitignore
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.30.0
rev: 0.31.1
hooks:
- id: check-github-actions
- id: check-github-workflows
Expand Down
6 changes: 3 additions & 3 deletions platform_api/handlers/jobs_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,9 @@ def convert_disk_volume_to_json(volume: DiskContainerVolume) -> dict[str, Any]:


def convert_job_to_job_response(job: Job) -> dict[str, Any]:
assert (
job.cluster_name
), "empty cluster name must be already replaced with `default`"
assert job.cluster_name, (
"empty cluster name must be already replaced with `default`"
)
history = job.status_history
current_status = history.current
response_payload: dict[str, Any] = {
Expand Down
2 changes: 1 addition & 1 deletion platform_api/orchestrator/jobs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ async def _setup_pass_config(
) -> JobRequest:
if NEURO_PASSED_CONFIG in job_request.container.env:
raise JobsServiceException(
f"Cannot pass config: ENV '{NEURO_PASSED_CONFIG}' " "already specified"
f"Cannot pass config: ENV '{NEURO_PASSED_CONFIG}' already specified"
)
token = await self._make_pass_config_token(
user.name, cluster_name, job_request.job_id
Expand Down
3 changes: 1 addition & 2 deletions platform_api/orchestrator/kube_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1975,8 +1975,7 @@ def _networking_v1beta1_namespace_url(self) -> str:
@property
def _networking_v1_namespace_url(self) -> str:
return (
f"{self._base_url}/apis/networking.k8s.io/v1"
f"/namespaces/{self._namespace}"
f"{self._base_url}/apis/networking.k8s.io/v1/namespaces/{self._namespace}"
)

@property
Expand Down
3 changes: 1 addition & 2 deletions platform_api/utils/update_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ async def listen_to_updates(
) -> AsyncIterator[Subscription]:
def _listener(*args: Any, **kwargs: Any) -> None:
logger.info(
f"{type(self).__qualname__}: Notified "
f"from channel {self._channel!r}"
f"{type(self).__qualname__}: Notified from channel {self._channel!r}"
)
listener()

Expand Down
18 changes: 9 additions & 9 deletions tests/integration/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ async def delete_job(
url, headers=headers or self._headers
) as response:
if assert_success:
assert (
response.status == HTTPNoContent.status_code
), await response.text()
assert response.status == HTTPNoContent.status_code, (
await response.text()
)

async def drop_job(
self,
Expand All @@ -322,9 +322,9 @@ async def drop_job(
url = self._api_config.generate_job_url(job_id) + "/drop"
async with self._client.post(url, headers=headers or self._headers) as response:
if assert_success:
assert (
response.status == HTTPNoContent.status_code
), await response.text()
assert response.status == HTTPNoContent.status_code, (
await response.text()
)

async def drop_progress(
self,
Expand All @@ -341,9 +341,9 @@ async def drop_progress(
url, json=payload, headers=headers or self._headers
) as response:
if assert_success:
assert (
response.status == HTTPNoContent.status_code
), await response.text()
assert response.status == HTTPNoContent.status_code, (
await response.text()
)


@pytest.fixture
Expand Down
18 changes: 9 additions & 9 deletions tests/integration/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4635,9 +4635,9 @@ async def test_get_jobs_return_corrects_id(
async with client.post(
url, headers=regular_user.headers, json=job_submit
) as response:
assert (
response.status == HTTPAccepted.status_code
), await response.text()
assert response.status == HTTPAccepted.status_code, (
await response.text()
)
result = await response.json()
assert result["status"] in ["pending"]
job_id = result["id"]
Expand Down Expand Up @@ -4958,9 +4958,9 @@ async def test_set_job_status_no_reason(
assert result["error"] == f"Job {{id={job_id}}} has changed"
ok = False
else:
assert (
response.status == HTTPNoContent.status_code
), await response.text()
assert response.status == HTTPNoContent.status_code, (
await response.text()
)
ok = True

if ok:
Expand Down Expand Up @@ -4997,9 +4997,9 @@ async def test_set_job_status_with_details(
assert result["error"] == f"Job {{id={job_id}}} has changed"
ok = False
else:
assert (
response.status == HTTPNoContent.status_code
), await response.text()
assert response.status == HTTPNoContent.status_code, (
await response.text()
)
ok = True

if ok:
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/test_job_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,7 @@ async def test_create_job_pass_config_env_present(
mock_job_request.container.env[NEURO_PASSED_CONFIG] = "anything"
with pytest.raises(
JobsServiceException,
match=f"Cannot pass config: ENV '{NEURO_PASSED_CONFIG}' "
"already specified",
match=f"Cannot pass config: ENV '{NEURO_PASSED_CONFIG}' already specified",
):
await jobs_service.create_job(
job_request=mock_job_request,
Expand Down
Loading