Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 18 additions & 18 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
codecov:
branch: develop
max_report_age: '12h'
max_report_age: "12h"
component_management:
default_rules: # default rules that will be inherited by all components
default_rules: # default rules that will be inherited by all components
statuses:
- type: project # in this case every component that doens't have a status defined will have a project type one
threshold: 0 # Shouldn't remove coverage
individual_components:
- component_id: codegen-sdk-python # this is an identifier that should not be changed
name: codegen-sdk-python # this is a display name, and can be changed freely
- component_id: graph-sitter-python # this is an identifier that should not be changed
name: graph-sitter-python # this is a display name, and can be changed freely
paths:
- src/codegen/sdk/python/**
- src/graph_sitter/python/**
statuses:
- type: project # in this case every component that doens't have a status defined will have a project type one
threshold: 0 # Shouldn't remove coverage
- type: patch
target: 50 # Language specific featues must be 100% covered
flags:
- unit-tests
- component_id: codegen-sdk-typescript
name: codegen-sdk-typescript
- component_id: graph-sitter-typescript
name: graph-sitter-typescript
paths:
- src/codegen/sdk/typescript/**
- src/graph_sitter/typescript/**
statuses:
- type: project # in this case every component that doens't have a status defined will have a project type one
threshold: 0 # Shouldn't remove coverage
- type: patch
target: 50 # Language specific featues must be 100% covered
flags:
- unit-tests
- component_id: codegen-sdk-core
name: codegen-sdk-core
- component_id: graph-sitter-core
name: graph-sitter-core
paths:
- src/codegen/sdk/**
- src/graph_sitter/**
flags:
- unit-tests

flag_management:
default_rules:
carryforward: true
carryforward_mode: 'labels'
carryforward_mode: "labels"
statuses:
- type: project
individual_flags:
- name: unit-tests
carryforward: true
carryforward_mode: 'labels'
carryforward_mode: "labels"
statuses:
- type: 'project'
- type: 'patch'
- type: "project"
- type: "patch"
- name: codemod-tests
carryforward: true
carryforward_mode: 'labels'
carryforward_mode: "labels"
- name: integration-tests
carryforward: true
carryforward_mode: 'labels'
carryforward_mode: "labels"
comment:
layout: "condensed_header, condensed_files"
hide_project_coverage: true
cli:
plugins:
pycoverage:
report_type: 'json'
report_type: "json"
include_contexts: true
runners:
pytest:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ alembic_versions_backup
**/.virtual_documents
/.nvmrc
**/build/test-results/test/TEST*.xml
src/codegen/sdk/__init__.py
src/graph_sitter/__init__.py
src/**/*.html
.ccache/
uv-*.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions codegen-examples/examples/ai_impact_analysis/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from codegen.extensions.attribution.cli import run
from codegen.git.repo_operator.repo_operator import RepoOperator
from codegen.git.schemas.repo_config import RepoConfig
from codegen.sdk.codebase.config import ProjectConfig
from codegen.shared.enums.programming_language import ProgrammingLanguage
from graph_sitter.codebase.config import ProjectConfig
from graph_sitter.shared.enums.programming_language import ProgrammingLanguage

if __name__ == "__main__":
try:
Expand Down
8 changes: 4 additions & 4 deletions codegen-examples/examples/cyclomatic_complexity/run.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import codegen
from codegen import Codebase
from codegen.sdk.core.statements.for_loop_statement import ForLoopStatement
from codegen.sdk.core.statements.if_block_statement import IfBlockStatement
from codegen.sdk.core.statements.try_catch_statement import TryCatchStatement
from codegen.sdk.core.statements.while_statement import WhileStatement
from graph_sitter.core.statements.for_loop_statement import ForLoopStatement
from graph_sitter.core.statements.if_block_statement import IfBlockStatement
from graph_sitter.core.statements.try_catch_statement import TryCatchStatement
from graph_sitter.core.statements.while_statement import WhileStatement


@codegen.function("cyclomatic-complexity")
Expand Down
6 changes: 3 additions & 3 deletions codegen-examples/examples/document_functions/run.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import codegen
from codegen import Codebase
from codegen.sdk.core.external_module import ExternalModule
from codegen.sdk.core.import_resolution import Import
from codegen.sdk.core.symbol import Symbol
from graph_sitter.core.external_module import ExternalModule
from graph_sitter.core.import_resolution import Import
from graph_sitter.core.symbol import Symbol


def hop_through_imports(imp: Import) -> Symbol | ExternalModule:
Expand Down
6 changes: 3 additions & 3 deletions codegen-examples/examples/generate_training_data/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import codegen
from codegen import Codebase
from codegen.sdk.core.external_module import ExternalModule
from codegen.sdk.core.import_resolution import Import
from codegen.sdk.core.symbol import Symbol
from graph_sitter.core.external_module import ExternalModule
from graph_sitter.core.import_resolution import Import
from graph_sitter.core.symbol import Symbol


