From 6107027ba0a889fa0d6f360f791c8384c3572b29 Mon Sep 17 00:00:00 2001 From: Ximi Hoque Date: Wed, 14 Jan 2026 10:45:58 +0530 Subject: [PATCH 1/2] Delete Project API integration --- labellerr/core/projects/__init__.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/labellerr/core/projects/__init__.py b/labellerr/core/projects/__init__.py index 0ca1c87..c44d4fc 100644 --- a/labellerr/core/projects/__init__.py +++ b/labellerr/core/projects/__init__.py @@ -111,3 +111,21 @@ def _instantiate_project(project_data): ] return projects + +def delete_project(client: "LabellerrClient", project: LabellerrProject): + """ + Deletes a project from the Labellerr API. + + :param client: The client instance. + :param project: The project instance. + :return: The response from the API. + """ + unique_id = str(uuid.uuid4()) + url = f"{constants.BASE_URL}/projects/delete/{project.project_id}?client_id={client.client_id}&uuid={unique_id}" + + return client.make_request( + "POST", + url, + extra_headers={"content-type": "application/json"}, + request_id=unique_id, + ) \ No newline at end of file From 025d23428d6ca09d958efab69236f4f4271bb24a Mon Sep 17 00:00:00 2001 From: Ximi Hoque Date: Fri, 16 Jan 2026 18:18:36 +0530 Subject: [PATCH 2/2] Linter fixes and claude updates --- labellerr/core/projects/__init__.py | 3 +- .../test_template_creation_integration.py | 28 ++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/labellerr/core/projects/__init__.py b/labellerr/core/projects/__init__.py index c44d4fc..3e56ddb 100644 --- a/labellerr/core/projects/__init__.py +++ b/labellerr/core/projects/__init__.py @@ -112,6 +112,7 @@ def _instantiate_project(project_data): return projects + def delete_project(client: "LabellerrClient", project: LabellerrProject): """ Deletes a project from the Labellerr API. @@ -128,4 +129,4 @@ def delete_project(client: "LabellerrClient", project: LabellerrProject): url, extra_headers={"content-type": "application/json"}, request_id=unique_id, - ) \ No newline at end of file + ) diff --git a/tests/integration/test_template_creation_integration.py b/tests/integration/test_template_creation_integration.py index 24944fb..9b45280 100644 --- a/tests/integration/test_template_creation_integration.py +++ b/tests/integration/test_template_creation_integration.py @@ -48,7 +48,9 @@ def _register(template_id: str): # Note: Cleanup not possible yet - template deletion API not implemented if templates_to_cleanup: - print(f"\n⚠ Template deletion not yet implemented - {len(templates_to_cleanup)} template(s) remain in system") + print( + f"\n⚠ Template deletion not yet implemented - {len(templates_to_cleanup)} template(s) remain in system" + ) @pytest.fixture(scope="session", autouse=True) @@ -104,7 +106,9 @@ def integration_client(): class TestTemplateCreationIntegration: """Integration tests for template creation with real API calls""" - def test_create_template_single_bbox_question(self, integration_client, cleanup_templates): + def test_create_template_single_bbox_question( + self, integration_client, cleanup_templates + ): """ Test creating a template with a single bounding box question. Verifies template creation with geometric annotation type. @@ -134,7 +138,9 @@ def test_create_template_single_bbox_question(self, integration_client, cleanup_ print(f"\n✓ Created template: {template.annotation_template_id}") - def test_create_template_multiple_questions(self, integration_client, cleanup_templates): + def test_create_template_multiple_questions( + self, integration_client, cleanup_templates + ): """ Test creating a template with multiple questions of different types. Verifies: @@ -182,7 +188,9 @@ def test_create_template_multiple_questions(self, integration_client, cleanup_te assert template.annotation_template_id is not None print(f"\n✓ Created multi-question template: {template.annotation_template_id}") - def test_create_template_all_geometric_types(self, integration_client, cleanup_templates): + def test_create_template_all_geometric_types( + self, integration_client, cleanup_templates + ): """ Test creating a template with ALL geometric question types in one template. Tests: bounding_box, polygon, polyline, dot @@ -231,7 +239,9 @@ def test_create_template_all_geometric_types(self, integration_client, cleanup_t f"\n✓ Created template with all geometric types: {template.annotation_template_id}" ) - def test_create_template_all_choice_and_input_types(self, integration_client, cleanup_templates): + def test_create_template_all_choice_and_input_types( + self, integration_client, cleanup_templates + ): """ Test creating a template with ALL choice and input question types. Tests: radio, boolean, select, dropdown, input @@ -294,7 +304,9 @@ def test_create_template_all_choice_and_input_types(self, integration_client, cl f"\n✓ Created template with all choice and input types: {template.annotation_template_id}" ) - def test_list_templates_and_all_data_types(self, integration_client, cleanup_templates): + def test_list_templates_and_all_data_types( + self, integration_client, cleanup_templates + ): """ Test listing templates for all data types and verify list functionality. Creates one template for video data type, then lists all data types. @@ -450,7 +462,9 @@ def test_validation_errors(self, integration_client): class TestTemplatePropertiesIntegration: """Integration tests for template properties and operations""" - @pytest.mark.skip(reason="Template update/delete operations not yet implemented - placeholder for future feature") + @pytest.mark.skip( + reason="Template update/delete operations not yet implemented - placeholder for future feature" + ) def test_template_update_operations_not_implemented(self): """ Placeholder test for template update operations.