Skip to content

Commit 8ca1806

Browse files
committed
Resolve merge conflict in version.py
2 parents 6a7188f + 3171bb8 commit 8ca1806

File tree

96 files changed

+2409
-1862
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2409
-1862
lines changed

.github/workflows/deploy-docs-to-azure.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
repos:
2-
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: "v0.11.0"
4-
hooks:
5-
- id: ruff
6-
args: [--fix, --exit-non-zero-on-fix, --config=pyproject.toml]
7-
- id: ruff-format
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.12.7
4+
hooks:
5+
# Run the linter.
6+
- id: ruff-check
7+
# Run the formatter.
8+
- id: ruff-format

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ For detailed installation and usage instructions, visit our documentation at [do
6565

6666
https://github.com/user-attachments/assets/38f44f4e-be1c-4f84-8db9-63d5ee3e61e5
6767

68+
- Optiming a workflow end to end automatically with `codeflash optimize`
69+
70+
71+
https://github.com/user-attachments/assets/355ba295-eb5a-453a-8968-7fb35c70d16c
72+
73+
74+
6875
## Support
6976

7077
Join our community for support and discussions. If you have any questions, feel free to reach out to us using one of the following methods:

SECURITY.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Security Policy
2+
3+
This document outlines Codeflash's vulnerability disclosure policy. For more information about Codeflash's approach to security, please visit [codeflash.ai/security](https://www.codeflash.ai/security).
4+
5+
## Supported Versions
6+
7+
Since Codeflash is moving quickly, we can only commit to fixing security issues for the latest version of codeflash client.
8+
If a vulnerability is discovered in our backend, we will release the fix for all the users.
9+
10+
## Reporting a Vulnerability
11+
12+
13+
Please do not report security vulnerabilities through public GitHub issues.
14+
15+
Instead, please report them to our [GitHub Security page](https://github.com/codeflash-ai/codeflash/security). If you prefer to submit one without using GitHub, you can also email us at [email protected].
16+
17+
We commit to acknowledging vulnerability reports immediately, and will work to fix active vulnerabilities as soon as we can. We will publish resolved vulnerabilities in the form of security advisories on our GitHub security page. Critical incidents will be communicated both on the GitHub security page and via email to all affected users.
18+
19+
We appreciate your help in making Codeflash more secure for everyone. Thank you for your support and responsible disclosure.
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
DEFAULT_API_URL = "https://api.galileo.ai/"
22
DEFAULT_APP_URL = "https://app.galileo.ai/"
3-
4-
5-
# function_names: GalileoApiClient.get_console_url
6-
# module_abs_path : /home/mohammed/Work/galileo-python/src/galileo/api_client.py
7-
# preexisting_objects: {('GalileoApiClient', ()), ('_set_destination', ()), ('get_console_url', (FunctionParent(name='GalileoApiClient', type='ClassDef'),))}
8-
# project_root_path: /home/mohammed/Work/galileo-python/src
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""CodeFlash Benchmark - Pytest benchmarking plugin for codeflash.ai."""
2+
3+
__version__ = "0.1.0"
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
from __future__ import annotations
2+
3+
import importlib.util
4+
5+
import pytest
6+
7+
from codeflash.benchmarking.plugin.plugin import codeflash_benchmark_plugin
8+
9+
PYTEST_BENCHMARK_INSTALLED = importlib.util.find_spec("pytest_benchmark") is not None
10+
11+
12+
def pytest_configure(config: pytest.Config) -> None:
13+
"""Register the benchmark marker and disable conflicting plugins."""
14+
config.addinivalue_line("markers", "benchmark: mark test as a benchmark that should be run with codeflash tracing")
15+
16+
if config.getoption("--codeflash-trace") and PYTEST_BENCHMARK_INSTALLED:
17+
config.option.benchmark_disable = True
18+
config.pluginmanager.set_blocked("pytest_benchmark")
19+
config.pluginmanager.set_blocked("pytest-benchmark")
20+
21+
22+
def pytest_addoption(parser: pytest.Parser) -> None:
23+
parser.addoption(
24+
"--codeflash-trace", action="store_true", default=False, help="Enable CodeFlash tracing for benchmarks"
25+
)
26+
27+
28+
@pytest.fixture
29+
def benchmark(request: pytest.FixtureRequest) -> object:
30+
"""Benchmark fixture that works with or without pytest-benchmark installed."""
31+
config = request.config
32+
33+
# If --codeflash-trace is enabled, use our implementation
34+
if config.getoption("--codeflash-trace"):
35+
return codeflash_benchmark_plugin.Benchmark(request)
36+
37+
# If pytest-benchmark is installed and --codeflash-trace is not enabled,
38+
# return the normal pytest-benchmark fixture
39+
if PYTEST_BENCHMARK_INSTALLED:
40+
from pytest_benchmark.fixture import BenchmarkFixture as BSF # noqa: N814
41+
42+
bs = getattr(config, "_benchmarksession", None)
43+
if bs and bs.skip:
44+
pytest.skip("Benchmarks are skipped (--benchmark-skip was used).")
45+
46+
node = request.node
47+
marker = node.get_closest_marker("benchmark")
48+
options = dict(marker.kwargs) if marker else {}
49+
50+
if bs:
51+
return BSF(
52+
node,
53+
add_stats=bs.benchmarks.append,
54+
logger=bs.logger,
55+
warner=request.node.warn,
56+
disabled=bs.disabled,
57+
**dict(bs.options, **options),
58+
)
59+
return lambda func, *args, **kwargs: func(*args, **kwargs)
60+
61+
return lambda func, *args, **kwargs: func(*args, **kwargs)

codeflash-benchmark/pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[project]
2+
name = "codeflash-benchmark"
3+
version = "0.1.0"
4+
description = "Pytest benchmarking plugin for codeflash.ai - automatic code performance optimization"
5+
authors = [{ name = "CodeFlash Inc.", email = "[email protected]" }]
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", "setuptools_scm"]
29+
build-backend = "setuptools.build_meta"
30+
31+
[tool.setuptools]
32+
packages = ["codeflash_benchmark"]

0 commit comments

Comments
 (0)