From 5e7b34a4c74663e76f7f68c26d02bc86d2657269 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Wed, 14 May 2025 12:15:19 +0200 Subject: [PATCH] refactor(clan/lib): move tests for persist.util into clan_lib --- .../persist/util_test.py} | 1 + pkgs/clan-cli/pyproject.toml | 22 +++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) rename pkgs/clan-cli/{clan_cli/tests/test_patch_inventory.py => clan_lib/persist/util_test.py} (99%) diff --git a/pkgs/clan-cli/clan_cli/tests/test_patch_inventory.py b/pkgs/clan-cli/clan_lib/persist/util_test.py similarity index 99% rename from pkgs/clan-cli/clan_cli/tests/test_patch_inventory.py rename to pkgs/clan-cli/clan_lib/persist/util_test.py index 1c19b15d9..955a5770a 100644 --- a/pkgs/clan-cli/clan_cli/tests/test_patch_inventory.py +++ b/pkgs/clan-cli/clan_lib/persist/util_test.py @@ -3,6 +3,7 @@ from typing import Any import pytest from clan_cli.errors import ClanError + from clan_lib.persist.util import ( calc_patches, delete_by_path, diff --git a/pkgs/clan-cli/pyproject.toml b/pkgs/clan-cli/pyproject.toml index 4573fc525..547caa939 100644 --- a/pkgs/clan-cli/pyproject.toml +++ b/pkgs/clan-cli/pyproject.toml @@ -7,7 +7,7 @@ name = "clan" description = "clan cli tool" dynamic = ["version"] scripts = { clan = "clan_cli:main" } -license = {text = "MIT"} +license = { text = "MIT" } [project.urls] Homepage = "https://clan.lol/" @@ -20,12 +20,12 @@ exclude = ["clan_cli.nixpkgs*", "result"] [tool.setuptools.package-data] clan_cli = [ - "**/allowed-packages.json", - "py.typed", - "templates/**/*", - "vms/mimetypes/**/*", - "webui/assets/**/*", - "flash/*.sh" + "**/allowed-packages.json", + "py.typed", + "templates/**/*", + "vms/mimetypes/**/*", + "webui/assets/**/*", + "flash/*.sh", ] [tool.pytest.ini_options] @@ -44,6 +44,12 @@ markers = ["impure", "with_core"] filterwarnings = "default::ResourceWarning" python_files = ["test_*.py", "*_test.py"] +# TODO: cov seems to conflict with xdist +# [tool.coverage.run] +# branch = true +# source = ["clan_lib"] +# omit = ["*/tests/*", "*/test_*.py", "*/*_test.py", "*/conftest.py", "docs.py"] + [tool.mypy] python_version = "3.12" warn_redundant_casts = true @@ -51,5 +57,3 @@ disallow_untyped_calls = true disallow_untyped_defs = true no_implicit_optional = true exclude = "clan_cli.nixpkgs" - -