Skip to content

Commit c262f3c

Browse files
Merge branch 'main' into fix/jest30-pnpm-resolution
2 parents b4ea8b6 + fc9cdf8 commit c262f3c

28 files changed

Lines changed: 1259 additions & 1922 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,5 @@ tessl.json
268268

269269
# Tessl auto-generates AGENTS.md on install; ignore to avoid cluttering git status
270270
AGENTS.md
271+
.serena/
272+
.codeflash/

LICENSE

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
Business Source License 1.1
2+
3+
Parameters
4+
5+
Licensor: CodeFlash Inc.
6+
Licensed Work: Codeflash Client version 0.20.x
7+
The Licensed Work is (c) 2024 CodeFlash Inc.
8+
9+
Additional Use Grant: None. Production use of the Licensed Work is only permitted
10+
if you have entered into a separate written agreement
11+
with CodeFlash Inc. for production use in connection
12+
with a subscription to CodeFlash's Code Optimization
13+
Platform. Please visit codeflash.ai for further
14+
information.
15+
16+
Change Date: 2030-01-26
17+
18+
Change License: MIT
19+
20+
Notice
21+
22+
The Business Source License (this document, or the “License”) is not an Open
23+
Source license. However, the Licensed Work will eventually be made available
24+
under an Open Source License, as stated in this License.
25+
26+
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
27+
“Business Source License” is a trademark of MariaDB Corporation Ab.
28+
29+
-----------------------------------------------------------------------------
30+
31+
Business Source License 1.1
32+
33+
Terms
34+
35+
The Licensor hereby grants you the right to copy, modify, create derivative
36+
works, redistribute, and make non-production use of the Licensed Work. The
37+
Licensor may make an Additional Use Grant, above, permitting limited
38+
production use.
39+
40+
Effective on the Change Date, or the fourth anniversary of the first publicly
41+
available distribution of a specific version of the Licensed Work under this
42+
License, whichever comes first, the Licensor hereby grants you rights under
43+
the terms of the Change License, and the rights granted in the paragraph
44+
above terminate.
45+
46+
If your use of the Licensed Work does not comply with the requirements
47+
currently in effect as described in this License, you must purchase a
48+
commercial license from the Licensor, its affiliated entities, or authorized
49+
resellers, or you must refrain from using the Licensed Work.
50+
51+
All copies of the original and modified Licensed Work, and derivative works
52+
of the Licensed Work, are subject to this License. This License applies
53+
separately for each version of the Licensed Work and the Change Date may vary
54+
for each version of the Licensed Work released by Licensor.
55+
56+
You must conspicuously display this License on each original or modified copy
57+
of the Licensed Work. If you receive the Licensed Work in original or
58+
modified form from a third party, the terms and conditions set forth in this
59+
License apply to your use of that work.
60+
61+
Any use of the Licensed Work in violation of this License will automatically
62+
terminate your rights under this License for the current and all other
63+
versions of the Licensed Work.
64+
65+
This License does not grant you any right in any trademark or logo of
66+
Licensor or its affiliates (provided that you may use a trademark or logo of
67+
Licensor as expressly required by this License).
68+
69+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
70+
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
71+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
72+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
73+
TITLE.
74+
75+
MariaDB hereby grants you permission to use this License’s text to license
76+
your works, and to refer to it using the trademark “Business Source License”,
77+
as long as you comply with the Covenants of Licensor below.
78+
79+
Covenants of Licensor
80+
81+
In consideration of the right to use this License’s text and the “Business
82+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
83+
other recipients of the licensed work to be provided by Licensor:
84+
85+
1. To specify as the Change License the GPL Version 2.0 or any later version,
86+
or a license that is compatible with GPL Version 2.0 or a later version,
87+
where “compatible” means that software provided under the Change License can
88+
be included in a program with software provided under GPL Version 2.0 or a
89+
later version. Licensor may specify additional Change Licenses without
90+
limitation.
91+
92+
2. To either: (a) specify an additional grant of rights to use that does not
93+
impose any additional restriction on the right granted in this License, as
94+
the Additional Use Grant; or (b) insert the text “None”.
95+
96+
3. To specify a Change Date.
97+
98+
4. Not to modify this License in any other way.

