Skip to content

Commit a2e612b

Browse files
committed
add uv to nix and direnv, run auto format
1 parent b268dca commit a2e612b

File tree

5 files changed

+1690
-1676
lines changed

5 files changed

+1690
-1676
lines changed

.envrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
use flake
2-
layout python
2+
[ -d .venv ] || uv venv
3+
source_env .venv/bin/activate

drift/instrumentation/e2e_common/base_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ def _print_comparison(self, baseline: dict[str, dict], sdk: dict[str, dict]):
566566
def run(self) -> int:
567567
"""Run the full e2e test lifecycle."""
568568
try:
569-
if os.environ.get('BENCHMARKS'):
569+
if os.environ.get("BENCHMARKS"):
570570
self.setup()
571571
self.run_benchmarks()
572572
return self.exit_code

drift/instrumentation/e2e_common/test_utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
BASE_URL = "http://localhost:8000"
1414
_request_count = 0
1515

16-
BENCHMARK_MODE = os.environ.get('BENCHMARKS', '') != ''
17-
BENCHMARK_DURATION = int(os.environ.get('BENCHMARK_DURATION', '10'))
18-
BENCHMARK_WARMUP = int(os.environ.get('BENCHMARK_WARMUP', '3'))
16+
BENCHMARK_MODE = os.environ.get("BENCHMARKS", "") != ""
17+
BENCHMARK_DURATION = int(os.environ.get("BENCHMARK_DURATION", "10"))
18+
BENCHMARK_WARMUP = int(os.environ.get("BENCHMARK_WARMUP", "3"))
1919

2020
# Minimum iterations required for a result to be considered reliable
2121
_MIN_RELIABLE_ITERATIONS = 30
@@ -88,7 +88,9 @@ def _benchmark_request(method, endpoint, **kwargs):
8888
if iterations > 0:
8989
ns_per_op = elapsed_ns // iterations
9090
ops_per_sec = iterations / (elapsed_ns / 1_000_000_000)
91-
print(f"{name:<40} {iterations:>8} {ns_per_op:>15} ns/op {ops_per_sec:>12.2f} ops/s (partial, {errors} errors)")
91+
print(
92+
f"{name:<40} {iterations:>8} {ns_per_op:>15} ns/op {ops_per_sec:>12.2f} ops/s (partial, {errors} errors)"
93+
)
9294
else:
9395
print(f"{name:<40} FAILED ({errors} errors, 0 successful iterations)")
9496
return last_resp

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
mkShell {
4040
buildInputs = [
4141
(python3.withPackages (p: with p; [ ]))
42+
uv
4243
];
4344
}
4445
) defaultSystems;

0 commit comments

Comments
 (0)