|
| 1 | +[tool] |
| 2 | +[tool.poetry] |
| 3 | +name = "codeflash" |
| 4 | +version = "0.0.0" # Determined by poetry-dynamic-versioning during `poetry build` |
| 5 | +description = "Client for codeflash.ai - automatic code performance optimization, powered by AI" |
| 6 | +license = "BSL-1.1" |
| 7 | +authors = [ "CodeFlash Inc. <[email protected]>"] |
| 8 | +homepage = "https://codeflash.ai" |
| 9 | +readme = "README.md" |
| 10 | +packages = [{ include = "codeflash", format = ["sdist"] }] |
| 11 | +keywords = [ |
| 12 | + "codeflash", |
| 13 | + "performance", |
| 14 | + "optimization", |
| 15 | + "ai", |
| 16 | + "code", |
| 17 | + "machine learning", |
| 18 | + "LLM", |
| 19 | +] |
| 20 | +exclude = [ |
| 21 | + "docs/*", |
| 22 | + "experiments/*", |
| 23 | + "tests/*", |
| 24 | + "*.pyc", |
| 25 | + "__pycache__", |
| 26 | + "*.pyo", |
| 27 | + "*.pyd", |
| 28 | + "*.so", |
| 29 | + "*.dylib", |
| 30 | + "*.dll", |
| 31 | + "*.exe", |
| 32 | + "*.log", |
| 33 | + "*.tmp", |
| 34 | + ".env", |
| 35 | + ".env.*", |
| 36 | + "**/.env", |
| 37 | + "**/.env.*", |
| 38 | + ".env.example", |
| 39 | + "*.pem", |
| 40 | + "*.key", |
| 41 | + "secrets.*", |
| 42 | + "config.yaml", |
| 43 | + "config.json", |
| 44 | + ".git", |
| 45 | + ".gitignore", |
| 46 | + ".gitattributes", |
| 47 | + ".github", |
| 48 | + "Dockerfile", |
| 49 | + "docker-compose.yml", |
| 50 | + "*.md", |
| 51 | + "*.txt", |
| 52 | + "*.csv", |
| 53 | + "*.db", |
| 54 | + "*.sqlite3", |
| 55 | + "*.pdf", |
| 56 | + "*.docx", |
| 57 | + "*.xlsx", |
| 58 | + "*.pptx", |
| 59 | + "*.iml", |
| 60 | + ".idea", |
| 61 | + ".vscode", |
| 62 | + ".DS_Store", |
| 63 | + "Thumbs.db", |
| 64 | + "venv", |
| 65 | + "env", |
| 66 | +] |
| 67 | + |
| 68 | +# Versions here the minimum required versions for the project. These should be as loose as possible. |
| 69 | +[tool.poetry.dependencies] |
| 70 | +python = ">=3.9" |
| 71 | +unidiff = ">=0.7.4" |
| 72 | +pytest = ">=7.0.0,!=8.3.4" |
| 73 | +gitpython = ">=3.1.31" |
| 74 | +libcst = ">=1.0.1" |
| 75 | +jedi = ">=0.19.1" |
| 76 | +timeout-decorator = ">=0.5.0" |
| 77 | +pytest-timeout = ">=2.1.0" |
| 78 | +tomlkit = ">=0.11.7" |
| 79 | +unittest-xml-reporting = ">=3.2.0" |
| 80 | +junitparser = ">=3.1.0" |
| 81 | +pydantic = ">=1.10.1" |
| 82 | +humanize = ">=4.0.0" |
| 83 | +posthog = ">=3.0.0" |
| 84 | +click = ">=8.1.0" |
| 85 | +inquirer = ">=3.0.0" |
| 86 | +sentry-sdk = ">=1.40.6,<3.0.0" |
| 87 | +parameterized = ">=0.9.0" |
| 88 | +isort = ">=5.11.0" |
| 89 | +dill = ">=0.3.8" |
| 90 | +rich = ">=13.8.1" |
| 91 | +lxml = ">=5.3.0" |
| 92 | +crosshair-tool = ">=0.0.78" |
| 93 | +coverage = ">=7.6.4" |
| 94 | +line_profiler=">=4.2.0" #this is the minimum version which supports python 3.13 |
| 95 | +platformdirs = ">=4.3.7" |
| 96 | +[tool.poetry.group.dev] |
| 97 | +optional = true |
| 98 | + |
| 99 | +# Don't forget to install the poetry plugins we use too: |
| 100 | +# poetry self add poetry-dynamic-versioning |
| 101 | + |
| 102 | +[tool.poetry.group.dev.dependencies] |
| 103 | +ipython = ">=8.12.0" |
| 104 | +mypy = ">=1.13" |
| 105 | +ruff = ">=0.7.0" |
| 106 | +lxml-stubs = ">=0.5.1" |
| 107 | +pandas-stubs = ">=2.2.2.240807, <2.2.3.241009" |
| 108 | +types-Pygments = ">=2.18.0.20240506" |
| 109 | +types-colorama = ">=0.4.15.20240311" |
| 110 | +types-decorator = ">=5.1.8.20240310" |
| 111 | +types-jsonschema = ">=4.23.0.20240813" |
| 112 | +types-requests = ">=2.32.0.20241016" |
| 113 | +types-six = ">=1.16.21.20241009" |
| 114 | +types-cffi = ">=1.16.0.20240331" |
| 115 | +types-openpyxl = ">=3.1.5.20241020" |
| 116 | +types-regex = ">=2024.9.11.20240912" |
| 117 | +types-python-dateutil = ">=2.9.0.20241003" |
| 118 | +pytest-cov = "^6.0.0" |
| 119 | +pytest-benchmark = ">=5.1.0" |
| 120 | +types-gevent = "^24.11.0.20241230" |
| 121 | +types-greenlet = "^3.1.0.20241221" |
| 122 | +types-pexpect = "^4.9.0.20241208" |
| 123 | +types-unidiff = "^0.7.0.20240505" |
| 124 | +uv = ">=0.6.2" |
| 125 | +pre-commit = "^4.2.0" |
| 126 | + |
| 127 | +[tool.poetry.build] |
| 128 | +script = "codeflash/update_license_version.py" |
| 129 | + |
| 130 | +[tool.poetry.scripts] |
| 131 | +codeflash = "codeflash.main:main" |
| 132 | + |
| 133 | +[tool.mypy] |
| 134 | +show_error_code_links = true |
| 135 | +pretty = true |
| 136 | +show_absolute_path = true |
| 137 | +show_error_context = true |
| 138 | +show_error_end = true |
| 139 | +strict = true |
| 140 | +warn_unreachable = true |
| 141 | +install_types = true |
| 142 | +plugins = ["pydantic.mypy"] |
| 143 | + |
| 144 | +[[tool.mypy.overrides]] |
| 145 | +module = ["jedi", "jedi.api.classes", "inquirer", "inquirer.themes", "numba"] |
| 146 | +ignore_missing_imports = true |
| 147 | + |
| 148 | +[tool.pydantic-mypy] |
| 149 | +init_forbid_extra = true |
| 150 | +init_typed = true |
| 151 | +warn_required_dynamic_aliases = true |
| 152 | + |
| 153 | +[tool.ruff] |
| 154 | +target-version = "py39" |
| 155 | +line-length = 120 |
| 156 | +fix = true |
| 157 | +show-fixes = true |
| 158 | +exclude = ["code_to_optimize/", "pie_test_set/", "tests/"] |
| 159 | + |
| 160 | +[tool.ruff.lint] |
| 161 | +select = ["ALL"] |
| 162 | +ignore = [ |
| 163 | + "N802", |
| 164 | + "C901", |
| 165 | + "D100", |
| 166 | + "D101", |
| 167 | + "D102", |
| 168 | + "D103", |
| 169 | + "D105", |
| 170 | + "D107", |
| 171 | + "D203", # incorrect-blank-line-before-class (incompatible with D211) |
| 172 | + "D213", # multi-line-summary-second-line (incompatible with D212) |
| 173 | + "S101", |
| 174 | + "S603", |
| 175 | + "S607", |
| 176 | + "COM812", |
| 177 | + "FIX002", |
| 178 | + "PLR0912", |
| 179 | + "PLR0913", |
| 180 | + "PLR0915", |
| 181 | + "TD002", |
| 182 | + "TD003", |
| 183 | + "TD004", |
| 184 | + "PLR2004", |
| 185 | + "UP007", # remove once we drop 3.9 support. |
| 186 | + "E501", |
| 187 | + "BLE001", |
| 188 | + "ERA001", |
| 189 | + "TRY003", |
| 190 | + "EM101", |
| 191 | + "T201", |
| 192 | + "PGH004", |
| 193 | + "S301", |
| 194 | + "D104" |
| 195 | +] |
| 196 | + |
| 197 | +[tool.ruff.lint.flake8-type-checking] |
| 198 | +strict = true |
| 199 | +runtime-evaluated-base-classes = ["pydantic.BaseModel"] |
| 200 | +runtime-evaluated-decorators = ["pydantic.validate_call", "pydantic.dataclasses.dataclass"] |
| 201 | + |
| 202 | +[tool.ruff.lint.pep8-naming] |
| 203 | +classmethod-decorators = [ |
| 204 | + # Allow Pydantic's `@validator` decorator to trigger class method treatment. |
| 205 | + "pydantic.validator", |
| 206 | +] |
| 207 | + |
| 208 | +[tool.ruff.lint.isort] |
| 209 | +split-on-trailing-comma = false |
| 210 | + |
| 211 | +[tool.ruff.format] |
| 212 | +docstring-code-format = true |
| 213 | +skip-magic-trailing-comma = true |
| 214 | + |
| 215 | +[tool.poetry-dynamic-versioning] |
| 216 | +enable = true |
| 217 | +style = "pep440" |
| 218 | +vcs = "git" |
| 219 | + |
| 220 | +[tool.poetry-dynamic-versioning.substitution] |
| 221 | +files = ["codeflash/version.py"] |
| 222 | + |
| 223 | +[tool.poetry-dynamic-versioning.files."codeflash/version.py"] |
| 224 | +persistent-substitution = true |
| 225 | +initial-content = """ |
| 226 | + # These version placeholders will be replaced by poetry-dynamic-versioning during `poetry build`. |
| 227 | + __version__ = "0.0.0" |
| 228 | + __version_tuple__ = (0, 0, 0) |
| 229 | +""" |
| 230 | + |
| 231 | + |
1 | 232 | [tool.codeflash] |
| 233 | +module-root = "codeflash" |
| 234 | +tests-root = "tests" |
| 235 | +benchmarks-root = "tests/benchmarks" |
| 236 | +test-framework = "pytest" |
| 237 | +formatter-cmds = [ |
| 238 | + "uvx ruff check --exit-zero --fix $file", |
| 239 | + "uvx ruff format $file", |
| 240 | +] |
| 241 | + |
| 242 | + |
| 243 | +[build-system] |
| 244 | +requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.2.0,<2.0.0"] |
| 245 | +build-backend = "poetry_dynamic_versioning.backend" |
0 commit comments