2025-06-19 22:58:50 +00:00
|
|
|
[project]
|
2023-12-30 02:37:49 +00:00
|
|
|
name = "codeflash"
|
2025-06-19 23:30:10 +00:00
|
|
|
dynamic = ["version"]
|
2024-03-21 20:39:36 +00:00
|
|
|
description = "Client for codeflash.ai - automatic code performance optimization, powered by AI"
|
2025-06-19 22:58:50 +00:00
|
|
|
authors = [{ name = "CodeFlash Inc.", email = "contact@codeflash.ai" }]
|
|
|
|
|
requires-python = ">=3.9"
|
2023-12-30 02:37:49 +00:00
|
|
|
readme = "README.md"
|
2025-06-19 23:30:10 +00:00
|
|
|
license = {text = "BSL-1.1"}
|
2024-11-06 00:43:02 +00:00
|
|
|
keywords = [
|
|
|
|
|
"codeflash",
|
|
|
|
|
"performance",
|
|
|
|
|
"optimization",
|
|
|
|
|
"ai",
|
|
|
|
|
"code",
|
|
|
|
|
"machine learning",
|
|
|
|
|
"LLM",
|
2023-12-30 02:37:49 +00:00
|
|
|
]
|
2025-06-19 22:58:50 +00:00
|
|
|
dependencies = [
|
|
|
|
|
"unidiff>=0.7.4",
|
2025-10-14 01:15:01 +00:00
|
|
|
"pytest>=7.0.0",
|
2025-06-19 22:58:50 +00:00
|
|
|
"gitpython>=3.1.31",
|
|
|
|
|
"libcst>=1.0.1",
|
|
|
|
|
"jedi>=0.19.1",
|
2026-01-15 04:55:41 +00:00
|
|
|
# Tree-sitter for multi-language support
|
|
|
|
|
"tree-sitter>=0.23.0",
|
|
|
|
|
"tree-sitter-javascript>=0.23.0",
|
|
|
|
|
"tree-sitter-typescript>=0.23.0",
|
2025-06-19 22:58:50 +00:00
|
|
|
"pytest-timeout>=2.1.0",
|
|
|
|
|
"tomlkit>=0.11.7",
|
|
|
|
|
"junitparser>=3.1.0",
|
|
|
|
|
"pydantic>=1.10.1",
|
|
|
|
|
"humanize>=4.0.0",
|
|
|
|
|
"posthog>=3.0.0",
|
|
|
|
|
"click>=8.1.0",
|
|
|
|
|
"inquirer>=3.0.0",
|
|
|
|
|
"sentry-sdk>=1.40.6,<3.0.0",
|
|
|
|
|
"parameterized>=0.9.0",
|
|
|
|
|
"isort>=5.11.0",
|
|
|
|
|
"dill>=0.3.8",
|
|
|
|
|
"rich>=13.8.1",
|
|
|
|
|
"lxml>=5.3.0",
|
|
|
|
|
"crosshair-tool>=0.0.78",
|
|
|
|
|
"coverage>=7.6.4",
|
|
|
|
|
"line_profiler>=4.2.0",
|
|
|
|
|
"platformdirs>=4.3.7",
|
2025-10-21 01:27:46 +00:00
|
|
|
"pygls>=2.0.0,<3.0.0",
|
2025-07-28 23:46:05 +00:00
|
|
|
"codeflash-benchmark",
|
2025-09-10 22:26:11 +00:00
|
|
|
"filelock",
|
2025-11-23 21:36:13 +00:00
|
|
|
"pytest-asyncio>=1.2.0",
|
2025-06-19 22:58:50 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
[project.urls]
|
|
|
|
|
Homepage = "https://codeflash.ai"
|
|
|
|
|
|
|
|
|
|
[project.scripts]
|
|
|
|
|
codeflash = "codeflash.main:main"
|
|
|
|
|
|
2025-09-28 11:13:14 +00:00
|
|
|
[project.optional-dependencies]
|
|
|
|
|
|
2025-06-19 22:58:50 +00:00
|
|
|
[dependency-groups]
|
|
|
|
|
dev = [
|
|
|
|
|
"ipython>=8.12.0",
|
|
|
|
|
"mypy>=1.13",
|
|
|
|
|
"ruff>=0.7.0",
|
|
|
|
|
"lxml-stubs>=0.5.1",
|
|
|
|
|
"pandas-stubs>=2.2.2.240807, <2.2.3.241009",
|
|
|
|
|
"types-Pygments>=2.18.0.20240506",
|
|
|
|
|
"types-colorama>=0.4.15.20240311",
|
|
|
|
|
"types-decorator>=5.1.8.20240310",
|
|
|
|
|
"types-jsonschema>=4.23.0.20240813",
|
|
|
|
|
"types-requests>=2.32.0.20241016",
|
|
|
|
|
"types-six>=1.16.21.20241009",
|
|
|
|
|
"types-cffi>=1.16.0.20240331",
|
|
|
|
|
"types-openpyxl>=3.1.5.20241020",
|
|
|
|
|
"types-regex>=2024.9.11.20240912",
|
|
|
|
|
"types-python-dateutil>=2.9.0.20241003",
|
|
|
|
|
"types-gevent>=24.11.0.20241230,<25",
|
|
|
|
|
"types-greenlet>=3.1.0.20241221,<4",
|
|
|
|
|
"types-pexpect>=4.9.0.20241208,<5",
|
|
|
|
|
"types-unidiff>=0.7.0.20240505,<0.8",
|
|
|
|
|
"uv>=0.6.2",
|
|
|
|
|
"pre-commit>=4.2.0,<5",
|
|
|
|
|
]
|
2025-10-14 05:13:43 +00:00
|
|
|
tests = [
|
|
|
|
|
"black>=25.9.0",
|
|
|
|
|
"jax>=0.4.30",
|
|
|
|
|
"numpy>=2.0.2",
|
|
|
|
|
"pandas>=2.3.3",
|
|
|
|
|
"pyrsistent>=0.20.0",
|
|
|
|
|
"scipy>=1.13.1",
|
|
|
|
|
"torch>=2.8.0",
|
|
|
|
|
"xarray>=2024.7.0",
|
2026-01-09 19:08:24 +00:00
|
|
|
"eval_type_backport",
|
|
|
|
|
"numba>=0.60.0",
|
|
|
|
|
"tensorflow>=2.20.0",
|
2025-10-14 05:13:43 +00:00
|
|
|
]
|
2025-06-19 22:58:50 +00:00
|
|
|
|
|
|
|
|
[tool.hatch.build.targets.sdist]
|
|
|
|
|
include = ["codeflash"]
|
add exclude sensitive files from package build (#1190)
### **User description**
Adding files to be excluded while building pypi project or avoiding
sensitive files like .env from check in
___
### **PR Type**
enhancement, configuration changes
___
### **Description**
- Added exclusion rules in `pyproject.toml` files to prevent sensitive
and unnecessary files from being included in the package build.
- Excluded files include sensitive files like `.env` and `.pem`,
development files like `.git` and `Dockerfile`, and unnecessary file
types like `*.log` and `*.db`.
- This enhancement improves the security and cleanliness of the package
distribution.
___
### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>pyproject.toml</strong><dd><code>Add exclusion rules
for sensitive and unnecessary files</code> </dd></summary>
<hr>
cli/pyproject.toml
<li>Added an <code>exclude</code> section to specify files and
directories to be <br>excluded from the package build.<br> <li> Included
patterns for sensitive files like <code>.env</code>, <code>.pem</code>,
and <code>secrets.*</code>.<br> <li> Excluded common development and
configuration files such as <code>.git</code>,
<br><code>Dockerfile</code>, and <code>.vscode</code>.<br> <li> Excluded
unnecessary file types like <code>*.log</code>, <code>*.tmp</code>, and
<code>*.db</code>.<br>
</details>
</td>
<td><a
href="https://github.com/codeflash-ai/codeflash/pull/1190/files#diff-0c21298b23605dcadf25950579e3ada906093fa49e7c5f98eaa7f3d816c29d28">+47/-0</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>pyproject.toml</strong><dd><code>Add exclusion rules
for sensitive and unnecessary files</code> </dd></summary>
<hr>
django/aiservice/pyproject.toml
<li>Added an <code>exclude</code> section to specify files and
directories to be <br>excluded from the package build.<br> <li> Included
patterns for sensitive files like <code>.env</code>, <code>.pem</code>,
and <code>secrets.*</code>.<br> <li> Excluded common development and
configuration files such as <code>.git</code>,
<br><code>Dockerfile</code>, and <code>.vscode</code>.<br> <li> Excluded
unnecessary file types like <code>*.log</code>, <code>*.tmp</code>, and
<code>*.db</code>.<br>
</details>
</td>
<td><a
href="https://github.com/codeflash-ai/codeflash/pull/1190/files#diff-1cd1f75beb8e70c006a688caffdd71f14a3babb13cc499ca48f499bd530fca1e">+45/-1</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
___
> 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
request to receive relevant information
2024-11-06 20:44:55 +00:00
|
|
|
exclude = [
|
|
|
|
|
"docs/*",
|
|
|
|
|
"experiments/*",
|
|
|
|
|
"tests/*",
|
|
|
|
|
"*.pyc",
|
|
|
|
|
"__pycache__",
|
|
|
|
|
"*.pyo",
|
|
|
|
|
"*.pyd",
|
|
|
|
|
"*.so",
|
|
|
|
|
"*.dylib",
|
|
|
|
|
"*.dll",
|
|
|
|
|
"*.exe",
|
|
|
|
|
"*.log",
|
|
|
|
|
"*.tmp",
|
|
|
|
|
".env",
|
|
|
|
|
".env.*",
|
|
|
|
|
"**/.env",
|
|
|
|
|
"**/.env.*",
|
|
|
|
|
".env.example",
|
|
|
|
|
"*.pem",
|
|
|
|
|
"*.key",
|
|
|
|
|
"secrets.*",
|
|
|
|
|
"config.yaml",
|
|
|
|
|
"config.json",
|
|
|
|
|
".git",
|
|
|
|
|
".gitignore",
|
|
|
|
|
".gitattributes",
|
|
|
|
|
".github",
|
|
|
|
|
"Dockerfile",
|
|
|
|
|
"docker-compose.yml",
|
|
|
|
|
"*.md",
|
|
|
|
|
"*.txt",
|
|
|
|
|
"*.csv",
|
|
|
|
|
"*.db",
|
|
|
|
|
"*.sqlite3",
|
|
|
|
|
"*.pdf",
|
|
|
|
|
"*.docx",
|
|
|
|
|
"*.xlsx",
|
|
|
|
|
"*.pptx",
|
|
|
|
|
"*.iml",
|
|
|
|
|
".idea",
|
|
|
|
|
".vscode",
|
|
|
|
|
".DS_Store",
|
|
|
|
|
"Thumbs.db",
|
|
|
|
|
"venv",
|
|
|
|
|
"env",
|
|
|
|
|
]
|
2023-12-30 02:37:49 +00:00
|
|
|
|
2025-06-19 22:58:50 +00:00
|
|
|
[tool.hatch.build.targets.wheel]
|
|
|
|
|
exclude = [
|
|
|
|
|
"docs/*",
|
|
|
|
|
"experiments/*",
|
|
|
|
|
"tests/*",
|
|
|
|
|
"*.pyc",
|
|
|
|
|
"__pycache__",
|
|
|
|
|
"*.pyo",
|
|
|
|
|
"*.pyd",
|
|
|
|
|
"*.so",
|
|
|
|
|
"*.dylib",
|
|
|
|
|
"*.dll",
|
|
|
|
|
"*.exe",
|
|
|
|
|
"*.log",
|
|
|
|
|
"*.tmp",
|
|
|
|
|
".env",
|
|
|
|
|
".env.*",
|
|
|
|
|
"**/.env",
|
|
|
|
|
"**/.env.*",
|
|
|
|
|
".env.example",
|
|
|
|
|
"*.pem",
|
|
|
|
|
"*.key",
|
|
|
|
|
"secrets.*",
|
|
|
|
|
"config.yaml",
|
|
|
|
|
"config.json",
|
|
|
|
|
".git",
|
|
|
|
|
".gitignore",
|
|
|
|
|
".gitattributes",
|
|
|
|
|
".github",
|
|
|
|
|
"Dockerfile",
|
|
|
|
|
"docker-compose.yml",
|
|
|
|
|
"*.md",
|
|
|
|
|
"*.txt",
|
|
|
|
|
"*.csv",
|
|
|
|
|
"*.db",
|
|
|
|
|
"*.sqlite3",
|
|
|
|
|
"*.pdf",
|
|
|
|
|
"*.docx",
|
|
|
|
|
"*.xlsx",
|
|
|
|
|
"*.pptx",
|
|
|
|
|
"*.iml",
|
|
|
|
|
".idea",
|
|
|
|
|
".vscode",
|
|
|
|
|
".DS_Store",
|
|
|
|
|
"Thumbs.db",
|
|
|
|
|
"venv",
|
|
|
|
|
"env",
|
|
|
|
|
]
|
2024-03-05 00:15:12 +00:00
|
|
|
|
2023-12-30 02:37:49 +00:00
|
|
|
[tool.mypy]
|
2024-10-23 21:51:27 +00:00
|
|
|
show_error_code_links = true
|
2024-03-06 06:56:10 +00:00
|
|
|
pretty = true
|
|
|
|
|
show_absolute_path = true
|
|
|
|
|
show_error_context = true
|
2024-10-23 21:51:27 +00:00
|
|
|
show_error_end = true
|
2024-03-06 06:56:10 +00:00
|
|
|
strict = true
|
|
|
|
|
warn_unreachable = true
|
2024-10-23 21:51:27 +00:00
|
|
|
install_types = true
|
2024-12-16 23:33:48 +00:00
|
|
|
plugins = ["pydantic.mypy"]
|
2023-12-30 02:37:49 +00:00
|
|
|
|
2024-04-03 22:23:49 +00:00
|
|
|
[[tool.mypy.overrides]]
|
2025-01-18 01:44:24 +00:00
|
|
|
module = ["jedi", "jedi.api.classes", "inquirer", "inquirer.themes", "numba"]
|
2024-04-03 22:23:49 +00:00
|
|
|
ignore_missing_imports = true
|
|
|
|
|
|
2023-12-30 02:37:49 +00:00
|
|
|
[tool.pydantic-mypy]
|
|
|
|
|
init_forbid_extra = true
|
|
|
|
|
init_typed = true
|
|
|
|
|
warn_required_dynamic_aliases = true
|
|
|
|
|
|
2024-10-23 21:51:27 +00:00
|
|
|
[tool.ruff]
|
2025-05-27 17:40:18 +00:00
|
|
|
target-version = "py39"
|
2024-10-23 21:51:27 +00:00
|
|
|
line-length = 120
|
|
|
|
|
fix = true
|
|
|
|
|
show-fixes = true
|
2026-01-29 13:59:12 +00:00
|
|
|
extend-exclude = ["code_to_optimize/", "pie_test_set/", "tests/", "experiments/"]
|
2024-10-23 21:51:27 +00:00
|
|
|
|
2024-04-03 22:23:49 +00:00
|
|
|
[tool.ruff.lint]
|
|
|
|
|
select = ["ALL"]
|
2024-11-14 19:02:14 +00:00
|
|
|
ignore = [
|
2025-05-19 17:27:00 +00:00
|
|
|
"N802",
|
2024-11-14 19:02:14 +00:00
|
|
|
"C901",
|
|
|
|
|
"D100",
|
|
|
|
|
"D101",
|
|
|
|
|
"D102",
|
|
|
|
|
"D103",
|
|
|
|
|
"D105",
|
|
|
|
|
"D107",
|
2025-03-11 21:37:44 +00:00
|
|
|
"D203", # incorrect-blank-line-before-class (incompatible with D211)
|
|
|
|
|
"D213", # multi-line-summary-second-line (incompatible with D212)
|
2024-11-14 19:02:14 +00:00
|
|
|
"S101",
|
|
|
|
|
"S603",
|
|
|
|
|
"S607",
|
|
|
|
|
"COM812",
|
|
|
|
|
"FIX002",
|
|
|
|
|
"PLR0912",
|
|
|
|
|
"PLR0913",
|
|
|
|
|
"PLR0915",
|
|
|
|
|
"TD002",
|
|
|
|
|
"TD003",
|
|
|
|
|
"TD004",
|
2025-03-11 21:37:44 +00:00
|
|
|
"PLR2004",
|
2025-05-19 17:27:00 +00:00
|
|
|
"UP007", # remove once we drop 3.9 support.
|
|
|
|
|
"E501",
|
|
|
|
|
"BLE001",
|
|
|
|
|
"ERA001",
|
|
|
|
|
"TRY003",
|
|
|
|
|
"EM101",
|
|
|
|
|
"T201",
|
|
|
|
|
"PGH004",
|
|
|
|
|
"S301",
|
2025-06-06 03:10:41 +00:00
|
|
|
"D104",
|
2025-06-06 03:29:03 +00:00
|
|
|
"PERF203",
|
2025-06-25 23:23:26 +00:00
|
|
|
"LOG015",
|
2025-08-06 04:01:26 +00:00
|
|
|
"PLC0415",
|
2026-01-29 12:13:02 +00:00
|
|
|
"UP045",
|
|
|
|
|
"TD007",
|
|
|
|
|
"D417",
|
|
|
|
|
"D401",
|
2026-01-29 17:07:47 +00:00
|
|
|
"S110", # try-except-pass - we do this a lot
|
2026-01-29 18:05:22 +00:00
|
|
|
"ARG002", # Unused method argument
|
2026-01-29 14:50:48 +00:00
|
|
|
# Added for multi-language branch
|
|
|
|
|
"FBT001", # Boolean positional argument
|
|
|
|
|
"FBT002", # Boolean default positional argument
|
|
|
|
|
"ANN401", # typing.Any disallowed
|
|
|
|
|
"ARG001", # Unused function argument (common in abstract/interface methods)
|
|
|
|
|
"TRY300", # Consider moving to else block
|
|
|
|
|
"TRY401", # Redundant exception in logging.exception
|
|
|
|
|
"PLR0911", # Too many return statements
|
|
|
|
|
"PLW0603", # Global statement
|
|
|
|
|
"PLW2901", # Loop variable overwritten
|
|
|
|
|
"SIM102", # Nested if statements
|
|
|
|
|
"SIM103", # Return negated condition
|
|
|
|
|
"ANN001", # Missing type annotation
|
|
|
|
|
"PLC0206", # Dictionary items
|
|
|
|
|
"S314", # XML parsing (acceptable for dev tool)
|
|
|
|
|
"S608", # SQL injection (internal use only)
|
|
|
|
|
"S112", # try-except-continue
|
|
|
|
|
"PERF401", # List comprehension suggestion
|
|
|
|
|
"SIM108", # Ternary operator suggestion
|
|
|
|
|
"F841", # Unused variable (often intentional)
|
|
|
|
|
"ANN202", # Missing return type for private functions
|
2024-11-14 19:02:14 +00:00
|
|
|
]
|
2023-12-30 02:37:49 +00:00
|
|
|
|
2024-03-24 01:59:26 +00:00
|
|
|
[tool.ruff.lint.flake8-type-checking]
|
|
|
|
|
strict = true
|
|
|
|
|
runtime-evaluated-base-classes = ["pydantic.BaseModel"]
|
2025-03-11 21:37:44 +00:00
|
|
|
runtime-evaluated-decorators = ["pydantic.validate_call", "pydantic.dataclasses.dataclass"]
|
2024-03-24 01:59:26 +00:00
|
|
|
|
|
|
|
|
[tool.ruff.lint.pep8-naming]
|
|
|
|
|
classmethod-decorators = [
|
|
|
|
|
# Allow Pydantic's `@validator` decorator to trigger class method treatment.
|
|
|
|
|
"pydantic.validator",
|
|
|
|
|
]
|
|
|
|
|
|
2025-03-11 21:37:44 +00:00
|
|
|
[tool.ruff.lint.isort]
|
|
|
|
|
split-on-trailing-comma = false
|
|
|
|
|
|
2024-04-03 22:23:49 +00:00
|
|
|
[tool.ruff.format]
|
|
|
|
|
docstring-code-format = true
|
2024-10-23 21:51:27 +00:00
|
|
|
skip-magic-trailing-comma = true
|
2024-04-03 22:23:49 +00:00
|
|
|
|
2025-06-19 23:30:10 +00:00
|
|
|
[tool.hatch.version]
|
|
|
|
|
source = "uv-dynamic-versioning"
|
|
|
|
|
|
2025-07-28 23:46:05 +00:00
|
|
|
[tool.uv]
|
|
|
|
|
workspace = { members = ["codeflash-benchmark"] }
|
|
|
|
|
|
|
|
|
|
[tool.uv.sources]
|
|
|
|
|
codeflash-benchmark = { workspace = true }
|
|
|
|
|
|
2025-06-19 23:30:10 +00:00
|
|
|
[tool.uv-dynamic-versioning]
|
2023-12-30 02:37:49 +00:00
|
|
|
enable = true
|
|
|
|
|
style = "pep440"
|
|
|
|
|
vcs = "git"
|
|
|
|
|
|
2025-07-01 00:55:13 +00:00
|
|
|
[tool.hatch.build.hooks.version]
|
|
|
|
|
path = "codeflash/version.py"
|
|
|
|
|
template = """# These version placeholders will be replaced by uv-dynamic-versioning during build.
|
|
|
|
|
__version__ = "{version}"
|
2023-12-30 02:37:49 +00:00
|
|
|
"""
|
|
|
|
|
|
2025-07-01 00:55:13 +00:00
|
|
|
|
|
|
|
|
#[tool.hatch.build.hooks.custom]
|
|
|
|
|
#path = "codeflash/update_license_version.py"
|
|
|
|
|
|
|
|
|
|
|
2023-12-30 02:37:49 +00:00
|
|
|
[tool.codeflash]
|
2026-01-15 02:56:06 +00:00
|
|
|
# All paths are relative to this pyproject.toml's directory.
|
2025-03-19 23:00:45 +00:00
|
|
|
module-root = "codeflash"
|
2026-01-15 02:56:06 +00:00
|
|
|
tests-root = "codeflash"
|
2026-01-15 04:55:41 +00:00
|
|
|
benchmarks-root = "tests/benchmarks"
|
2026-01-15 02:56:06 +00:00
|
|
|
ignore-paths = []
|
|
|
|
|
formatter-cmds = ["disabled"]
|
2024-03-07 20:24:47 +00:00
|
|
|
|
2025-07-02 00:40:01 +00:00
|
|
|
[tool.pytest.ini_options]
|
|
|
|
|
filterwarnings = [
|
|
|
|
|
"ignore::pytest.PytestCollectionWarning",
|
2025-07-03 23:20:05 +00:00
|
|
|
]
|
|
|
|
|
markers = [
|
|
|
|
|
"ci_skip: mark test to skip in CI environment",
|
2025-07-02 00:40:01 +00:00
|
|
|
]
|
|
|
|
|
|
2026-01-15 02:56:06 +00:00
|
|
|
|
2024-03-05 00:15:12 +00:00
|
|
|
[build-system]
|
2025-06-19 23:30:10 +00:00
|
|
|
requires = ["hatchling", "uv-dynamic-versioning"]
|
|
|
|
|
build-backend = "hatchling.build"
|
2025-07-23 21:11:14 +00:00
|
|
|
|