Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ repos:
exclude_types: [mdx, pyi]
- id: check-yaml
- id: end-of-file-fixer
files: .*/expected_diff.patch
- id: check-merge-conflict

- repo: https://github.com/python-jsonschema/check-jsonschema
Expand Down
14 changes: 3 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,7 @@ max-line-length = 200

[tool.ruff]
line-length = 200
exclude = [
"app/codemod/compilation/function_imports.py", # generated import list to compile uesr code with
'codegen_tests/**/expected*/**',
'codegen_tests/**/original/**',
'codegen_tests/projects/**/codebase/**',
'docs/**',
'scripts/Debugging/**',
]
exclude = ["src/codegen/shared/compilation/function_imports.py", 'docs/**']

lint.select = ["F", "E", "W", "I", "UP", "D", "RUF", "DTZ"]
lint.ignore = [
Expand Down Expand Up @@ -192,9 +185,8 @@ lint.exclude = [
] # disable just linting for notebooks (allow for formatting)
lint.pydocstyle.convention = "google"
[tool.ruff.lint.isort]
known-first-party = ["app"]
known-third-party = ["git"]
#known-local-folder=[]
known-first-party = ["codegen"]

[tool.coverage.run]
branch = true
plugins = ["Cython.Coverage"]
Expand Down
10 changes: 9 additions & 1 deletion src/codegen/gsbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@ def update_init_file(file: Path) -> None:
file.write_text(content)


def update_function_imports(root_path: Path) -> None:
from codegen.gscli.generate.runner_imports import _generate_runner_imports

file_path = root_path / "src" / "codegen" / "shared" / "compilation" / "function_imports.py"
print(str(file_path))
_generate_runner_imports(str(file_path))


class SpecialBuildHook(BuildHookInterface):
PLUGIN_NAME = "codegen_build"

def initialize(self, version: str, build_data: dict[str, Any]) -> None:
file = Path(self.root) / "src" / "codegen" / "sdk" / "__init__.py"
update_init_file(file)

update_function_imports(Path(self.root))
build_data["artifacts"].append(f"/{file}")
20 changes: 0 additions & 20 deletions src/codegen/sdk/core/global_context.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/codegen/shared/compilation/function_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_generated_imports():
from codegen.git.models.pr_part_context import PRPartContext
from codegen.git.models.pull_request_context import PullRequestContext

from codegen.sdk.codebase.control_flow import StopCodemodException
from codegen.shared.exceptions.control_flow import StopCodemodException

# GraphSitter imports (public)
from codegen.sdk.codebase.flagging.enums import FlagKwargs
Expand Down