From b945ebc3eaf5426411d01ce3f72b06d17be4f9b5 Mon Sep 17 00:00:00 2001 From: codegen-bot Date: Mon, 27 Jan 2025 17:14:01 -0800 Subject: [PATCH 1/2] Move to /examples --- .pre-commit-config.yaml | 17 +++++- .../flask_to_fastapi_migration}/README.md | 8 +-- .../input_repo/main.py | 0 .../input_repo/static/index.html | 0 .../input_repo/static/script.js | 0 .../input_repo/static/style.css | 0 .../input_repo/templates/authors.html | 0 .../input_repo/templates/books.html | 0 .../input_repo/templates/categories.html | 0 .../input_repo/templates/index.html | 0 .../flask_to_fastapi_migration}/run.py | 0 .../README.md | 2 +- .../run.py | 0 .../generate_training_data}/README.md | 2 +- .../generate_training_data}/run.py | 10 ++-- .../python2_to_python3}/README.md | 12 ++--- .../python2_to_python3}/input_repo/main.py | 0 .../python2_to_python3}/run.py | 0 .../remove_default_exports}/README.md | 2 +- .../input_repo/package.json | 0 .../src/auth/services/authenticator.ts | 0 .../src/auth/shared/authenticator.ts | 0 .../input_repo/src/auth/shared/token.ts | 0 .../src/auth/utils/token-generator.ts | 0 .../input_repo/src/comments/models/comment.ts | 0 .../src/comments/services/comment-service.ts | 0 .../input_repo/src/comments/shared/service.ts | 0 .../input_repo/src/comments/shared/types.ts | 0 .../input_repo/src/posts/models/post.ts | 0 .../src/posts/services/post-service.ts | 0 .../input_repo/src/posts/shared/service.ts | 0 .../input_repo/src/posts/shared/types.ts | 0 .../input_repo/src/shared/index.ts | 0 .../input_repo/src/users/models/user.ts | 0 .../src/users/services/user-service.ts | 0 .../input_repo/src/users/shared/service.ts | 0 .../input_repo/src/users/shared/types.ts | 0 .../input_repo/tsconfig.json | 0 .../remove_default_exports}/run.py | 0 .../sqlalchemy_1.6_to_2.0}/README.md | 10 ++-- .../sqlalchemy_1.6_to_2.0}/guide.md | 14 ++--- .../input_repo/database.py | 0 .../sqlalchemy_1.6_to_2.0}/input_repo/main.py | 0 .../input_repo/models.py | 0 .../input_repo/schemas.py | 0 .../output_repo/database.py | 0 .../output_repo/main.py | 0 .../output_repo/models.py | 0 .../output_repo/schemas.py | 0 .../sqlalchemy_type_annotations}/README.md | 12 ++--- .../input_repo/README.md | 0 .../input_repo/config/settings.py | 0 .../input_repo/database/connection.py | 0 .../input_repo/models/base.py | 0 .../input_repo/models/organization.py | 0 .../input_repo/models/transaction.py | 0 .../input_repo/models/user.py | 0 .../sqlalchemy_type_annotations}/run.py | 0 .../unittest_to_pytest}/README.md | 14 ++--- .../input_repo/jj_classes/__init__.py | 0 .../input_repo/jj_classes/castle.py | 0 .../input_repo/jj_classes/character.py | 0 .../input_repo/run_tests.py | 0 .../input_repo/tests/__init__.py | 0 .../input_repo/tests/test_classes.py | 0 .../unittest_to_pytest}/run.py | 0 .../README.md | 0 .../run.py | 4 +- pyproject.toml | 2 +- uv.lock | 54 +++++++++++++++++-- 70 files changed, 107 insertions(+), 56 deletions(-) rename {flask_to_fastapi_migration => examples/flask_to_fastapi_migration}/README.md (96%) rename {flask_to_fastapi_migration => examples/flask_to_fastapi_migration}/input_repo/main.py (100%) rename {flask_to_fastapi_migration => examples/flask_to_fastapi_migration}/input_repo/static/index.html (100%) rename {flask_to_fastapi_migration => examples/flask_to_fastapi_migration}/input_repo/static/script.js (100%) rename {flask_to_fastapi_migration => examples/flask_to_fastapi_migration}/input_repo/static/style.css (100%) rename {flask_to_fastapi_migration => examples/flask_to_fastapi_migration}/input_repo/templates/authors.html (100%) rename {flask_to_fastapi_migration => examples/flask_to_fastapi_migration}/input_repo/templates/books.html (100%) rename {flask_to_fastapi_migration => examples/flask_to_fastapi_migration}/input_repo/templates/categories.html (100%) rename {flask_to_fastapi_migration => examples/flask_to_fastapi_migration}/input_repo/templates/index.html (100%) rename {flask_to_fastapi_migration => examples/flask_to_fastapi_migration}/run.py (100%) rename {freezegun_to_timemachine_migration => examples/freezegun_to_timemachine_migration}/README.md (98%) rename {freezegun_to_timemachine_migration => examples/freezegun_to_timemachine_migration}/run.py (100%) rename {generate_training_data => examples/generate_training_data}/README.md (97%) rename {generate_training_data => examples/generate_training_data}/run.py (88%) rename {python2_to_python3 => examples/python2_to_python3}/README.md (96%) rename {python2_to_python3 => examples/python2_to_python3}/input_repo/main.py (100%) rename {python2_to_python3 => examples/python2_to_python3}/run.py (100%) rename {remove_default_exports => examples/remove_default_exports}/README.md (96%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/package.json (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/auth/services/authenticator.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/auth/shared/authenticator.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/auth/shared/token.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/auth/utils/token-generator.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/comments/models/comment.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/comments/services/comment-service.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/comments/shared/service.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/comments/shared/types.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/posts/models/post.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/posts/services/post-service.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/posts/shared/service.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/posts/shared/types.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/shared/index.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/users/models/user.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/users/services/user-service.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/users/shared/service.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/src/users/shared/types.ts (100%) rename {remove_default_exports => examples/remove_default_exports}/input_repo/tsconfig.json (100%) rename {remove_default_exports => examples/remove_default_exports}/run.py (100%) rename {sqlalchemy_1.6_to_2.0 => examples/sqlalchemy_1.6_to_2.0}/README.md (97%) rename {sqlalchemy_1.6_to_2.0 => examples/sqlalchemy_1.6_to_2.0}/guide.md (93%) rename {sqlalchemy_1.6_to_2.0 => examples/sqlalchemy_1.6_to_2.0}/input_repo/database.py (100%) rename {sqlalchemy_1.6_to_2.0 => examples/sqlalchemy_1.6_to_2.0}/input_repo/main.py (100%) rename {sqlalchemy_1.6_to_2.0 => examples/sqlalchemy_1.6_to_2.0}/input_repo/models.py (100%) rename {sqlalchemy_1.6_to_2.0 => examples/sqlalchemy_1.6_to_2.0}/input_repo/schemas.py (100%) rename {sqlalchemy_1.6_to_2.0 => examples/sqlalchemy_1.6_to_2.0}/output_repo/database.py (100%) rename {sqlalchemy_1.6_to_2.0 => examples/sqlalchemy_1.6_to_2.0}/output_repo/main.py (100%) rename {sqlalchemy_1.6_to_2.0 => examples/sqlalchemy_1.6_to_2.0}/output_repo/models.py (100%) rename {sqlalchemy_1.6_to_2.0 => examples/sqlalchemy_1.6_to_2.0}/output_repo/schemas.py (100%) rename {sqlalchemy_type_annotations => examples/sqlalchemy_type_annotations}/README.md (97%) rename {sqlalchemy_type_annotations => examples/sqlalchemy_type_annotations}/input_repo/README.md (100%) rename {sqlalchemy_type_annotations => examples/sqlalchemy_type_annotations}/input_repo/config/settings.py (100%) rename {sqlalchemy_type_annotations => examples/sqlalchemy_type_annotations}/input_repo/database/connection.py (100%) rename {sqlalchemy_type_annotations => examples/sqlalchemy_type_annotations}/input_repo/models/base.py (100%) rename {sqlalchemy_type_annotations => examples/sqlalchemy_type_annotations}/input_repo/models/organization.py (100%) rename {sqlalchemy_type_annotations => examples/sqlalchemy_type_annotations}/input_repo/models/transaction.py (100%) rename {sqlalchemy_type_annotations => examples/sqlalchemy_type_annotations}/input_repo/models/user.py (100%) rename {sqlalchemy_type_annotations => examples/sqlalchemy_type_annotations}/run.py (100%) rename {unittest_to_pytest => examples/unittest_to_pytest}/README.md (96%) rename {unittest_to_pytest => examples/unittest_to_pytest}/input_repo/jj_classes/__init__.py (100%) rename {unittest_to_pytest => examples/unittest_to_pytest}/input_repo/jj_classes/castle.py (100%) rename {unittest_to_pytest => examples/unittest_to_pytest}/input_repo/jj_classes/character.py (100%) rename {unittest_to_pytest => examples/unittest_to_pytest}/input_repo/run_tests.py (100%) rename {unittest_to_pytest => examples/unittest_to_pytest}/input_repo/tests/__init__.py (100%) rename {unittest_to_pytest => examples/unittest_to_pytest}/input_repo/tests/test_classes.py (100%) rename {unittest_to_pytest => examples/unittest_to_pytest}/run.py (100%) rename {usesuspensequery_to_usesuspensequeries => examples/usesuspensequery_to_usesuspensequeries}/README.md (100%) rename {usesuspensequery_to_usesuspensequeries => examples/usesuspensequery_to_usesuspensequeries}/run.py (95%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 124d609..4e7e719 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,16 @@ default_language_version: python: python3.12 fail_fast: true + +ci: + # Define the common exclude pattern as an anchor + exclude_patterns: &exclude_patterns | + (?x)( + input_repo/.*| + output_repo/.*| + repositories/.* + ) + repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.9.3 @@ -9,10 +19,12 @@ repos: - id: ruff types_or: [python, jupyter, pyi] args: [--fix] + exclude: *exclude_patterns # Run the formatter. - id: ruff-format types_or: [python, jupyter, pyi] + exclude: *exclude_patterns - repo: https://github.com/kynan/nbstripout rev: 0.8.1 @@ -23,11 +35,12 @@ repos: rev: v5.0.0 hooks: - id: trailing-whitespace - exclude: tests/ + exclude: *exclude_patterns exclude_types: [mdx, pyi] - id: check-yaml + exclude: *exclude_patterns - id: end-of-file-fixer - files: .*/expected_diff.patch + exclude: *exclude_patterns - id: check-merge-conflict - repo: https://github.com/python-jsonschema/check-jsonschema diff --git a/flask_to_fastapi_migration/README.md b/examples/flask_to_fastapi_migration/README.md similarity index 96% rename from flask_to_fastapi_migration/README.md rename to examples/flask_to_fastapi_migration/README.md index 3636cd9..3803f56 100644 --- a/flask_to_fastapi_migration/README.md +++ b/examples/flask_to_fastapi_migration/README.md @@ -13,7 +13,7 @@ The migration script handles four key transformations: # From: from flask import Flask app = Flask(__name__) - + # To: from fastapi import FastAPI app = FastAPI() @@ -23,7 +23,7 @@ The migration script handles four key transformations: ```python # From: @app.route("/users", methods=["POST"]) - + # To: @app.post("/users") ``` @@ -39,7 +39,7 @@ The migration script handles four key transformations: ```python # From: return render_template("users.html", users=users) - + # To: return Jinja2Templates(directory="templates").TemplateResponse( "users.html", @@ -71,4 +71,4 @@ The script will process all Python files in the `repo-before` directory and appl - [Full Tutorial](https://docs.codegen.com/tutorials/flask-to-fastapi) - [Flask Documentation](https://flask.palletsprojects.com/) - [FastAPI Documentation](https://fastapi.tiangolo.com/) -- [Codegen Documentation](https://docs.codegen.com) \ No newline at end of file +- [Codegen Documentation](https://docs.codegen.com) diff --git a/flask_to_fastapi_migration/input_repo/main.py b/examples/flask_to_fastapi_migration/input_repo/main.py similarity index 100% rename from flask_to_fastapi_migration/input_repo/main.py rename to examples/flask_to_fastapi_migration/input_repo/main.py diff --git a/flask_to_fastapi_migration/input_repo/static/index.html b/examples/flask_to_fastapi_migration/input_repo/static/index.html similarity index 100% rename from flask_to_fastapi_migration/input_repo/static/index.html rename to examples/flask_to_fastapi_migration/input_repo/static/index.html diff --git a/flask_to_fastapi_migration/input_repo/static/script.js b/examples/flask_to_fastapi_migration/input_repo/static/script.js similarity index 100% rename from flask_to_fastapi_migration/input_repo/static/script.js rename to examples/flask_to_fastapi_migration/input_repo/static/script.js diff --git a/flask_to_fastapi_migration/input_repo/static/style.css b/examples/flask_to_fastapi_migration/input_repo/static/style.css similarity index 100% rename from flask_to_fastapi_migration/input_repo/static/style.css rename to examples/flask_to_fastapi_migration/input_repo/static/style.css diff --git a/flask_to_fastapi_migration/input_repo/templates/authors.html b/examples/flask_to_fastapi_migration/input_repo/templates/authors.html similarity index 100% rename from flask_to_fastapi_migration/input_repo/templates/authors.html rename to examples/flask_to_fastapi_migration/input_repo/templates/authors.html diff --git a/flask_to_fastapi_migration/input_repo/templates/books.html b/examples/flask_to_fastapi_migration/input_repo/templates/books.html similarity index 100% rename from flask_to_fastapi_migration/input_repo/templates/books.html rename to examples/flask_to_fastapi_migration/input_repo/templates/books.html diff --git a/flask_to_fastapi_migration/input_repo/templates/categories.html b/examples/flask_to_fastapi_migration/input_repo/templates/categories.html similarity index 100% rename from flask_to_fastapi_migration/input_repo/templates/categories.html rename to examples/flask_to_fastapi_migration/input_repo/templates/categories.html diff --git a/flask_to_fastapi_migration/input_repo/templates/index.html b/examples/flask_to_fastapi_migration/input_repo/templates/index.html similarity index 100% rename from flask_to_fastapi_migration/input_repo/templates/index.html rename to examples/flask_to_fastapi_migration/input_repo/templates/index.html diff --git a/flask_to_fastapi_migration/run.py b/examples/flask_to_fastapi_migration/run.py similarity index 100% rename from flask_to_fastapi_migration/run.py rename to examples/flask_to_fastapi_migration/run.py diff --git a/freezegun_to_timemachine_migration/README.md b/examples/freezegun_to_timemachine_migration/README.md similarity index 98% rename from freezegun_to_timemachine_migration/README.md rename to examples/freezegun_to_timemachine_migration/README.md index 77150d9..c1155ec 100644 --- a/freezegun_to_timemachine_migration/README.md +++ b/examples/freezegun_to_timemachine_migration/README.md @@ -132,4 +132,4 @@ python run.py ## Contributing -Feel free to submit issues and enhancement requests! \ No newline at end of file +Feel free to submit issues and enhancement requests! diff --git a/freezegun_to_timemachine_migration/run.py b/examples/freezegun_to_timemachine_migration/run.py similarity index 100% rename from freezegun_to_timemachine_migration/run.py rename to examples/freezegun_to_timemachine_migration/run.py diff --git a/generate_training_data/README.md b/examples/generate_training_data/README.md similarity index 97% rename from generate_training_data/README.md rename to examples/generate_training_data/README.md index 9a7cac4..e584780 100644 --- a/generate_training_data/README.md +++ b/examples/generate_training_data/README.md @@ -90,4 +90,4 @@ The generated `training_data.json` follows this structure: - [Full Tutorial](https://docs.codegen.com/tutorials/generate-training-data) - [Code Model Pre-training](https://docs.codegen.com/concepts/code-model-training) -- [Codegen Documentation](https://docs.codegen.com) \ No newline at end of file +- [Codegen Documentation](https://docs.codegen.com) diff --git a/generate_training_data/run.py b/examples/generate_training_data/run.py similarity index 88% rename from generate_training_data/run.py rename to examples/generate_training_data/run.py index 2702846..6c1d8d2 100644 --- a/generate_training_data/run.py +++ b/examples/generate_training_data/run.py @@ -24,7 +24,7 @@ def get_function_context(function) -> dict: # Add dependencies for dep in function.dependencies: - # Hop through imports to find the root symbols ource + # Hop through imports to find the root symbols source if isinstance(dep, Import): dep = hop_through_imports(dep) @@ -81,12 +81,8 @@ def run(codebase: Codebase): # Update metadata training_data["metadata"]["total_processed"] = len(training_data["functions"]) if training_data["functions"]: - training_data["metadata"]["avg_dependencies"] = sum( - len(f["dependencies"]) for f in training_data["functions"] - ) / len(training_data["functions"]) - training_data["metadata"]["avg_usages"] = sum( - len(f["usages"]) for f in training_data["functions"] - ) / len(training_data["functions"]) + training_data["metadata"]["avg_dependencies"] = sum(len(f["dependencies"]) for f in training_data["functions"]) / len(training_data["functions"]) + training_data["metadata"]["avg_usages"] = sum(len(f["usages"]) for f in training_data["functions"]) / len(training_data["functions"]) # Print stats print(f"Processed {training_data['metadata']['total_processed']} functions") diff --git a/python2_to_python3/README.md b/examples/python2_to_python3/README.md similarity index 96% rename from python2_to_python3/README.md rename to examples/python2_to_python3/README.md index e4da3d7..f393861 100644 --- a/python2_to_python3/README.md +++ b/examples/python2_to_python3/README.md @@ -13,7 +13,7 @@ The migration script handles five key transformations: # From: print "Hello, world!" print x, y, z - + # To: print("Hello, world!") print(x, y, z) @@ -25,7 +25,7 @@ The migration script handles five key transformations: from __future__ import unicode_literals text = unicode("Hello") prefix = u"prefix" - + # To: text = str("Hello") prefix = "prefix" @@ -35,7 +35,7 @@ The migration script handles five key transformations: ```python # From: name = raw_input("Enter your name: ") - + # To: name = input("Enter your name: ") ``` @@ -47,7 +47,7 @@ The migration script handles five key transformations: process_data() except ValueError, e: print(e) - + # To: try: process_data() @@ -61,7 +61,7 @@ The migration script handles five key transformations: class MyIterator: def next(self): return self.value - + # To: class MyIterator: def __next__(self): @@ -91,4 +91,4 @@ The script will process all Python files in the `repo-before` directory and appl - [Full Tutorial](https://docs.codegen.com/tutorials/python2-to-python3) - [Python 3 Documentation](https://docs.python.org/3/) - [What's New in Python 3](https://docs.python.org/3/whatsnew/3.0.html) -- [Codegen Documentation](https://docs.codegen.com) \ No newline at end of file +- [Codegen Documentation](https://docs.codegen.com) diff --git a/python2_to_python3/input_repo/main.py b/examples/python2_to_python3/input_repo/main.py similarity index 100% rename from python2_to_python3/input_repo/main.py rename to examples/python2_to_python3/input_repo/main.py diff --git a/python2_to_python3/run.py b/examples/python2_to_python3/run.py similarity index 100% rename from python2_to_python3/run.py rename to examples/python2_to_python3/run.py diff --git a/remove_default_exports/README.md b/examples/remove_default_exports/README.md similarity index 96% rename from remove_default_exports/README.md rename to examples/remove_default_exports/README.md index ab0d14c..ed4fe9b 100644 --- a/remove_default_exports/README.md +++ b/examples/remove_default_exports/README.md @@ -63,4 +63,4 @@ python run.py ## Contributing -Feel free to submit issues and enhancement requests! \ No newline at end of file +Feel free to submit issues and enhancement requests! diff --git a/remove_default_exports/input_repo/package.json b/examples/remove_default_exports/input_repo/package.json similarity index 100% rename from remove_default_exports/input_repo/package.json rename to examples/remove_default_exports/input_repo/package.json diff --git a/remove_default_exports/input_repo/src/auth/services/authenticator.ts b/examples/remove_default_exports/input_repo/src/auth/services/authenticator.ts similarity index 100% rename from remove_default_exports/input_repo/src/auth/services/authenticator.ts rename to examples/remove_default_exports/input_repo/src/auth/services/authenticator.ts diff --git a/remove_default_exports/input_repo/src/auth/shared/authenticator.ts b/examples/remove_default_exports/input_repo/src/auth/shared/authenticator.ts similarity index 100% rename from remove_default_exports/input_repo/src/auth/shared/authenticator.ts rename to examples/remove_default_exports/input_repo/src/auth/shared/authenticator.ts diff --git a/remove_default_exports/input_repo/src/auth/shared/token.ts b/examples/remove_default_exports/input_repo/src/auth/shared/token.ts similarity index 100% rename from remove_default_exports/input_repo/src/auth/shared/token.ts rename to examples/remove_default_exports/input_repo/src/auth/shared/token.ts diff --git a/remove_default_exports/input_repo/src/auth/utils/token-generator.ts b/examples/remove_default_exports/input_repo/src/auth/utils/token-generator.ts similarity index 100% rename from remove_default_exports/input_repo/src/auth/utils/token-generator.ts rename to examples/remove_default_exports/input_repo/src/auth/utils/token-generator.ts diff --git a/remove_default_exports/input_repo/src/comments/models/comment.ts b/examples/remove_default_exports/input_repo/src/comments/models/comment.ts similarity index 100% rename from remove_default_exports/input_repo/src/comments/models/comment.ts rename to examples/remove_default_exports/input_repo/src/comments/models/comment.ts diff --git a/remove_default_exports/input_repo/src/comments/services/comment-service.ts b/examples/remove_default_exports/input_repo/src/comments/services/comment-service.ts similarity index 100% rename from remove_default_exports/input_repo/src/comments/services/comment-service.ts rename to examples/remove_default_exports/input_repo/src/comments/services/comment-service.ts diff --git a/remove_default_exports/input_repo/src/comments/shared/service.ts b/examples/remove_default_exports/input_repo/src/comments/shared/service.ts similarity index 100% rename from remove_default_exports/input_repo/src/comments/shared/service.ts rename to examples/remove_default_exports/input_repo/src/comments/shared/service.ts diff --git a/remove_default_exports/input_repo/src/comments/shared/types.ts b/examples/remove_default_exports/input_repo/src/comments/shared/types.ts similarity index 100% rename from remove_default_exports/input_repo/src/comments/shared/types.ts rename to examples/remove_default_exports/input_repo/src/comments/shared/types.ts diff --git a/remove_default_exports/input_repo/src/posts/models/post.ts b/examples/remove_default_exports/input_repo/src/posts/models/post.ts similarity index 100% rename from remove_default_exports/input_repo/src/posts/models/post.ts rename to examples/remove_default_exports/input_repo/src/posts/models/post.ts diff --git a/remove_default_exports/input_repo/src/posts/services/post-service.ts b/examples/remove_default_exports/input_repo/src/posts/services/post-service.ts similarity index 100% rename from remove_default_exports/input_repo/src/posts/services/post-service.ts rename to examples/remove_default_exports/input_repo/src/posts/services/post-service.ts diff --git a/remove_default_exports/input_repo/src/posts/shared/service.ts b/examples/remove_default_exports/input_repo/src/posts/shared/service.ts similarity index 100% rename from remove_default_exports/input_repo/src/posts/shared/service.ts rename to examples/remove_default_exports/input_repo/src/posts/shared/service.ts diff --git a/remove_default_exports/input_repo/src/posts/shared/types.ts b/examples/remove_default_exports/input_repo/src/posts/shared/types.ts similarity index 100% rename from remove_default_exports/input_repo/src/posts/shared/types.ts rename to examples/remove_default_exports/input_repo/src/posts/shared/types.ts diff --git a/remove_default_exports/input_repo/src/shared/index.ts b/examples/remove_default_exports/input_repo/src/shared/index.ts similarity index 100% rename from remove_default_exports/input_repo/src/shared/index.ts rename to examples/remove_default_exports/input_repo/src/shared/index.ts diff --git a/remove_default_exports/input_repo/src/users/models/user.ts b/examples/remove_default_exports/input_repo/src/users/models/user.ts similarity index 100% rename from remove_default_exports/input_repo/src/users/models/user.ts rename to examples/remove_default_exports/input_repo/src/users/models/user.ts diff --git a/remove_default_exports/input_repo/src/users/services/user-service.ts b/examples/remove_default_exports/input_repo/src/users/services/user-service.ts similarity index 100% rename from remove_default_exports/input_repo/src/users/services/user-service.ts rename to examples/remove_default_exports/input_repo/src/users/services/user-service.ts diff --git a/remove_default_exports/input_repo/src/users/shared/service.ts b/examples/remove_default_exports/input_repo/src/users/shared/service.ts similarity index 100% rename from remove_default_exports/input_repo/src/users/shared/service.ts rename to examples/remove_default_exports/input_repo/src/users/shared/service.ts diff --git a/remove_default_exports/input_repo/src/users/shared/types.ts b/examples/remove_default_exports/input_repo/src/users/shared/types.ts similarity index 100% rename from remove_default_exports/input_repo/src/users/shared/types.ts rename to examples/remove_default_exports/input_repo/src/users/shared/types.ts diff --git a/remove_default_exports/input_repo/tsconfig.json b/examples/remove_default_exports/input_repo/tsconfig.json similarity index 100% rename from remove_default_exports/input_repo/tsconfig.json rename to examples/remove_default_exports/input_repo/tsconfig.json diff --git a/remove_default_exports/run.py b/examples/remove_default_exports/run.py similarity index 100% rename from remove_default_exports/run.py rename to examples/remove_default_exports/run.py diff --git a/sqlalchemy_1.6_to_2.0/README.md b/examples/sqlalchemy_1.6_to_2.0/README.md similarity index 97% rename from sqlalchemy_1.6_to_2.0/README.md rename to examples/sqlalchemy_1.6_to_2.0/README.md index ad50ddd..da0e1d8 100644 --- a/sqlalchemy_1.6_to_2.0/README.md +++ b/examples/sqlalchemy_1.6_to_2.0/README.md @@ -12,7 +12,7 @@ The migration script handles four key transformations: ```python # From: session.query(User).filter_by(name='john').all() - + # To: session.execute( select(User).where(User.name == 'john') @@ -24,7 +24,7 @@ The migration script handles four key transformations: # From: users = session.query(User).all() first_user = session.query(User).first() - + # To: users = session.execute(select(User)).scalars().all() first_user = session.execute(select(User)).scalars().first() @@ -35,7 +35,7 @@ The migration script handles four key transformations: # From: class User(Base): addresses = relationship("Address", backref="user") - + # To: class User(Base): addresses = relationship("Address", back_populates="user", use_list=True) @@ -51,7 +51,7 @@ The migration script handles four key transformations: id = Column(Integer, primary_key=True) name = Column(String) addresses = relationship("Address") - + # To: class User(Base): __tablename__ = "users" @@ -83,4 +83,4 @@ The script will process all Python files in the `repo-before` directory and appl - [Full Tutorial](https://docs.codegen.com/tutorials/sqlalchemy-1.6-to-2.0) - [SQLAlchemy Documentation](https://docs.sqlalchemy.org/en/20/) - [What's New in SQLAlchemy 2.0](https://docs.sqlalchemy.org/en/20/changelog/migration_20.html) -- [Codegen Documentation](https://docs.codegen.com) \ No newline at end of file +- [Codegen Documentation](https://docs.codegen.com) diff --git a/sqlalchemy_1.6_to_2.0/guide.md b/examples/sqlalchemy_1.6_to_2.0/guide.md similarity index 93% rename from sqlalchemy_1.6_to_2.0/guide.md rename to examples/sqlalchemy_1.6_to_2.0/guide.md index 62b2e61..9135dac 100644 --- a/sqlalchemy_1.6_to_2.0/guide.md +++ b/examples/sqlalchemy_1.6_to_2.0/guide.md @@ -8,20 +8,20 @@ This guide walks you through the steps to migrate your codebase from SQLAlchemy The migration focuses on these key updates: -1. **Import Adjustments** - Aligns your code with the updated SQLAlchemy 2.0 module structure. +1. **Import Adjustments** + Aligns your code with the updated SQLAlchemy 2.0 module structure. [Run the Import Codemod](https://www.codegen.sh/search/6506?skillType=codemod) -2. **Relationship Updates** - Refines relationship definitions by replacing `backref` with `back_populates` for explicitness and better readability. +2. **Relationship Updates** + Refines relationship definitions by replacing `backref` with `back_populates` for explicitness and better readability. [Run the Relationship Codemod](https://www.codegen.sh/search/6510?skillType=codemod) -3. **Query Syntax Modernization** - Updates queries to leverage the latest syntax like `select()` and `where()`, removing deprecated methods. +3. **Query Syntax Modernization** + Updates queries to leverage the latest syntax like `select()` and `where()`, removing deprecated methods. [Run the Query Syntax Codemod](https://www.codegen.sh/search/6508?skillType=codemod) 4. **Relationship Lazy Loading** - SQLAlchemy 2.0 introduces a new `lazy` parameter for relationship definitions. Update your relationships to use the new `lazy` parameter for improved performance. + SQLAlchemy 2.0 introduces a new `lazy` parameter for relationship definitions. Update your relationships to use the new `lazy` parameter for improved performance. [Run the Relationship Lazy Loading Codemod](https://www.codegen.sh/search/6512?skillType=codemod) 5. **Type Annotations** diff --git a/sqlalchemy_1.6_to_2.0/input_repo/database.py b/examples/sqlalchemy_1.6_to_2.0/input_repo/database.py similarity index 100% rename from sqlalchemy_1.6_to_2.0/input_repo/database.py rename to examples/sqlalchemy_1.6_to_2.0/input_repo/database.py diff --git a/sqlalchemy_1.6_to_2.0/input_repo/main.py b/examples/sqlalchemy_1.6_to_2.0/input_repo/main.py similarity index 100% rename from sqlalchemy_1.6_to_2.0/input_repo/main.py rename to examples/sqlalchemy_1.6_to_2.0/input_repo/main.py diff --git a/sqlalchemy_1.6_to_2.0/input_repo/models.py b/examples/sqlalchemy_1.6_to_2.0/input_repo/models.py similarity index 100% rename from sqlalchemy_1.6_to_2.0/input_repo/models.py rename to examples/sqlalchemy_1.6_to_2.0/input_repo/models.py diff --git a/sqlalchemy_1.6_to_2.0/input_repo/schemas.py b/examples/sqlalchemy_1.6_to_2.0/input_repo/schemas.py similarity index 100% rename from sqlalchemy_1.6_to_2.0/input_repo/schemas.py rename to examples/sqlalchemy_1.6_to_2.0/input_repo/schemas.py diff --git a/sqlalchemy_1.6_to_2.0/output_repo/database.py b/examples/sqlalchemy_1.6_to_2.0/output_repo/database.py similarity index 100% rename from sqlalchemy_1.6_to_2.0/output_repo/database.py rename to examples/sqlalchemy_1.6_to_2.0/output_repo/database.py diff --git a/sqlalchemy_1.6_to_2.0/output_repo/main.py b/examples/sqlalchemy_1.6_to_2.0/output_repo/main.py similarity index 100% rename from sqlalchemy_1.6_to_2.0/output_repo/main.py rename to examples/sqlalchemy_1.6_to_2.0/output_repo/main.py diff --git a/sqlalchemy_1.6_to_2.0/output_repo/models.py b/examples/sqlalchemy_1.6_to_2.0/output_repo/models.py similarity index 100% rename from sqlalchemy_1.6_to_2.0/output_repo/models.py rename to examples/sqlalchemy_1.6_to_2.0/output_repo/models.py diff --git a/sqlalchemy_1.6_to_2.0/output_repo/schemas.py b/examples/sqlalchemy_1.6_to_2.0/output_repo/schemas.py similarity index 100% rename from sqlalchemy_1.6_to_2.0/output_repo/schemas.py rename to examples/sqlalchemy_1.6_to_2.0/output_repo/schemas.py diff --git a/sqlalchemy_type_annotations/README.md b/examples/sqlalchemy_type_annotations/README.md similarity index 97% rename from sqlalchemy_type_annotations/README.md rename to examples/sqlalchemy_type_annotations/README.md index 776211e..799406b 100644 --- a/sqlalchemy_type_annotations/README.md +++ b/examples/sqlalchemy_type_annotations/README.md @@ -44,7 +44,7 @@ The script automates the entire migration process in a few key steps: # Before id = Column(Integer, primary_key=True) name = Column(String) - + # After id: Mapped[int] = mapped_column(primary_key=True) name: Mapped[str] = mapped_column() @@ -54,7 +54,7 @@ name: Mapped[str] = mapped_column() ```python # Before description = Column(String, nullable=True) - + # After description: Mapped[Optional[str]] = mapped_column(nullable=True) ``` @@ -63,7 +63,7 @@ description: Mapped[Optional[str]] = mapped_column(nullable=True) ```python # Before addresses = relationship("Address", backref="user") - + # After addresses: Mapped[List["Address"]] = relationship(back_populates="user") ``` @@ -106,7 +106,7 @@ class Publisher(Base): id: Mapped[int] = mapped_column(primary_key=True, index=True) name: Mapped[str] = mapped_column(unique=True, index=True) books: Mapped[List["Book"]] = relationship( - "Book", + "Book", back_populates="publisher" ) @@ -122,7 +122,7 @@ class Book(Base): nullable=True ) publisher: Mapped[Optional["Publisher"]] = relationship( - "Publisher", + "Publisher", back_populates="books" ) ``` @@ -144,4 +144,4 @@ python run.py ## Contributing -Feel free to submit issues and enhancement requests! \ No newline at end of file +Feel free to submit issues and enhancement requests! diff --git a/sqlalchemy_type_annotations/input_repo/README.md b/examples/sqlalchemy_type_annotations/input_repo/README.md similarity index 100% rename from sqlalchemy_type_annotations/input_repo/README.md rename to examples/sqlalchemy_type_annotations/input_repo/README.md diff --git a/sqlalchemy_type_annotations/input_repo/config/settings.py b/examples/sqlalchemy_type_annotations/input_repo/config/settings.py similarity index 100% rename from sqlalchemy_type_annotations/input_repo/config/settings.py rename to examples/sqlalchemy_type_annotations/input_repo/config/settings.py diff --git a/sqlalchemy_type_annotations/input_repo/database/connection.py b/examples/sqlalchemy_type_annotations/input_repo/database/connection.py similarity index 100% rename from sqlalchemy_type_annotations/input_repo/database/connection.py rename to examples/sqlalchemy_type_annotations/input_repo/database/connection.py diff --git a/sqlalchemy_type_annotations/input_repo/models/base.py b/examples/sqlalchemy_type_annotations/input_repo/models/base.py similarity index 100% rename from sqlalchemy_type_annotations/input_repo/models/base.py rename to examples/sqlalchemy_type_annotations/input_repo/models/base.py diff --git a/sqlalchemy_type_annotations/input_repo/models/organization.py b/examples/sqlalchemy_type_annotations/input_repo/models/organization.py similarity index 100% rename from sqlalchemy_type_annotations/input_repo/models/organization.py rename to examples/sqlalchemy_type_annotations/input_repo/models/organization.py diff --git a/sqlalchemy_type_annotations/input_repo/models/transaction.py b/examples/sqlalchemy_type_annotations/input_repo/models/transaction.py similarity index 100% rename from sqlalchemy_type_annotations/input_repo/models/transaction.py rename to examples/sqlalchemy_type_annotations/input_repo/models/transaction.py diff --git a/sqlalchemy_type_annotations/input_repo/models/user.py b/examples/sqlalchemy_type_annotations/input_repo/models/user.py similarity index 100% rename from sqlalchemy_type_annotations/input_repo/models/user.py rename to examples/sqlalchemy_type_annotations/input_repo/models/user.py diff --git a/sqlalchemy_type_annotations/run.py b/examples/sqlalchemy_type_annotations/run.py similarity index 100% rename from sqlalchemy_type_annotations/run.py rename to examples/sqlalchemy_type_annotations/run.py diff --git a/unittest_to_pytest/README.md b/examples/unittest_to_pytest/README.md similarity index 96% rename from unittest_to_pytest/README.md rename to examples/unittest_to_pytest/README.md index 245fc78..91095ca 100644 --- a/unittest_to_pytest/README.md +++ b/examples/unittest_to_pytest/README.md @@ -12,17 +12,17 @@ The script automates the entire migration process in a few key steps: class TestUsers(unittest.TestCase): def setUp(self): self.db = setup_test_db() - + def test_create_user(self): user = self.db.create_user("test") self.assertEqual(user.name, "test") - + # To: @pytest.fixture def db(): db = setup_test_db() yield db - + def test_create_user(db): user = db.create_user("test") assert user.name == "test" @@ -37,7 +37,7 @@ The script automates the entire migration process in a few key steps: self.assertTrue(is_valid("test")) self.assertEqual(count_items(), 0) self.assertRaises(ValueError, parse_id, "invalid") - + # To: def test_validation(): assert is_valid("test") @@ -53,7 +53,7 @@ The script automates the entire migration process in a few key steps: # From: if __name__ == '__main__': unittest.main() - + # To: # Remove unittest.main() and rename files to test_*.py ``` @@ -66,7 +66,7 @@ The script automates the entire migration process in a few key steps: @classmethod def setUpClass(cls): cls.conn = create_db() - + # To: @pytest.fixture(scope="session") def conn(): @@ -101,4 +101,4 @@ The script will process all Python test files in the `repo-before` directory and ## Contributing -Feel free to submit issues and enhancement requests! \ No newline at end of file +Feel free to submit issues and enhancement requests! diff --git a/unittest_to_pytest/input_repo/jj_classes/__init__.py b/examples/unittest_to_pytest/input_repo/jj_classes/__init__.py similarity index 100% rename from unittest_to_pytest/input_repo/jj_classes/__init__.py rename to examples/unittest_to_pytest/input_repo/jj_classes/__init__.py diff --git a/unittest_to_pytest/input_repo/jj_classes/castle.py b/examples/unittest_to_pytest/input_repo/jj_classes/castle.py similarity index 100% rename from unittest_to_pytest/input_repo/jj_classes/castle.py rename to examples/unittest_to_pytest/input_repo/jj_classes/castle.py diff --git a/unittest_to_pytest/input_repo/jj_classes/character.py b/examples/unittest_to_pytest/input_repo/jj_classes/character.py similarity index 100% rename from unittest_to_pytest/input_repo/jj_classes/character.py rename to examples/unittest_to_pytest/input_repo/jj_classes/character.py diff --git a/unittest_to_pytest/input_repo/run_tests.py b/examples/unittest_to_pytest/input_repo/run_tests.py similarity index 100% rename from unittest_to_pytest/input_repo/run_tests.py rename to examples/unittest_to_pytest/input_repo/run_tests.py diff --git a/unittest_to_pytest/input_repo/tests/__init__.py b/examples/unittest_to_pytest/input_repo/tests/__init__.py similarity index 100% rename from unittest_to_pytest/input_repo/tests/__init__.py rename to examples/unittest_to_pytest/input_repo/tests/__init__.py diff --git a/unittest_to_pytest/input_repo/tests/test_classes.py b/examples/unittest_to_pytest/input_repo/tests/test_classes.py similarity index 100% rename from unittest_to_pytest/input_repo/tests/test_classes.py rename to examples/unittest_to_pytest/input_repo/tests/test_classes.py diff --git a/unittest_to_pytest/run.py b/examples/unittest_to_pytest/run.py similarity index 100% rename from unittest_to_pytest/run.py rename to examples/unittest_to_pytest/run.py diff --git a/usesuspensequery_to_usesuspensequeries/README.md b/examples/usesuspensequery_to_usesuspensequeries/README.md similarity index 100% rename from usesuspensequery_to_usesuspensequeries/README.md rename to examples/usesuspensequery_to_usesuspensequeries/README.md diff --git a/usesuspensequery_to_usesuspensequeries/run.py b/examples/usesuspensequery_to_usesuspensequeries/run.py similarity index 95% rename from usesuspensequery_to_usesuspensequeries/run.py rename to examples/usesuspensequery_to_usesuspensequeries/run.py index 57ce497..09a7e69 100644 --- a/usesuspensequery_to_usesuspensequeries/run.py +++ b/examples/usesuspensequery_to_usesuspensequeries/run.py @@ -54,9 +54,7 @@ def run(codebase: Codebase): # Convert to useSuspenseQueries if needed if old_statements: new_query = f"const [{', '.join(results)}] = useSuspenseQueries({{queries: [{', '.join(queries)}]}})" - print( - f"Converting useSuspenseQuery to useSuspenseQueries in {function.name}" - ) + print(f"Converting useSuspenseQuery to useSuspenseQueries in {function.name}") # Print the diff print("\nOriginal code:") diff --git a/pyproject.toml b/pyproject.toml index 19928fe..15b188e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ [tool.ruff] line-length = 200 -lint.exclude = [ +exclude = [ "**/input_repo/**", "**/output_repo/**", "**/repositories/**", diff --git a/uv.lock b/uv.lock index 4d286fc..e02e92b 100644 --- a/uv.lock +++ b/uv.lock @@ -383,24 +383,24 @@ version = "0.0.0" source = { virtual = "." } dependencies = [ { name = "codegen" }, - { name = "jupyterlab" }, ] [package.dev-dependencies] dev = [ + { name = "deptry" }, + { name = "jupyterlab" }, { name = "pre-commit" }, { name = "pre-commit-uv" }, { name = "uv" }, ] [package.metadata] -requires-dist = [ - { name = "codegen", specifier = "==0.5.3" }, - { name = "jupyterlab", specifier = "==4.3.4" }, -] +requires-dist = [{ name = "codegen", specifier = "==0.5.3" }] [package.metadata.requires-dev] dev = [ + { name = "deptry", specifier = ">=0.22.0" }, + { name = "jupyterlab", specifier = "==4.3.4" }, { name = "pre-commit", specifier = ">=4.0.1" }, { name = "pre-commit-uv", specifier = ">=4.1.4" }, { name = "uv", specifier = ">=0.4.25" }, @@ -550,6 +550,28 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/6e/c6/ac0b6c1e2d138f1002bcf799d330bd6d85084fece321e662a14223794041/Deprecated-1.2.18-py2.py3-none-any.whl", hash = "sha256:bd5011788200372a32418f888e326a09ff80d0214bd961147cfed01b5c018eec", size = 9998 }, ] +[[package]] +name = "deptry" +version = "0.23.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "packaging" }, + { name = "requirements-parser" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/52/7e/75a1990a7244a3d3c5364353ac76f1173aa568a67793199d09f995b66c29/deptry-0.23.0.tar.gz", hash = "sha256:4915a3590ccf38ad7a9176aee376745aa9de121f50f8da8fb9ccec87fa93e676", size = 200920 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d6/85/a8b77c8a87e7c9e81ce8437d752879b5281fd8a0b8a114c6d393f980aa72/deptry-0.23.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:1f2a6817a37d76e8f6b667381b7caf6ea3e6d6c18b5be24d36c625f387c79852", size = 1756706 }, + { url = "https://files.pythonhosted.org/packages/53/bf/26c58af1467df6e889c6b969c27dad2c67b8bd625320d9db7d70277a222f/deptry-0.23.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:9601b64cc0aed42687fdd5c912d5f1e90d7f7333fb589b14e35bfdfebae866f3", size = 1657001 }, + { url = "https://files.pythonhosted.org/packages/ae/7d/b0bd6a50ec3f87b0a5ed3bff64ac2bd5bd8d3205e570bc5bc3170f26a01f/deptry-0.23.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e6172b2205f6e84bcc9df25226693d4deb9576a6f746c2ace828f6d13401d357", size = 1754607 }, + { url = "https://files.pythonhosted.org/packages/e6/1b/79b1213bb9b58b0bcc200867cd6d64cd76ec4b9c5cdb76f95c3e6ee7b92e/deptry-0.23.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1cfa4b3a46ee8a026eaa38e4b9ba43fe6036a07fe16bf0a663cb611b939f6af8", size = 1831961 }, + { url = "https://files.pythonhosted.org/packages/09/d6/607004f20637987d437f420f3dad4d6f1a87a4a83380ab60220397ee8fbe/deptry-0.23.0-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:9d03cc99a61c348df92074a50e0a71b28f264f0edbf686084ca90e6fd44e3abe", size = 1932126 }, + { url = "https://files.pythonhosted.org/packages/ff/ff/6fff20bf2632727af55dc3a24a6f5634dcdf34fd785402a55207ba49d9cc/deptry-0.23.0-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:9a46f78098f145100dc582a59af8548b26cdfa16cf0fbd85d2d44645e724cb6a", size = 2004755 }, + { url = "https://files.pythonhosted.org/packages/41/30/1b6217bdccf2144d4c3e78f89b2a84db82478b2449599c2d3b4b21a89043/deptry-0.23.0-cp39-abi3-win_amd64.whl", hash = "sha256:d53e803b280791d89a051b6183d9dc40411200e22a8ab7e6c32c6b169822a664", size = 1606944 }, + { url = "https://files.pythonhosted.org/packages/28/ab/47398041d11b19aa9db28f28cf076dbe42aba3e16d67d3e7911330e3a304/deptry-0.23.0-cp39-abi3-win_arm64.whl", hash = "sha256:da7678624f4626d839c8c03675452cefc59d6cf57d25c84a9711dae514719279", size = 1518394 }, +] + [[package]] name = "dicttoxml" version = "1.7.16" @@ -2240,6 +2262,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f9/9b/335f9764261e915ed497fcdeb11df5dfd6f7bf257d4a6a2a686d80da4d54/requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6", size = 64928 }, ] +[[package]] +name = "requirements-parser" +version = "0.11.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "packaging" }, + { name = "types-setuptools" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/70/80ed53ebd21853855aad552d4ed6c4934df62cd32fe9a3669fcdef59429c/requirements_parser-0.11.0.tar.gz", hash = "sha256:35f36dc969d14830bf459803da84f314dc3d17c802592e9e970f63d0359e5920", size = 23663 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/33/190393a7d36872e237cbc99e6c44d9a078a1ba7b406462fe6eafd5a28e04/requirements_parser-0.11.0-py3-none-any.whl", hash = "sha256:50379eb50311834386c2568263ae5225d7b9d0867fb55cf4ecc93959de2c2684", size = 14800 }, +] + [[package]] name = "rfc3339-validator" version = "0.1.4" @@ -2735,6 +2770,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/0f/b3/ca41df24db5eb99b00d97f89d7674a90cb6b3134c52fb8121b6d8d30f15c/types_python_dateutil-2.9.0.20241206-py3-none-any.whl", hash = "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53", size = 14384 }, ] +[[package]] +name = "types-setuptools" +version = "75.8.0.20250110" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f7/42/5713e90d4f9683f2301d900f33e4fc2405ad8ac224dda30f6cb7f4cd215b/types_setuptools-75.8.0.20250110.tar.gz", hash = "sha256:96f7ec8bbd6e0a54ea180d66ad68ad7a1d7954e7281a710ea2de75e355545271", size = 48185 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cf/a3/dbfd106751b11c728cec21cc62cbfe7ff7391b935c4b6e8f0bdc2e6fd541/types_setuptools-75.8.0.20250110-py3-none-any.whl", hash = "sha256:a9f12980bbf9bcdc23ecd80755789085bad6bfce4060c2275bc2b4ca9f2bc480", size = 71521 }, +] + [[package]] name = "typing-extensions" version = "4.12.2" From a1bbef4c16e39edcf23fbadd75235f1b8a6abce4 Mon Sep 17 00:00:00 2001 From: codegen-bot Date: Mon, 27 Jan 2025 17:17:01 -0800 Subject: [PATCH 2/2] include nested --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4e7e719..751a404 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,9 +6,9 @@ ci: # Define the common exclude pattern as an anchor exclude_patterns: &exclude_patterns | (?x)( - input_repo/.*| - output_repo/.*| - repositories/.* + .*/input_repo/.*| + .*/output_repo/.*| + .*/repositories/.* ) repos: