Skip to content

Commit 862eae8

Browse files
committed
Merge branch 'main' into line-profiler
# Conflicts: # codeflash/models/models.py # codeflash/optimization/function_optimizer.py # tests/test_instrument_tests.py # tests/test_test_runner.py
2 parents 29f4c1a + 5052c9e commit 862eae8

25 files changed

+548
-613
lines changed

codeflash/cli_cmds/console.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
)
2828

2929
logger = logging.getLogger("rich")
30-
30+
logging.getLogger('parso').setLevel(logging.WARNING)
3131

3232
def paneled_text(
3333
text: str, panel_args: dict[str, str | bool] | None = None, text_args: dict[str, str] | None = None

codeflash/code_utils/instrument_existing_tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
from codeflash.cli_cmds.console import logger
1010
from codeflash.code_utils.code_utils import get_run_tmp_file, module_name_from_file_path
1111
from codeflash.discovery.functions_to_optimize import FunctionToOptimize
12-
from codeflash.models.models import FunctionParent, TestingMode
13-
from codeflash.verification.test_results import VerificationType
12+
from codeflash.models.models import FunctionParent, TestingMode, VerificationType
1413

1514
if TYPE_CHECKING:
1615
from collections.abc import Iterable

codeflash/discovery/discover_unit_tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
from codeflash.cli_cmds.console import console, logger
1717
from codeflash.code_utils.code_utils import get_run_tmp_file, module_name_from_file_path
1818
from codeflash.code_utils.compat import SAFE_SYS_EXECUTABLE
19-
from codeflash.models.models import CodePosition, FunctionCalledInTest, TestsInFile
20-
from codeflash.verification.test_results import TestType
19+
from codeflash.models.models import CodePosition, FunctionCalledInTest, TestsInFile, TestType
2120

2221
if TYPE_CHECKING:
2322
from codeflash.verification.verification_utils import TestConfig

codeflash/github/PrComment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pydantic.dataclasses import dataclass
55

66
from codeflash.code_utils.time_utils import humanize_runtime
7-
from codeflash.verification.test_results import TestResults
7+
from codeflash.models.models import TestResults
88

99

1010
@dataclass(frozen=True, config={"arbitrary_types_allowed": True})

codeflash/models/models.py

Lines changed: 244 additions & 214 deletions
Large diffs are not rendered by default.

codeflash/optimization/function_optimizer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
cleanup_paths,
2727
file_name_from_test_module_name,
2828
get_run_tmp_file,
29-
module_name_from_file_path,
3029
has_any_async_functions,
30+
module_name_from_file_path,
3131
)
3232
from codeflash.code_utils.config_consts import (
3333
INDIVIDUAL_TESTCASE_TIMEOUT,
@@ -57,6 +57,8 @@
5757
TestFile,
5858
TestFiles,
5959
TestingMode,
60+
TestResults,
61+
TestType,
6062
)
6163
from codeflash.result.create_pr import check_create_pr, existing_tests_source_for
6264
from codeflash.result.critic import coverage_critic, performance_gain, quantity_of_tests_critic, speedup_critic
@@ -79,6 +81,7 @@
7981
from codeflash.models.models import CoverageData, FunctionSource, OptimizedCandidate
8082
from codeflash.verification.verification_utils import TestConfig
8183

84+
8285
class FunctionOptimizer:
8386
def __init__(
8487
self,

codeflash/optimization/optimizer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
from codeflash.discovery.discover_unit_tests import discover_unit_tests
1717
from codeflash.discovery.functions_to_optimize import get_functions_to_optimize
1818
from codeflash.either import is_successful
19-
from codeflash.models.models import ValidCode
19+
from codeflash.models.models import TestType, ValidCode
2020
from codeflash.optimization.function_optimizer import FunctionOptimizer
2121
from codeflash.telemetry.posthog_cf import ph
22-
from codeflash.verification.test_results import TestType
2322
from codeflash.verification.verification_utils import TestConfig
2423

2524
if TYPE_CHECKING:

codeflash/result/critic.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
from __future__ import annotations
22

3+
from typing import TYPE_CHECKING
4+
35
from codeflash.cli_cmds.console import logger
46
from codeflash.code_utils import env_utils
57
from codeflash.code_utils.config_consts import COVERAGE_THRESHOLD, MIN_IMPROVEMENT_THRESHOLD
6-
from codeflash.models.models import CoverageData, OptimizedCandidateResult
7-
from codeflash.verification.test_results import TestType
8+
from codeflash.models.models import TestType
9+
10+
if TYPE_CHECKING:
11+
from codeflash.models.models import CoverageData, OptimizedCandidateResult
812

913

1014
def performance_gain(*, original_runtime_ns: int, optimized_runtime_ns: int) -> float:

codeflash/result/explanation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pydantic.dataclasses import dataclass
44

55
from codeflash.code_utils.time_utils import humanize_runtime
6-
from codeflash.verification.test_results import TestResults
6+
from codeflash.models.models import TestResults
77

88

99
@dataclass(frozen=True, config={"arbitrary_types_allowed": True})

codeflash/verification/codeflash_capture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import dill as pickle
1212

13-
from codeflash.verification.test_results import VerificationType
13+
from codeflash.models.models import VerificationType
1414

1515

1616
def get_test_info_from_stack(tests_root: str) -> tuple[str, str | None, str, str]:

0 commit comments

Comments
 (0)