Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
de6b7aa
codeflash error handle when remote is empty
Saga4 Feb 19, 2025
fa9911d
check formatter during init
aseembits93 Feb 19, 2025
fe71b4f
Update cmd_init.py
aseembits93 Feb 19, 2025
f044c50
suggest installing via pip
aseembits93 Feb 19, 2025
895c447
Update cmd_init.py
aseembits93 Feb 19, 2025
3510312
add auditwall.py
KRRT7 Feb 19, 2025
3f524c2
first pass
KRRT7 Feb 19, 2025
484859d
Merge pull request #10 from codeflash-ai/function-optimizer-refactor
alvin-r Feb 20, 2025
474d385
Merge pull request #21 from codeflash-ai/cf-495-2
misrasaurabh1 Feb 20, 2025
c93a7ca
Merge pull request #20 from codeflash-ai/fix/issue_19
Saga4 Feb 20, 2025
0cab511
Use python >= 3.9 instead of ^3.9
PaleNeutron Feb 21, 2025
414ac44
second pass
KRRT7 Feb 22, 2025
9139c43
fix tests
KRRT7 Feb 22, 2025
a6da525
Don't display result if INIT_STATE_TEST
davidgirdwood1 Feb 24, 2025
488d4fa
Use the to_name()
davidgirdwood1 Feb 25, 2025
a304b25
Merge pull request #25 from codeflash-ai/dg_report_table
davidgirdwood1 Feb 25, 2025
4469fac
Use python >= 3.9 instead of ^3.9
misrasaurabh1 Feb 25, 2025
02cfca0
release/v0.10.0
misrasaurabh1 Feb 26, 2025
680d0da
Merge pull request #29 from codeflash-ai/release/v0.10.0
misrasaurabh1 Feb 26, 2025
cc1a0b9
fix tests failing
KRRT7 Feb 22, 2025
6839161
Update unit-tests.yaml
KRRT7 Feb 26, 2025
7c47781
add license notice.
KRRT7 Feb 26, 2025
56172db
Update _auditwall.py
KRRT7 Feb 28, 2025
617a888
Merge remote-tracking branch 'origin/main' into blocking-wall-FOR
KRRT7 Feb 28, 2025
c118a16
new way
KRRT7 Mar 17, 2025
48121e9
update
KRRT7 Mar 17, 2025
875dc69
Update test_runner.py
KRRT7 Mar 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: uvx poetry install --with dev

- name: Unit tests
run: uvx poetry run pytest tests/ --cov --cov-report=xml
run: uvx poetry run pytest tests/ --cov --cov-report=xml -vv

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
Expand Down
4 changes: 2 additions & 2 deletions codeflash/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Business Source License 1.1
Parameters

Licensor: CodeFlash Inc.
Licensed Work: Codeflash Client version 0.9.x
Licensed Work: Codeflash Client version 0.10.x
The Licensed Work is (c) 2024 CodeFlash Inc.

Additional Use Grant: None. Production use of the Licensed Work is only permitted
Expand All @@ -13,7 +13,7 @@ Additional Use Grant: None. Production use of the Licensed Work is only permitte
Platform. Please visit codeflash.ai for further
information.

Change Date: 2029-01-06
Change Date: 2029-02-25

Change License: MIT

Expand Down
30 changes: 21 additions & 9 deletions codeflash/cli_cmds/cmd_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,26 @@ def collect_setup_info() -> SetupInfo:
carousel=True,
)

git_remote = ""
try:
repo = Repo(str(module_root), search_parent_directories=True)
git_remotes = get_git_remotes(repo)
if len(git_remotes) > 1:
git_remote = inquirer_wrapper(
inquirer.list_input,
message="What git remote do you want Codeflash to use for new Pull Requests? ",
choices=git_remotes,
default="origin",
carousel=True,
)
if git_remotes: # Only proceed if there are remotes
if len(git_remotes) > 1:
git_remote = inquirer_wrapper(
inquirer.list_input,
message="What git remote do you want Codeflash to use for new Pull Requests? ",
choices=git_remotes,
default="origin",
carousel=True,
)
else:
git_remote = git_remotes[0]
else:
git_remote = git_remotes[0]
click.echo(
"No git remotes found. You can still use Codeflash locally, but you'll need to set up a remote "
"repository to use GitHub features."
)
except InvalidGitRepositoryError:
git_remote = ""

Expand Down Expand Up @@ -587,6 +594,11 @@ def configure_pyproject_toml(setup_info: SetupInfo) -> None:
)
elif formatter == "don't use a formatter":
formatter_cmds.append("disabled")
if formatter in ["black", "ruff"]:
try:
result = subprocess.run([formatter], capture_output=True, check=False)
except FileNotFoundError as e:
click.echo(f"⚠️ Formatter not found: {formatter}, please ensure it is installed")
codeflash_section["formatter-cmds"] = formatter_cmds
# Add the 'codeflash' section, ensuring 'tool' section exists
tool_section = pyproject_data.get("tool", tomlkit.table())
Expand Down
4 changes: 3 additions & 1 deletion codeflash/cli_cmds/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
from contextlib import contextmanager
from itertools import cycle
from typing import TYPE_CHECKING, Generator
from typing import TYPE_CHECKING

from rich.console import Console
from rich.logging import RichHandler
Expand All @@ -13,6 +13,8 @@
from codeflash.cli_cmds.logging_config import BARE_LOGGING_FORMAT

if TYPE_CHECKING:
from collections.abc import Generator

from rich.progress import TaskID

DEBUG_MODE = logging.getLogger().getEffectiveLevel() == logging.DEBUG
Expand Down
12 changes: 8 additions & 4 deletions codeflash/github/PrComment.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ class PrComment:
winning_benchmarking_test_results: TestResults

def to_json(self) -> dict[str, Union[dict[str, dict[str, int]], int, str]]:

report_table = {
test_type.to_name(): result
for test_type, result in self.winning_behavioral_test_results.get_test_pass_fail_report_by_type().items()
if test_type.to_name()
}

return {
"optimization_explanation": self.optimization_explanation,
"best_runtime": humanize_runtime(self.best_runtime),
Expand All @@ -29,10 +36,7 @@ def to_json(self) -> dict[str, Union[dict[str, dict[str, int]], int, str]]:
"speedup_x": self.speedup_x,
"speedup_pct": self.speedup_pct,
"loop_count": self.winning_benchmarking_test_results.number_of_loops(),
"report_table": {
test_type.to_name(): result
for test_type, result in self.winning_behavioral_test_results.get_test_pass_fail_report_by_type().items()
},
"report_table": report_table
}


Expand Down
Loading
Loading