codeflash-benchmark/LICENSE

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
Business Source License 1.1
2+
3+
Parameters
4+
5+
Licensor: CodeFlash Inc.
6+
Licensed Work: Codeflash Client version 0.20.x
7+
The Licensed Work is (c) 2024 CodeFlash Inc.
8+
9+
Additional Use Grant: None. Production use of the Licensed Work is only permitted
10+
if you have entered into a separate written agreement
11+
with CodeFlash Inc. for production use in connection
12+
with a subscription to CodeFlash's Code Optimization
13+
Platform. Please visit codeflash.ai for further
14+
information.
15+
16+
Change Date: 2030-01-26
17+
18+
Change License: MIT
19+
20+
Notice
21+
22+
The Business Source License (this document, or the “License”) is not an Open
23+
Source license. However, the Licensed Work will eventually be made available
24+
under an Open Source License, as stated in this License.
25+
26+
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
27+
“Business Source License” is a trademark of MariaDB Corporation Ab.
28+
29+
-----------------------------------------------------------------------------
30+
31+
Business Source License 1.1
32+
33+
Terms
34+
35+
The Licensor hereby grants you the right to copy, modify, create derivative
36+
works, redistribute, and make non-production use of the Licensed Work. The
37+
Licensor may make an Additional Use Grant, above, permitting limited
38+
production use.
39+
40+
Effective on the Change Date, or the fourth anniversary of the first publicly
41+
available distribution of a specific version of the Licensed Work under this
42+
License, whichever comes first, the Licensor hereby grants you rights under
43+
the terms of the Change License, and the rights granted in the paragraph
44+
above terminate.
45+
46+
If your use of the Licensed Work does not comply with the requirements
47+
currently in effect as described in this License, you must purchase a
48+
commercial license from the Licensor, its affiliated entities, or authorized
49+
resellers, or you must refrain from using the Licensed Work.
50+
51+
All copies of the original and modified Licensed Work, and derivative works
52+
of the Licensed Work, are subject to this License. This License applies
53+
separately for each version of the Licensed Work and the Change Date may vary
54+
for each version of the Licensed Work released by Licensor.
55+
56+
You must conspicuously display this License on each original or modified copy
57+
of the Licensed Work. If you receive the Licensed Work in original or
58+
modified form from a third party, the terms and conditions set forth in this
59+
License apply to your use of that work.
60+
61+
Any use of the Licensed Work in violation of this License will automatically
62+
terminate your rights under this License for the current and all other
63+
versions of the Licensed Work.
64+
65+
This License does not grant you any right in any trademark or logo of
66+
Licensor or its affiliates (provided that you may use a trademark or logo of
67+
Licensor as expressly required by this License).
68+
69+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
70+
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
71+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
72+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
73+
TITLE.
74+
75+
MariaDB hereby grants you permission to use this License’s text to license
76+
your works, and to refer to it using the trademark “Business Source License”,
77+
as long as you comply with the Covenants of Licensor below.
78+
79+
Covenants of Licensor
80+
81+
In consideration of the right to use this License’s text and the “Business
82+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
83+
other recipients of the licensed work to be provided by Licensor:
84+
85+
1. To specify as the Change License the GPL Version 2.0 or any later version,
86+
or a license that is compatible with GPL Version 2.0 or a later version,
87+
where “compatible” means that software provided under the Change License can
88+
be included in a program with software provided under GPL Version 2.0 or a
89+
later version. Licensor may specify additional Change Licenses without
90+
limitation.
91+
92+
2. To either: (a) specify an additional grant of rights to use that does not
93+
impose any additional restriction on the right granted in this License, as
94+
the Additional Use Grant; or (b) insert the text “None”.
95+
96+
3. To specify a Change Date.
97+
98+
4. Not to modify this License in any other way.

