Skip to content

Commit

Permalink
chore: Bump ruff from 0.7.4 to 0.8.1 (#469)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eran Kampf <eran@ekampf.com>
  • Loading branch information
dependabot[bot] and ekampf authored Dec 2, 2024
1 parent 32a804f commit 66f49ff
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 34 deletions.
2 changes: 1 addition & 1 deletion app/handlers/handlers_connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def twingate_connector_pod_reconciler(
raise kopf.TemporaryError("Pod not running.", delay=1)

# Migrate old pods
pod_spec_version = (k8s_pod and k8s_pod.metadata.annotations or {}).get(
pod_spec_version = ((k8s_pod and k8s_pod.metadata.annotations) or {}).get(
ANNOTATION_POD_SPEC_VERSION
)
if k8s_pod and pod_spec_version != ANNOTATION_POD_SPEC_VERSION_VALUE:
Expand Down
22 changes: 14 additions & 8 deletions app/handlers/tests/test_handlers_resource_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,13 @@ def test_create_resource_no_id(self, resource_factory, mock_api_client):
resource_crd_mock.spec = resource_spec
resource_crd_mock.metadata = K8sMetadata(uid="uid", name="foo", namespace="bar")

with patch(
"app.handlers.handlers_resource_access.ResourceAccessSpec.get_resource",
return_value=resource_crd_mock,
), pytest.raises(kopf.TemporaryError):
with (
patch(
"app.handlers.handlers_resource_access.ResourceAccessSpec.get_resource",
return_value=resource_crd_mock,
),
pytest.raises(kopf.TemporaryError),
):
twingate_resource_access_sync(
body="",
spec=resource_access_spec,
Expand Down Expand Up @@ -257,10 +260,13 @@ def test_create_graphql_error_returns_it(self, resource_factory, mock_api_client
resource_crd_mock.spec = resource_spec
resource_crd_mock.metadata = K8sMetadata(uid="uid", name="foo", namespace="bar")

with patch(
"app.handlers.handlers_resource_access.ResourceAccessSpec.get_resource",
return_value=resource_crd_mock,
), patch("kopf.exception") as kopf_exception_mock:
with (
patch(
"app.handlers.handlers_resource_access.ResourceAccessSpec.get_resource",
return_value=resource_crd_mock,
),
patch("kopf.exception") as kopf_exception_mock,
):
result = twingate_resource_access_sync(
body="",
spec=resource_access_spec,
Expand Down
11 changes: 7 additions & 4 deletions app/tests/test_crds_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,13 @@ def test_spec_get_image_w_imagepolicy_raises_if_no_match(
sample_connector_object_imagepolicy["spec"]["imagePolicy"]["version"] = "^10.0.0"
crd = TwingateConnectorCRD(**sample_connector_object_imagepolicy)

with patch(
"app.version_policy_providers.DockerhubVersionPolicyProvider.get_all_tags",
return_value=["1.0.0", "latest"],
), pytest.raises(ValueError, match="Could not find valid tag for"):
with (
patch(
"app.version_policy_providers.DockerhubVersionPolicyProvider.get_all_tags",
return_value=["1.0.0", "latest"],
),
pytest.raises(ValueError, match="Could not find valid tag for"),
):
crd.spec.get_image()


Expand Down
40 changes: 20 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pytest-randomly = "^3.16.0"
pytest-sugar = "^1.0.0"
pyupgrade = "^3.19.0"
responses = "^0.25.3"
ruff = "^0.7.4"
ruff = "^0.8.1"
syrupy = "^4.8.0"
types-croniter = "^4.0.0.20241030"
types-requests = "^2.32.0.20241016"
Expand Down

0 comments on commit 66f49ff

Please sign in to comment.