Skip to content

Commit 2c52955

Browse files
author
codegen-bot
committed
Merge branch 'jayhack-cg-10512-codegen-create-description-working-again' of github.com:codegen-sh/codegen-sdk into jayhack-cg-10512-codegen-create-description-working-again
2 parents bfdd541 + 3cd8ef0 commit 2c52955

File tree

27 files changed

+926
-210
lines changed

27 files changed

+926
-210
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ graph-sitter-types/typings/**
6565
coverage.json
6666
tests/integration/verified_codemods/codemod_data/repo_commits.json
6767
.codegen/*
68+
.benchmarks/*

.pre-commit-config.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ repos:
2020
- id: biome-check
2121
additional_dependencies: ["@biomejs/[email protected]"]
2222
exclude: (src/codemods/eval)|(tests/unit/skills/snapshots)|(tests/unit/codegen/sdk/output)|(tests/integration/verified_codemods)|(docs/samples)
23-
23+
- repo: https://github.com/ComPWA/taplo-pre-commit
24+
rev: v0.9.3
25+
hooks:
26+
- id: taplo-format
2427
- repo: https://github.com/MarcoGorelli/cython-lint
2528
rev: v0.16.6
2629
hooks:

README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
1-
# Codegen
1+
<br />
22

3-
[![Documentation](https://img.shields.io/badge/docs-docs.codegen.com-blue)](https://docs.codegen.com)
4-
[![Slack Community](https://img.shields.io/badge/slack-community-4A154B?logo=slack)](https://community.codegen.com)
5-
[![Twitter Follow](https://img.shields.io/twitter/follow/codegen)](https://twitter.com/codegen)
3+
<p align="center">
4+
<a href="https://docs.codegen.com">
5+
<picture>
6+
<source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/a53b6ea7-4d6f-446b-bd65-c2e8cae57cfd">
7+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/f4e427e2-c483-4c23-9a7a-43c4256cab18">
8+
<img src="https://github.com/user-attachments/assets/a53b6ea7-4d6f-446b-bd65-c2e8cae57cfd" height="75" alt="Codegen logo"/>
9+
</picture>
10+
</a>
11+
</p>
12+
13+
<h2 align="center">
14+
The Pythonic interface to transform your code.
15+
</h2>
16+
17+
<div align="center">
18+
19+
[![PyPI](https://img.shields.io/pypi/v/codegen?style=flat-square&color=blue)](https://pypi.org/project/codegen/)
20+
[![Documentation](https://img.shields.io/badge/docs-docs.codegen.com-purple?style=flat-square)](https://docs.codegen.com)
21+
[![Slack Community](https://img.shields.io/badge/slack-community-4A154B?logo=slack&style=flat-square)](https://community.codegen.com)
22+
[![Follow on X](https://img.shields.io/twitter/follow/codegen?style=social)](https://x.com/codegen)
23+
24+
</div>
25+
26+
<br />
627

728
[Codegen](https://docs.codegen.com) is a python library for manipulating codebases.
829

@@ -11,7 +32,7 @@
1132
from codegen import Codebase
1233

1334
# Codegen builds a complete graph connecting
14-
# functions, classes, imports and their relationships
35+
# functions, classes, imports and their relationships
1536
codebase = Codebase("./")
1637

1738
# Work with code without dealing with syntax trees or parsing
@@ -21,7 +42,6 @@ for function in codebase.functions:
2142
# Auto-handles references and imports to maintain correctness
2243
function.move_to_file('deprecated.py')
2344
```
24-
2545
Write code that transforms code. Codegen combines the parsing power of [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) with the graph algorithms of [rustworkx](https://github.com/Qiskit/rustworkx) to enable scriptable, multi-language code manipulation at scale.
2646

2747
## Installation and Usage

hatch.toml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ tool = ["uv", "pip"]
1212
[envs.hatch-build.overrides]
1313
matrix.tool.installer = { value = "{matrix:tool}" }
1414
matrix.tool.scripts = [
15-
{ key = "pip", value = "{env:HATCH_UV} pip {args}", if = [
16-
"uv",
17-
] },
15+
{ key = "pip", value = "{env:HATCH_UV} pip {args}", if = [
16+
"uv",
17+
] },
1818
]
1919

2020
[version]
@@ -25,19 +25,19 @@ UV_EXTRA_INDEX_URL = "https://[email protected].
2525

2626
[build.targets.wheel.hooks.cython]
2727
dependencies = [
28-
"hatch-cython @ git+https://github.com/codegen-sh/hatch-cython.git",
29-
"cython>=3.0.11",
30-
"tree-sitter",
31-
"networkx",
28+
"hatch-cython @ git+https://github.com/codegen-sh/hatch-cython.git",
29+
"cython>=3.0.11",
30+
"tree-sitter",
31+
"networkx",
3232
]
3333

3434
[build.targets.wheel.hooks.cython.options]
3535
src = "codegen/sdk"
3636
compile_args = [
37-
"-O3",
38-
{ platforms = [
39-
"darwin",
40-
], arch = "arm64", arg = "-mcpu=apple-m1" },
37+
"-O3",
38+
{ platforms = [
39+
"darwin",
40+
], arch = "arm64", arg = "-mcpu=apple-m1" },
4141
]
4242
cythonize_kwargs = { annotate = true, nthreads = 16, exclude_failures = false, cache = true }
4343
compiled_sdist = true
@@ -57,27 +57,30 @@ c_string_type = "unicode"
5757

5858
[build.targets.wheel.hooks.cython.options.files]
5959
exclude = [
60-
"**/__init__.py",
61-
"**/code_generation",
62-
"**/skills",
63-
"**/codebase/factory",
64-
"**/guides",
65-
"**/testing",
66-
"**/codebase_graph_utils.py",
60+
"**/__init__.py",
61+
"**/code_generation",
62+
"**/skills",
63+
"**/codebase/factory",
64+
"**/guides",
65+
"**/testing",
66+
"**/codebase_graph_utils.py",
6767
]
6868

6969
[build.targets.wheel]
7070
macos-max-compat = false
7171

7272
[build]
73-
packages = [
74-
"src/codegen",
75-
]
76-
77-
[metadata.hooks.vcs]
78-
Homepage = "https://github.com/codegen-sh/codegen-sdk"
79-
source_archive = "https://github.com/codegen-sh/codegen-sdk/archive/{commit_hash}.zip"
73+
packages = ["src/codegen"]
8074

75+
[metadata.hooks.vcs.urls]
76+
Homepage = "https://www.codegen.com/"
77+
Repository = "https://github.com/codegen-sh/codegen-sdk"
78+
download = "https://github.com/codegen-sh/codegen-sdk/archive/{commit_hash}.zip"
79+
Changelog = "https://docs.codegen.com/changelog/changelog"
80+
Releasenotes = "https://github.com/codegen-sh/codegen-sdk/releases"
81+
Issues = "https://github.com/codegen-sh/codegen-sdk/issues"
82+
Documentation = "https://docs.codegen.com"
83+
Playground = "https://www.codegen.sh/"
8184

8285
[build.targets.wheel.hooks.custom]
8386
enable-by-default = false

0 commit comments

Comments
 (0)