codeflash-benchmark/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# CodeFlash Benchmark
2+
3+
A pytest benchmarking plugin for [CodeFlash](https://codeflash.ai) - automatic code performance optimization.
4+
5+
## Installation
6+
7+
```bash
8+
pip install codeflash-benchmark
9+
```
10+
11+
## Usage
12+
13+
This plugin provides benchmarking capabilities for pytest tests used by CodeFlash's optimization pipeline.
14+
15+
For more information, visit [codeflash.ai](https://codeflash.ai).

codeflash-benchmark/pyproject.toml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
[project]
2-
name = "codeflash-benchmark"
3-
version = "0.2.0"
4-
description = "Pytest benchmarking plugin for codeflash.ai - automatic code performance optimization"
5-
authors = [{ name = "CodeFlash Inc.", email = "contact@codeflash.ai" }]
6-
requires-python = ">=3.9"
7-
readme = "README.md"
8-
license = {text = "BSL-1.1"}
9-
keywords = [
10-
"codeflash",
11-
"benchmark",
12-
"pytest",
13-
"performance",
14-
"testing",
15-
]
16-
dependencies = [
17-
"pytest>=7.0.0,!=8.3.4",
18-
]
19-
20-
[project.urls]
21-
Homepage = "https://codeflash.ai"
22-
Repository = "https://github.com/codeflash-ai/codeflash-benchmark"
23-
24-
[project.entry-points.pytest11]
25-
codeflash-benchmark = "codeflash_benchmark.plugin"
26-
27-
[build-system]
28-
requires = ["setuptools>=45", "wheel"]
29-
build-backend = "setuptools.build_meta"
30-
31-
[tool.setuptools]
32-
packages = ["codeflash_benchmark"]
1+
[project]
2+
name = "codeflash-benchmark"
3+
version = "0.2.0"
4+
description = "Pytest benchmarking plugin for codeflash.ai - automatic code performance optimization"
5+
authors = [{ name = "CodeFlash Inc.", email = "contact@codeflash.ai" }]
6+
requires-python = ">=3.9"
7+
readme = "README.md"
8+
license-files = ["LICENSE"]
9+
keywords = [
10+
"codeflash",
11+
"benchmark",
12+
"pytest",
13+
"performance",
14+
"testing",
15+
]
16+
dependencies = [
17+
"pytest>=7.0.0,!=8.3.4",
18+
]
19+
20+
[project.urls]
21+
Homepage = "https://codeflash.ai"
22+
Repository = "https://github.com/codeflash-ai/codeflash-benchmark"
23+
24+
[project.entry-points.pytest11]
25+
codeflash-benchmark = "codeflash_benchmark.plugin"
26+
27+
[build-system]
28+
requires = ["setuptools>=45", "wheel"]
29+
build-backend = "setuptools.build_meta"
30+
31+
[tool.setuptools]
32+
packages = ["codeflash_benchmark"]

codeflash/code_utils/config_consts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from typing import Any, Union
55

66
MAX_TEST_RUN_ITERATIONS = 5
7-
OPTIMIZATION_CONTEXT_TOKEN_LIMIT = 16000
8-
TESTGEN_CONTEXT_TOKEN_LIMIT = 16000
7+
OPTIMIZATION_CONTEXT_TOKEN_LIMIT = 48000
8+
TESTGEN_CONTEXT_TOKEN_LIMIT = 48000
99
INDIVIDUAL_TESTCASE_TIMEOUT = 15
1010
MAX_FUNCTION_TEST_SECONDS = 60
1111
MIN_IMPROVEMENT_THRESHOLD = 0.05

codeflash/languages/base.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,6 @@ def get_test_file_suffix(self) -> str:
519519
"""
520520
...
521521

522-
def get_comment_prefix(self) -> str:
523-
"""Get the comment prefix for this language.
524-
525-
Returns:
526-
Comment prefix (e.g., "//" for JS, "#" for Python).
527-
528-
"""
529-
...
530-
531522
def find_test_root(self, project_root: Path) -> Path | None:
532523
"""Find the test root directory for a project.
533524

codeflash/languages/current.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from codeflash.languages.base import LanguageSupport
3535

3636
# Module-level singleton for the current language
37-
_current_language: Language | None = None
37+
_current_language: Language = Language.PYTHON
3838

3939

4040
def current_language() -> Language:

codeflash/languages/javascript/support.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,15 +1805,6 @@ def get_test_file_suffix(self) -> str:
18051805
"""
18061806
return ".test.js"
18071807

1808-
def get_comment_prefix(self) -> str:
1809-
"""Get the comment prefix for JavaScript.
1810-
1811-
Returns:
1812-
JavaScript single-line comment prefix.
1813-
1814-
"""
1815-
return "//"
1816-
18171808
def find_test_root(self, project_root: Path) -> Path | None:
18181809
"""Find the test root directory for a JavaScript project.
18191810
File renamed without changes.

0 commit comments

Comments
 (0)