Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
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.0.x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this file should be reverted

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-17

Change License: MIT

Expand Down
12 changes: 12 additions & 0 deletions codeflash/cli_cmds/cmd_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,20 @@ def configure_pyproject_toml(setup_info: SetupInfo) -> None:
formatter_cmds = []
if formatter == "black":
formatter_cmds.append("black $file")
print("checking if black exists")
try:
import black
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should do this checking exactly the same way we run black when we do the formatting. I believe it runs as a subprocess. We should detect with that method if black is installed. The same goes for ruff formatter

except ImportError as e:
print("black not found, installing via pip")
subprocess.run(["pip", "install", "black"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not modify the user environment like this, only recommend the user to install black with this command. same for ruff

elif formatter == "ruff":
formatter_cmds.extend(["ruff check --exit-zero --fix $file", "ruff format $file"])
print("checking if ruff exists")
try:
import ruff
except ImportError as e:
print("ruff not found, installing via pip")
subprocess.run(["pip", "install", "ruff"])
elif formatter == "other":
formatter_cmds.append("your-formatter $file")
click.echo(
Expand Down
4 changes: 2 additions & 2 deletions codeflash/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These version placeholders will be replaced by poetry-dynamic-versioning during `poetry build`.
__version__ = "0.9.2"
__version_tuple__ = (0, 9, 2)
__version__ = "0.0.0.post2491.dev0+2f81f2ca"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should also be reverted.

__version_tuple__ = (0, 0, 0, "post2491", "dev0", "2f81f2ca")
Loading