From 0c9a8349a6293c626714bab42583f8e8c8da13b2 Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Fri, 5 Jan 2024 13:44:42 +0100 Subject: [PATCH] Added exclude **/tests/openapi_client/** to nix fmt --- formatter.nix | 2 ++ pkgs/clan-cli/clan_cli/webui/schemas.py | 4 ++-- pkgs/clan-cli/pyproject.toml | 7 +++++-- pkgs/clan-cli/tests/openapi_client/models/service.py | 4 ++-- .../tests/openapi_client/models/service_create.py | 4 ++-- pkgs/clan-cli/tests/test_db_api.py | 8 -------- pkgs/ui/README.md | 1 + 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/formatter.nix b/formatter.nix index ee1c751..5d7a76b 100644 --- a/formatter.nix +++ b/formatter.nix @@ -25,6 +25,7 @@ "pkgs/clan-cli".extraPythonPackages = self'.packages.clan-cli.pytestDependencies; }; + treefmt.settings.formatter.nix = { command = "sh"; options = [ @@ -51,6 +52,7 @@ "--" # this argument is ignored by bash ]; includes = [ "*.py" ]; + excludes = [ "**/tests/openapi_client/**" ]; }; }; } diff --git a/pkgs/clan-cli/clan_cli/webui/schemas.py b/pkgs/clan-cli/clan_cli/webui/schemas.py index eee4451..b98b9b7 100644 --- a/pkgs/clan-cli/clan_cli/webui/schemas.py +++ b/pkgs/clan-cli/clan_cli/webui/schemas.py @@ -22,7 +22,7 @@ class Machine(BaseModel): ######################### class ServiceBase(BaseModel): uuid: str = "8e285c0c-4e40-430a-a477-26b3b81e30df" - service_name: str = "Carlo's Printing" + service_name: str = "Carlos Printing" service_type: str = "3D Printing" endpoint_url: str = "http://127.0.0.1:8000" status: str = "unknown" @@ -49,7 +49,7 @@ class EntityBase(BaseModel): ip: str = "127.0.0.1" visible: bool = True other: dict = { - "network": "Carlo's Home Network", + "network": "Carlos Home Network", "roles": ["service repository", "service prosumer"], } diff --git a/pkgs/clan-cli/pyproject.toml b/pkgs/clan-cli/pyproject.toml index 3f48ba3..de8f11a 100644 --- a/pkgs/clan-cli/pyproject.toml +++ b/pkgs/clan-cli/pyproject.toml @@ -31,7 +31,10 @@ warn_redundant_casts = true disallow_untyped_calls = true disallow_untyped_defs = true no_implicit_optional = true -exclude = "clan_cli.nixpkgs" +exclude = [ + "clan_cli.nixpkgs", + "tests/openapi_client", +] [[tool.mypy.overrides]] module = "argcomplete.*" @@ -60,9 +63,9 @@ ignore_missing_imports = true [tool.ruff] line-length = 88 - select = [ "E", "F", "I", "N"] ignore = [ "E501" ] +exclude = ["tests/openapi_client"] [tool.black] line-length = 88 diff --git a/pkgs/clan-cli/tests/openapi_client/models/service.py b/pkgs/clan-cli/tests/openapi_client/models/service.py index 3128a41..14cc136 100644 --- a/pkgs/clan-cli/tests/openapi_client/models/service.py +++ b/pkgs/clan-cli/tests/openapi_client/models/service.py @@ -26,7 +26,7 @@ class Service(BaseModel): Service """ uuid: Optional[StrictStr] = '8e285c0c-4e40-430a-a477-26b3b81e30df' - service_name: Optional[StrictStr] = 'Carlo's Printing' + service_name: Optional[StrictStr] = 'Carlos Printing' service_type: Optional[StrictStr] = '3D Printing' endpoint_url: Optional[StrictStr] = 'http://127.0.0.1:8000' status: Optional[StrictStr] = 'unknown' @@ -71,7 +71,7 @@ class Service(BaseModel): _obj = Service.parse_obj({ "uuid": obj.get("uuid") if obj.get("uuid") is not None else '8e285c0c-4e40-430a-a477-26b3b81e30df', - "service_name": obj.get("service_name") if obj.get("service_name") is not None else 'Carlo's Printing', + "service_name": obj.get("service_name") if obj.get("service_name") is not None else 'Carlos Printing', "service_type": obj.get("service_type") if obj.get("service_type") is not None else '3D Printing', "endpoint_url": obj.get("endpoint_url") if obj.get("endpoint_url") is not None else 'http://127.0.0.1:8000', "status": obj.get("status") if obj.get("status") is not None else 'unknown', diff --git a/pkgs/clan-cli/tests/openapi_client/models/service_create.py b/pkgs/clan-cli/tests/openapi_client/models/service_create.py index d6efb93..3d6b732 100644 --- a/pkgs/clan-cli/tests/openapi_client/models/service_create.py +++ b/pkgs/clan-cli/tests/openapi_client/models/service_create.py @@ -26,7 +26,7 @@ class ServiceCreate(BaseModel): ServiceCreate """ uuid: Optional[StrictStr] = '8e285c0c-4e40-430a-a477-26b3b81e30df' - service_name: Optional[StrictStr] = 'Carlo's Printing' + service_name: Optional[StrictStr] = 'Carlos Printing' service_type: Optional[StrictStr] = '3D Printing' endpoint_url: Optional[StrictStr] = 'http://127.0.0.1:8000' status: Optional[StrictStr] = 'unknown' @@ -71,7 +71,7 @@ class ServiceCreate(BaseModel): _obj = ServiceCreate.parse_obj({ "uuid": obj.get("uuid") if obj.get("uuid") is not None else '8e285c0c-4e40-430a-a477-26b3b81e30df', - "service_name": obj.get("service_name") if obj.get("service_name") is not None else 'Carlo's Printing', + "service_name": obj.get("service_name") if obj.get("service_name") is not None else 'Carlos Printing', "service_type": obj.get("service_type") if obj.get("service_type") is not None else '3D Printing', "endpoint_url": obj.get("endpoint_url") if obj.get("endpoint_url") is not None else 'http://127.0.0.1:8000', "status": obj.get("status") if obj.get("status") is not None else 'unknown', diff --git a/pkgs/clan-cli/tests/test_db_api.py b/pkgs/clan-cli/tests/test_db_api.py index 0fb3383..99f9624 100644 --- a/pkgs/clan-cli/tests/test_db_api.py +++ b/pkgs/clan-cli/tests/test_db_api.py @@ -1,14 +1,6 @@ -import urllib.parse as url -from typing import Any - -from api import TestClient -from openapi_client.api.entities_api import EntitiesApi - - default_entity_did_url = "entity_did=did%3Asov%3Atest%3A1234" default_entity_did = "did:sov:test:1234" default_entity_did2 = "did:sov:test:1235" default_entity_did3 = "did:sov:test:1236" default_entity_did4 = "did:sov:test:1237" default_entity_did5 = "did:sov:test:1238" - diff --git a/pkgs/ui/README.md b/pkgs/ui/README.md index 4a81fd9..ed8aeb6 100644 --- a/pkgs/ui/README.md +++ b/pkgs/ui/README.md @@ -25,4 +25,5 @@ Than run this command: ``` GITEA_TOKEN= nix run .#update-ui-assets ``` + .