Skip to content

Commit e30a9a3

Browse files
authored
Merge branch 'main' into pujol-cg-10392-advanced-topics-in-importsexports
2 parents 4ca5734 + a6448de commit e30a9a3

File tree

23 files changed

+3185
-7
lines changed

23 files changed

+3185
-7
lines changed

.github/actions/setup/action.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Setup"
2+
description: "Setup tools for run"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
8+
- name: Install UV
9+
uses: astral-sh/setup-uv@v5
10+
id: setup-uv
11+
with:
12+
enable-cache: false
13+
prune-cache: true
14+
version: '0.5.21'
15+
cache-dependency-glob: '**/uv.lock'
16+
17+
- name: Install dependencies
18+
shell: bash
19+
run: |
20+
uv sync --frozen

.github/workflows/pre-commit.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
8+
jobs:
9+
pre-commit:
10+
# changing the following value will significantly affect github's billing. Be careful and consult with the team before changing it.
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 10
13+
14+
steps:
15+
- name: Check out the repo
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
repository: ${{ github.event.pull_request.head.repo.full_name }}
20+
ref: ${{ github.event.pull_request.head.ref }}
21+
22+
- name: Setup backend
23+
id: setup
24+
uses: ./.github/actions/setup
25+
26+
- name: Setup-pre-commit
27+
run: uv tool install pre-commit --with pre-commit-uv --force-reinstall
28+
29+
- uses: actions/cache@v4
30+
with:
31+
path: |
32+
~/.cache/pre-commit
33+
~/.cache/uv
34+
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('\.pre-commit-config.yaml') }}
35+
36+
- name: Run pre-commit
37+
run: uv run --frozen pre-commit run --show-diff-on-failure --color=always --all-files --source ${{ github.event.pull_request.base.sha }} --origin ${{ github.event.pull_request.head.sha }} --show-diff-on-failure --color=always
38+
shell: bash
39+
40+
- uses: stefanzweifel/git-auto-commit-action@v5
41+
# Always commit changes even if pre-commit failed
42+
if: always()
43+
with:
44+
commit_message: "Automated pre-commit update"

.pre-commit-config.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
default_language_version:
2+
python: python3.12
3+
fail_fast: true
4+
repos:
5+
- repo: https://github.com/astral-sh/ruff-pre-commit
6+
rev: v0.9.3
7+
hooks:
8+
# Run the linter.
9+
- id: ruff
10+
types_or: [python, jupyter, pyi]
11+
args: [--fix]
12+
13+
# Run the formatter.
14+
- id: ruff-format
15+
types_or: [python, jupyter, pyi]
16+
17+
- repo: https://github.com/kynan/nbstripout
18+
rev: 0.8.1
19+
hooks:
20+
- id: nbstripout
21+
22+
- repo: https://github.com/pre-commit/pre-commit-hooks
23+
rev: v5.0.0
24+
hooks:
25+
- id: trailing-whitespace
26+
exclude: tests/
27+
exclude_types: [mdx, pyi]
28+
- id: check-yaml
29+
- id: end-of-file-fixer
30+
files: .*/expected_diff.patch
31+
- id: check-merge-conflict
32+
33+
- repo: https://github.com/python-jsonschema/check-jsonschema
34+
rev: 0.31.0
35+
hooks:
36+
- id: check-github-workflows
37+
- id: check-github-actions
38+
args: ["--verbose"]
39+
40+
- repo: https://github.com/mxr/sync-pre-commit-deps
41+
rev: v0.0.3
42+
hooks:
43+
- id: sync-pre-commit-deps
44+
45+
- repo: https://github.com/codespell-project/codespell
46+
rev: v2.4.0
47+
hooks:
48+
- id: codespell
49+
additional_dependencies:
50+
- tomli
51+
files: ".*"
52+
53+
- repo: https://github.com/astral-sh/uv-pre-commit
54+
rev: "0.5.24"
55+
hooks:
56+
- id: uv-lock
57+
entry: bash -c "uv lock --frozen"

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@ brew install uv
1515

1616
Create and activate a Python 3.13 virtual environment
1717
```bash
18-
uv venv --python 3.13.0 && source .venv/bin/activate
18+
uv venv && source .venv/bin/activate
1919
```
2020

2121
Install the `codegen` package
2222
```bash
23-
uv pip install codegen
24-
```
25-
26-
__Optional__: Install Jupyter for interactive exploration
27-
```bash
28-
uv pip install jupyterlab && jupyter lab
23+
uv sync
2924
```
3025

3126
## Examples
File renamed without changes.

flask_to_fastapi_migration/repo-before/static/index.html renamed to flask_to_fastapi_migration/input_repo/static/index.html

File renamed without changes.

flask_to_fastapi_migration/repo-before/static/script.js renamed to flask_to_fastapi_migration/input_repo/static/script.js

File renamed without changes.

flask_to_fastapi_migration/repo-before/static/style.css renamed to flask_to_fastapi_migration/input_repo/static/style.css

File renamed without changes.

flask_to_fastapi_migration/repo-before/templates/authors.html renamed to flask_to_fastapi_migration/input_repo/templates/authors.html

File renamed without changes.

flask_to_fastapi_migration/repo-before/templates/books.html renamed to flask_to_fastapi_migration/input_repo/templates/books.html

File renamed without changes.

0 commit comments

Comments
 (0)