Skip to content

Commit 953fa93

Browse files
committed
Cleanup dependencies and automatically build perfparser
1 parent 69dd3bb commit 953fa93

File tree

5 files changed

+17
-728
lines changed

5 files changed

+17
-728
lines changed

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,24 @@
33
## Setup
44

55
1. Git clone
6-
2. Make and activate virtualenv
7-
3. Install from `requirements.txt`
8-
4. Run `cd perfparser && maturin develop -r`
9-
5. To fix perf debuginfo issues: `cargo install addr2line --features="bin"`
6+
2. Install [`uv`](https://github.com/astral-sh/uv) if not already installed
7+
3. To fix perf debuginfo issues: `cargo install addr2line --features="bin"`
108

119
## Basic usage
1210

13-
In one terminal, activate the virtualenv and run:
11+
First, build your target program with optimizations on and debuginfo enabled, and then profile it with `perf` using something like the following:
1412

1513
```console
16-
$ flask --app=accelerant_server run
14+
$ perf record -F99 --call-graph dwarf ./your-program
1715
```
1816

19-
In another terminal, build your program with optimizations on and debuginfo enabled, and then profile it with `perf` using something like the following:
17+
Then, in the `accelerant` repository, run:
2018

2119
```console
22-
$ perf record -F99 --call-graph dwarf ./your-program
20+
$ uv run accelerant_server.py
2321
```
2422

25-
Then, run:
23+
Finally, in a separate terminal, run:
2624

2725
```console
2826
$ curl 'http://127.0.0.1:5000/optimize?project=PATH_TO_PROJECT_ROOT&perfDataPath=ABSOLUTE_PATH_TO_PERF_DATA'

accelerant/tools.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from agents import RunContextWrapper, function_tool
55
from llm_utils import number_group_of_lines
66
from pydantic import BaseModel, Field
7-
import openai
8-
from openai.types.chat import ChatCompletionToolParam
97

108
from accelerant.lsp import TOP_LEVEL_SYMBOL_KINDS, uri_to_relpath
119
from accelerant.util import find_symbol, truncate_for_llm

perfparser/pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ classifiers = [
1111
"Programming Language :: Python :: Implementation :: PyPy",
1212
]
1313
dynamic = ["version"]
14+
1415
[tool.maturin]
1516
features = ["pyo3/extension-module"]
17+
18+
[tool.uv]
19+
cache-keys = [{file = "Cargo.toml"}, {file = "**/*.rs"}]

pyproject.toml

Lines changed: 2 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -5,99 +5,19 @@ description = "Add your description here"
55
readme = "README.md"
66
requires-python = ">=3.13"
77
dependencies = [
8-
"annotated-types==0.7.0",
9-
"anyio==4.8.0",
10-
"asttokens==3.0.0",
11-
"attrs==25.1.0",
12-
"blinker==1.9.0",
13-
"cattrs==24.1.2",
14-
"certifi==2025.1.31",
15-
"charset-normalizer==3.4.1",
16-
"click==8.1.8",
17-
"colorama==0.4.6",
18-
"comm==0.2.2",
19-
"debugpy==1.8.12",
20-
"decorator==5.2.1",
21-
"distro==1.9.0",
22-
"docstring-to-markdown==0.15",
23-
"executing==2.2.0",
248
"flask==3.1.0",
25-
"griffe==1.14.0",
26-
"h11==0.14.0",
27-
"httpcore==1.0.7",
28-
"httpx==0.28.1",
29-
"httpx-sse==0.4.3",
30-
"idna==3.10",
31-
"ipykernel==6.29.5",
32-
"ipython==9.0.0",
33-
"ipython-pygments-lexers==1.1.1",
34-
"itsdangerous==2.2.0",
35-
"jedi==0.19.2",
36-
"jedi-language-server==0.41.3",
37-
"jinja2==3.1.5",
38-
"jiter==0.11.1",
39-
"jsonschema==4.25.1",
40-
"jsonschema-specifications==2025.9.1",
41-
"jupyter-client==8.6.3",
42-
"jupyter-core==5.7.2",
439
"llm-utils==0.2.8",
44-
"lsprotocol==2023.0.1",
45-
"markdown-it-py==3.0.0",
46-
"markupsafe==3.0.2",
47-
"matplotlib-inline==0.1.7",
48-
"maturin==1.8.2",
49-
"mcp==1.18.0",
50-
"mdurl==0.1.2",
5110
"multilspy",
52-
"mypy==1.15.0",
53-
"mypy-extensions==1.0.0",
54-
"nest-asyncio==1.6.0",
55-
"openai==2.6.0",
5611
"openai-agents==0.4.1",
57-
"packaging==24.2",
58-
"parso==0.8.4",
59-
"pexpect==4.9.0",
60-
"platformdirs==4.3.6",
61-
"presto-python-client==0.8.4",
62-
"prompt-toolkit==3.0.50",
63-
"psutil==7.0.0",
64-
"ptyprocess==0.7.0",
65-
"pure-eval==0.2.3",
12+
"perfparser",
6613
"pydantic==2.12.3",
67-
"pydantic-core==2.41.4",
68-
"pydantic-settings==2.11.0",
69-
"pygls==1.3.1",
70-
"pygments==2.19.1",
71-
"python-dateutil==2.9.0.post0",
72-
"python-dotenv==1.1.1",
73-
"python-multipart==0.0.20",
74-
"pyzmq==26.2.1",
75-
"referencing==0.37.0",
76-
"regex==2024.11.6",
7714
"requests==2.32.3",
7815
"rich==13.9.4",
79-
"rpds-py==0.27.1",
80-
"ruff==0.11.6",
81-
"six==1.17.0",
82-
"sniffio==1.3.1",
83-
"sse-starlette==3.0.2",
84-
"stack-data==0.6.3",
85-
"starlette==0.48.0",
86-
"tiktoken==0.9.0",
87-
"tornado==6.4.2",
88-
"tqdm==4.67.1",
89-
"traitlets==5.14.3",
90-
"types-requests==2.32.4.20250913",
91-
"typing-extensions==4.15.0",
92-
"typing-inspection==0.4.2",
93-
"urllib3==2.3.0",
94-
"uvicorn==0.38.0",
95-
"wcwidth==0.2.13",
96-
"werkzeug==3.1.3",
9716
]
9817

9918
[tool.uv.sources]
10019
multilspy = { git = "https://github.com/camelid/multilspy.git", rev = "a64a5657c36789ed589454fb6e658637b6e982fd" }
20+
perfparser = { path = "./perfparser" }
10121

10222
[tool.setuptools]
10323
packages = ["accelerant"]

0 commit comments

Comments
 (0)