def hop_through_imports(imp: Import) -> Symbol | ExternalModule:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"outputs": [],
"source": [
"from codegen import Codebase\n",
"from codegen.sdk.enums import ProgrammingLanguage\n",
"from codegen.sdk.core.statements.statement import StatementType"
"from graph_sitter.enums import ProgrammingLanguage\n",
"from graph_sitter.core.statements.statement import StatementType"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion codegen-examples/examples/promises_to_async_await/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import codegen
from codegen import Codebase
from codegen.sdk.core.statements.statement import StatementType
from graph_sitter.core.statements.statement import StatementType


@codegen.function("promises-to-async-await")
Expand Down
2 changes: 1 addition & 1 deletion codegen-examples/examples/reexport_management/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import codegen
from codegen import Codebase
from codegen.sdk.typescript.file import TSImport
from graph_sitter.typescript.file import TSImport

processed_imports = set()

Expand Down
2 changes: 1 addition & 1 deletion codegen-examples/examples/remove_default_exports/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import codegen
from codegen import Codebase
from codegen.sdk.typescript.file import TSFile
from graph_sitter.typescript.file import TSFile


@codegen.function("remove-default-exports")
Expand Down
14 changes: 7 additions & 7 deletions codegen-examples/examples/repo_analytics/run.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import Dict, Any
from codegen import Codebase
from codegen.sdk.core.statements.for_loop_statement import ForLoopStatement
from codegen.sdk.core.statements.if_block_statement import IfBlockStatement
from codegen.sdk.core.statements.try_catch_statement import TryCatchStatement
from codegen.sdk.core.statements.while_statement import WhileStatement
from codegen.sdk.core.expressions.binary_expression import BinaryExpression
from codegen.sdk.core.expressions.unary_expression import UnaryExpression
from codegen.sdk.core.expressions.comparison_expression import ComparisonExpression
from graph_sitter.core.statements.for_loop_statement import ForLoopStatement
from graph_sitter.core.statements.if_block_statement import IfBlockStatement
from graph_sitter.core.statements.try_catch_statement import TryCatchStatement
from graph_sitter.core.statements.while_statement import WhileStatement
from graph_sitter.core.expressions.binary_expression import BinaryExpression
from graph_sitter.core.expressions.unary_expression import UnaryExpression
from graph_sitter.core.expressions.comparison_expression import ComparisonExpression
import math
import re
import requests
Expand Down
4 changes: 2 additions & 2 deletions codegen-examples/examples/sqlalchemy_1.6_to_2.0/run.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import codegen
from codegen import Codebase
from codegen.sdk.core.detached_symbols.function_call import FunctionCall
from codegen.sdk.core.expressions.chained_attribute import ChainedAttribute
from graph_sitter.core.detached_symbols.function_call import FunctionCall
from graph_sitter.core.expressions.chained_attribute import ChainedAttribute


@codegen.function("sqlalchemy-1.4-to-2.0")
Expand Down
4 changes: 2 additions & 2 deletions codegen-examples/examples/sqlalchemy_soft_delete/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pathlib import Path

import codegen
from codegen.sdk.core.detached_symbols.function_call import FunctionCall
from graph_sitter.core.detached_symbols.function_call import FunctionCall


def should_process_join_call(call, soft_delete_models, join_methods):
Expand Down Expand Up @@ -91,7 +91,7 @@ def process_soft_deletes(codebase):

if __name__ == "__main__":
from codegen import Codebase
from codegen.configs.models.codebase import CodebaseConfig
from graph_sitter.configs.models.codebase import CodebaseConfig

repo_path = Path("/tmp/core")
repo_url = "https://github.com/hasgeek/funnel.git"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import codegen
from codegen import Codebase
from codegen.sdk.core.detached_symbols.function_call import FunctionCall
from graph_sitter.core.detached_symbols.function_call import FunctionCall


def init_git_repo(repo_path: str) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"metadata": {},
"outputs": [],
"source": [
"from codegen.sdk.core.codebase import Codebase # noqa: E402\n",
"from graph_sitter.core.codebase import Codebase # noqa: E402\n",
"\n",
"codebase = Codebase.from_repo(repo_full_name=\"codegen-sh/cloud\")"
]
Expand Down
2 changes: 1 addition & 1 deletion codegen-examples/examples/swebench_agent_run/run_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from codegen.extensions.swebench.harness import run_agent_on_entry
from codegen.extensions.swebench.utils import SweBenchExample, get_swe_bench_examples
from codegen.extensions.swebench.report import generate_report
from codegen.sdk.core.codebase import Codebase
from graph_sitter.core.codebase import Codebase

PREDS_DNAME = Path(__file__).parent / "predictions"
LOG_DIR = Path(__file__).parent / "logs"
Expand Down
4 changes: 2 additions & 2 deletions codegen-examples/examples/symbol-attributions/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from codegen.extensions.attribution.main import add_attribution_to_symbols
from codegen.git.repo_operator.repo_operator import RepoOperator
from codegen.git.schemas.repo_config import RepoConfig
from codegen.sdk.codebase.config import ProjectConfig
from codegen.shared.enums.programming_language import ProgrammingLanguage
from graph_sitter.codebase.config import ProjectConfig
from graph_sitter.shared.enums.programming_language import ProgrammingLanguage


def print_symbol_attribution(codebase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import codegen
from codegen import Codebase
from codegen.sdk.core.detached_symbols.function_call import FunctionCall
from graph_sitter.core.detached_symbols.function_call import FunctionCall


@codegen.function("useSuspenseQuery-to-useSuspenseQueries")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import codegen
import networkx as nx
from codegen import Codebase
from codegen.sdk.core.dataclasses.usage import Usage
from codegen.sdk.python.function import PyFunction
from codegen.sdk.python.symbol import PySymbol
from graph_sitter.core.dataclasses.usage import Usage
from graph_sitter.python.function import PyFunction
from graph_sitter.python.symbol import PySymbol

# Create a directed graph for visualizing relationships between code elements
G = nx.DiGraph()
Expand Down
8 changes: 4 additions & 4 deletions codegen-examples/examples/visualize_codebases/call_trace.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import codegen
import networkx as nx
from codegen import Codebase
from codegen.sdk.core.class_definition import Class
from codegen.sdk.core.detached_symbols.function_call import FunctionCall
from codegen.sdk.core.external_module import ExternalModule
from codegen.sdk.core.function import Function
from graph_sitter.core.class_definition import Class
from graph_sitter.core.detached_symbols.function_call import FunctionCall
from graph_sitter.core.external_module import ExternalModule
from graph_sitter.core.function import Function

G = nx.DiGraph()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import codegen
import networkx as nx
from codegen import Codebase
from codegen.sdk.core.class_definition import Class
from codegen.sdk.core.import_resolution import Import
from codegen.sdk.core.symbol import Symbol
from graph_sitter.core.class_definition import Class
from graph_sitter.core.import_resolution import Import
from graph_sitter.core.symbol import Symbol

G = nx.DiGraph()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import codegen
import networkx as nx
from codegen import Codebase
from codegen.sdk.core.class_definition import Class
from codegen.sdk.core.detached_symbols.function_call import FunctionCall
from codegen.sdk.core.external_module import ExternalModule
from codegen.sdk.core.function import Function
from graph_sitter.core.class_definition import Class
from graph_sitter.core.detached_symbols.function_call import FunctionCall
from graph_sitter.core.external_module import ExternalModule
from graph_sitter.core.function import Function

G = nx.DiGraph()

Expand Down
10 changes: 5 additions & 5 deletions docs/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from sybil.parsers.markdown import PythonCodeBlockParser
from doctest import ELLIPSIS

from codegen.sdk.code_generation.current_code_codebase import get_documented_objects
from codegen.sdk.codebase.factory.get_session import get_codebase_session
from codegen.shared.enums.programming_language import ProgrammingLanguage
from codegen.sdk.typescript.class_definition import TSClass
from codegen.sdk.typescript.file import TSFile
from graph_sitter.code_generation.current_code_codebase import get_documented_objects
from graph_sitter.codebase.factory.get_session import get_codebase_session
from graph_sitter.shared.enums.programming_language import ProgrammingLanguage
from graph_sitter.typescript.class_definition import TSClass
from graph_sitter.typescript.file import TSFile
from codegen.gscli.generate.runner_imports import EXTERNAL_IMPORTS

SAMPLE_FILENAME = {
Expand Down
6 changes: 3 additions & 3 deletions hatch.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build.hooks.vcs]
dependencies = ["hatch-vcs>=0.4.0"]
version-file = "src/codegen/sdk/__init__.py"
version-file = "src/graph_sitter/__init__.py"

[metadata]
allow-direct-references = true
Expand Down Expand Up @@ -30,7 +30,7 @@ dependencies = [
]

[build.targets.wheel.hooks.cython.options]
src = "codegen/sdk"
src = "graph_sitter"
compile_args = [
"-O3",
{ platforms = [
Expand Down Expand Up @@ -77,7 +77,7 @@ exclude = [
macos-max-compat = false

[build]
packages = ["src/codegen"]
packages = ["src/graph_sitter", "src/codegen"]

[metadata.hooks.vcs.urls]
Homepage = "https://www.codegen.com/"
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "codegen"
name = "graph-sitter"
dynamic = ["version", "urls"]
description = "Scriptable interface to a powerful, multi-lingual language server built on top of Tree-sitter"
readme = "README.md"
Expand Down Expand Up @@ -230,6 +230,7 @@ build-backend = "hatchling.build"
[tool.deptry]
extend_exclude = [".*/eval/test_files/.*.py", ".*conftest.py"]
pep621_dev_dependency_groups = ["types"]
known_first_party = ["graph_sitter"]
[tool.deptry.per_rule_ignores]
DEP002 = [
"pyright",
Expand Down
Loading
Loading