Skip to content

Commit a767bc7

Browse files
committed
Merge remote-tracking branch 'origin/develop' into tawsif/fix-imports
2 parents 0b4d9a6 + a7e9325 commit a767bc7

File tree

105 files changed

+1279
-357
lines changed

Some content is hidden

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

105 files changed

+1279
-357
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import codegen
2+
from codegen.sdk.core.codebase import Codebase
3+
from codegen.shared.enums.programming_language import ProgrammingLanguage
4+
5+
6+
@codegen.function("test-language", subdirectories=["src/codegen/cli"], language=ProgrammingLanguage.PYTHON)
7+
def run(codebase: Codebase):
8+
file = codebase.get_file("src/codegen/cli/errors.py")
9+
print(f"File: {file.path}")
10+
for s in file.symbols:
11+
print(s.name)
12+
13+
14+
if __name__ == "__main__":
15+
print("Parsing codebase...")
16+
codebase = Codebase("./")
17+
18+
print("Running...")
19+
run(codebase)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import codegen
2+
from codegen.sdk.core.codebase import PyCodebaseType
3+
4+
5+
@codegen.function("update-loggers")
6+
def run(codebase: PyCodebaseType) -> None:
7+
"""Updates all loggers in src/codegen to use the new get_logger function."""
8+
for file in codebase.files:
9+
if not str(file.filepath).startswith("src/codegen/"):
10+
continue
11+
12+
if file.get_import("logging") is None:
13+
continue
14+
15+
if (logger := file.get_global_var("logger")) and logger.value.source == "logging.getLogger(__name__)":
16+
print(f"Updating logger in {file.filepath}")
17+
logger.set_value("get_logger(__name__)")
18+
file.add_import_from_import_string("\nfrom codegen.shared.logging.get_logger import get_logger")

.github/actions/report/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ runs:
1919
- name: Upload coverage reports to Codecov
2020
if: (success() || failure()) # always upload coverage reports even if the tests fail
2121
continue-on-error: true
22-
uses: codecov/codecov-action@v5.3.1
22+
uses: codecov/codecov-action@v5.4.0
2323
with:
2424
token: ${{ inputs.codecov_token }}
2525
files: coverage.xml

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ See [Getting Started](https://docs.codegen.com/introduction/getting-started) for
7979
from codegen import Codebase
8080
```
8181

82+
## Troubleshooting
83+
84+
Having issues? Here are some common problems and their solutions:
85+
86+
- **I'm hitting an UV error related to `[[ packages ]]`**: This means you're likely using an outdated version of UV. Try updating to the latest version with: `uv self update`.
87+
- **I'm hitting an error about `No module named 'codegen.sdk.extensions.utils'`**: The compiled cython extensions are out of sync. Update them with `uv sync --reinstall-package codegen`.
88+
- **I'm hitting a `RecursionError: maximum recursion depth exceeded` error while parsing my codebase**: If you are using python 3.12, try upgrading to 3.13. If you are already on 3.13, try upping the recursion limit with `sys.setrecursionlimit(10000)`.
89+
90+
If you run into additional issues not listed here, please [join our slack community](https://community.codegen.com) and we'll help you out!
91+
8292
## Resources
8393

8494
- [Docs](https://docs.codegen.com)

0 commit comments

Comments
 (0)