Skip to content

Commit 7147af4

Browse files
authored
refactor: Move other modules into new namespaces (#23)
- **move gsbuild** - **move codegen.git** - **remove agents code** - **update imports** - **move gscli and gsbuild**
1 parent c6e5c0e commit 7147af4

File tree

876 files changed

+1422
-2092
lines changed

Some content is hidden

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

876 files changed

+1422
-2092
lines changed

.github/workflows/auto-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: Generate changelog
5656
env:
5757
OPEN_AI_TOKEN: ${{ secrets.OPEN_AI_TOKEN }}
58-
run: uv run python src/codegen/gscli/cli.py generate changelog --openai-key ${{ secrets.OPEN_AI_TOKEN }}
58+
run: uv run python src/gscli/cli.py generate changelog --openai-key ${{ secrets.OPEN_AI_TOKEN }}
5959

6060
- name: Commit changes
6161
run: |

.github/workflows/generate-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
uses: ./.github/actions/setup-environment
2323

2424
- name: Generate API reference
25-
run: uv run python src/codegen/gscli/cli.py generate docs
25+
run: uv run python src/gscli/cli.py generate docs
2626

2727
- name: Generate System Prompt
28-
run: uv run python src/codegen/gscli/cli.py generate system-prompt
28+
run: uv run python src/gscli/cli.py generate system-prompt
2929

3030
- name: Commit changes
3131
run: |

.pre-commit-config.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
default_language_version:
22
python: python3.13
33
repos:
4-
54
- repo: https://github.com/ComPWA/taplo-pre-commit
65
rev: v0.9.3
76
hooks:
@@ -24,7 +23,7 @@ repos:
2423
- id: biome-check
2524
language: node
2625
additional_dependencies: ["@biomejs/[email protected]"]
27-
exclude: (src/codemods/eval)|(tests/unit/skills/snapshots)|(tests/unit/codegen/sdk/output)|(tests/integration/verified_codemods)|(docs/samples)
26+
exclude: (src/codemods/eval)|(tests/unit/skills/snapshots)|(tests/unit/sdk/output)|(tests/integration/verified_codemods)|(docs/samples)
2827
- repo: https://github.com/MarcoGorelli/cython-lint
2928
rev: v0.16.6
3029
hooks:
@@ -88,13 +87,13 @@ repos:
8887
args: ["--frozen", "--all-packages", "--all-extras"]
8988

9089
- repo: https://github.com/hukkin/mdformat
91-
rev: 0.7.22 # Use the ref you want to point at
90+
rev: 0.7.22 # Use the ref you want to point at
9291
hooks:
93-
- id: mdformat
94-
language: python
95-
# Optionally add plugins
96-
additional_dependencies:
97-
- mdformat-gfm
98-
- mdformat-ruff
99-
- mdformat-config
100-
- mdformat-pyproject
92+
- id: mdformat
93+
language: python
94+
# Optionally add plugins
95+
additional_dependencies:
96+
- mdformat-gfm
97+
- mdformat-ruff
98+
- mdformat-config
99+
- mdformat-pyproject

codegen-examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ We recommend using [`uv`](https://github.com/astral-sh/uv) with Python 3.13 for
1010

1111
To install Codegen, please follow the [official installation guide](https://docs.codegen.com/introduction/installation). Once Codegen is installed, use these steps to run the examples in this repository:
1212

13-
Install the Codegen CLI globally
13+
Install the graph_sitter.cli globally
1414

1515
```bash
1616
uv tool install codegen

codegen-examples/STRUCTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Your `run.py` should follow this structure, demonstrated well in the `generate_t
2626

2727
```python
2828
import codegen
29-
from codegen import Codebase
29+
from graph_sitter import Codebase
3030
from codegen.sdk.core import Function
3131
# ... other imports
3232
```

codegen-examples/examples/ai_impact_analysis/dashboard/backend/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from codegen import Codebase
2-
from codegen.extensions.attribution.main import (
1+
from graph_sitter import Codebase
2+
from graph_sitter.extensions.attribution.main import (
33
add_attribution_to_symbols,
44
analyze_ai_impact,
55
)

codegen-examples/examples/ai_impact_analysis/run.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import traceback
33
import os
44

5-
from codegen import Codebase
6-
from codegen.extensions.attribution.cli import run
7-
from codegen.git.repo_operator.repo_operator import RepoOperator
8-
from codegen.git.schemas.repo_config import RepoConfig
5+
from graph_sitter import Codebase
6+
from graph_sitter.extensions.attribution.cli import run
7+
from graph_sitter.git.repo_operator.repo_operator import RepoOperator
8+
from graph_sitter.git.schemas.repo_config import RepoConfig
99
from graph_sitter.codebase.config import ProjectConfig
1010
from graph_sitter.shared.enums.programming_language import ProgrammingLanguage
1111

codegen-examples/examples/codegen-mcp-server/server.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
from typing import Annotated, Any, Dict, List, Optional
88

99
import requests
10-
from codegen import Codebase
11-
from codegen.cli.api.client import RestAPI
12-
from codegen.cli.api.endpoints import CODEGEN_SYSTEM_PROMPT_URL
13-
from codegen.cli.auth.token_manager import get_current_token
14-
from codegen.cli.codemod.convert import convert_to_cli
15-
from codegen.cli.utils.default_code import DEFAULT_CODEMOD
16-
from codegen.extensions.tools.reveal_symbol import reveal_symbol
10+
from graph_sitter import Codebase
11+
from graph_sitter.cli.api.client import RestAPI
12+
from graph_sitter.cli.api.endpoints import CODEGEN_SYSTEM_PROMPT_URL
13+
from graph_sitter.cli.auth.token_manager import get_current_token
14+
from graph_sitter.cli.codemod.convert import convert_to_cli
15+
from graph_sitter.cli.utils.default_code import DEFAULT_CODEMOD
16+
from graph_sitter.extensions.tools.reveal_symbol import reveal_symbol
1717
from mcp.server.fastmcp import FastMCP
1818

1919
logger = getLogger(__name__)
@@ -168,7 +168,7 @@ def codegen_system_prompt():
168168
For example, consider the following script:
169169
170170
```python
171-
from codegen import Codebase
171+
from graph_sitter import Codebase
172172
173173
# Codegen builds a complete graph connecting
174174
# functions, classes, imports and their relationships
@@ -195,7 +195,7 @@ def codegen_system_prompt():
195195
196196
They live in the `.codegen/codemods/{name}/{name.py}` directory, and take the following form:
197197
```python
198-
from codegen import Codebase
198+
from graph_sitter import Codebase
199199
200200
@codegen.function('{name}')
201201
def codemod(codebase: Codebase):
@@ -364,7 +364,7 @@ async def run_codemod(
364364
try:
365365
# Get the codemod using CodemodManager
366366
try:
367-
from codegen.cli.utils.codemod_manager import CodemodManager
367+
from graph_sitter.cli.utils.codemod_manager import CodemodManager
368368

369369
codemod = CodemodManager.get_codemod(name, start_path=state.parsed_codebase.repo_path)
370370
except Exception as e:
@@ -378,15 +378,15 @@ async def run_codemod(
378378

379379
# Validate arguments if schema exists
380380
if codemod.arguments_type_schema:
381-
from codegen.cli.utils.json_schema import validate_json
381+
from graph_sitter.cli.utils.json_schema import validate_json
382382

383383
if not validate_json(codemod.arguments_type_schema, args_dict):
384384
return {"error": f"Invalid arguments format. Expected schema: {codemod.arguments_type_schema}"}
385385
except json.JSONDecodeError:
386386
return {"error": "Invalid JSON in arguments parameter"}
387387

388388
# Create a session for the codemod
389-
from codegen.cli.auth.session import CodegenSession
389+
from graph_sitter.cli.auth.session import CodegenSession
390390

391391
session = CodegenSession(state.parsed_codebase.repo_path)
392392
session.codebase = state.parsed_codebase
@@ -417,8 +417,8 @@ async def run_codemod(
417417
async def reset() -> Dict[str, Any]:
418418
try:
419419
# Import necessary functions from reset command
420-
from codegen.cli.commands.reset.main import backup_codegen_files, remove_untracked_files, restore_codegen_files
421-
from codegen.cli.git.repo import get_git_repo
420+
from graph_sitter.cli.commands.reset.main import backup_codegen_files, remove_untracked_files, restore_codegen_files
421+
from graph_sitter.cli.git.repo import get_git_repo
422422
from pygit2.enums import ResetMode
423423

424424
# Get the git repository

codegen-examples/examples/cyclomatic_complexity/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import codegen
2-
from codegen import Codebase
2+
from graph_sitter import Codebase
33
from graph_sitter.core.statements.for_loop_statement import ForLoopStatement
44
from graph_sitter.core.statements.if_block_statement import IfBlockStatement
55
from graph_sitter.core.statements.try_catch_statement import TryCatchStatement

codegen-examples/examples/delete_dead_code/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import codegen
2-
from codegen import Codebase
2+
from graph_sitter import Codebase
33

44

55
@codegen.function("delete-dead-code")

0 commit comments

Comments
 (0)