diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index eb98a726..d9077058 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -149,7 +149,7 @@ jobs: working-directory: ${{ env.WORKING_DIR }} run: | git add . - uv run prek run --all-files + uv run prek run --all-files --skip no-commit-to-branch - name: Test with pytest working-directory: ${{ env.WORKING_DIR }} if: matrix.project_type == 'application' @@ -235,7 +235,7 @@ jobs: working-directory: ${{ env.WORKING_DIR }} run: | git add . - uv run prek run --all-files + uv run prek run --all-files --skip no-commit-to-branch - name: Test with pytest working-directory: ${{ env.WORKING_DIR }} run: uv run pytest @@ -304,7 +304,7 @@ jobs: working-directory: ${{ env.WORKING_DIR }} run: | git add . - $PREK run --all-files + $PREK run --all-files --skip no-commit-to-branch shell: bash env: PREK: ${{ runner.os == 'Windows' && '.venv/Scripts/prek.exe' || '.venv/bin/prek' }} diff --git a/.github/workflows/testing_fastapi.yml b/.github/workflows/testing_fastapi.yml index 46e70403..0c9d2886 100644 --- a/.github/workflows/testing_fastapi.yml +++ b/.github/workflows/testing_fastapi.yml @@ -54,7 +54,7 @@ jobs: working-directory: ${{ env.WORKING_DIR }} run: | git add . - uv run prek run --all-files + uv run prek run --all-files --skip no-commit-to-branch - name: make .env working-directory: ${{ env.WORKING_DIR }} run: touch .env @@ -92,7 +92,7 @@ jobs: working-directory: ${{ env.WORKING_DIR }} run: | git add . - uv run prek run --all-files + uv run prek run --all-files --skip no-commit-to-branch - name: Test with pytest working-directory: ${{ env.WORKING_DIR }} if: matrix.project_type == 'application' @@ -123,7 +123,7 @@ jobs: working-directory: ${{ env.WORKING_DIR }} run: | git add . - .venv/bin/prek run --all-files + .venv/bin/prek run --all-files --skip no-commit-to-branch - name: make .env working-directory: ${{ env.WORKING_DIR }} run: touch .env @@ -159,7 +159,7 @@ jobs: working-directory: ${{ env.WORKING_DIR }} run: | git add . - .venv/bin/prek run --all-files + .venv/bin/prek run --all-files --skip no-commit-to-branch - name: Test with pytest working-directory: ${{ env.WORKING_DIR }} if: matrix.project_type == 'application' @@ -192,7 +192,7 @@ jobs: working-directory: ${{ env.WORKING_DIR }} run: | git add . - uv run prek run --all-files + uv run prek run --all-files --skip no-commit-to-branch - name: make .env working-directory: ${{ env.WORKING_DIR }} run: touch .env @@ -234,7 +234,7 @@ jobs: working-directory: ${{ env.WORKING_DIR }} run: | git add . - uv run prek run --all-files + uv run prek run --all-files --skip no-commit-to-branch - name: Test with pytest working-directory: ${{ env.WORKING_DIR }} if: matrix.project_type == 'application' @@ -269,7 +269,7 @@ jobs: working-directory: ${{ env.WORKING_DIR }} run: | git add . - .venv/bin/prek run --all-files + .venv/bin/prek run --all-files --skip no-commit-to-branch - name: make .env working-directory: ${{ env.WORKING_DIR }} run: touch .env @@ -309,7 +309,7 @@ jobs: working-directory: ${{ env.WORKING_DIR }} run: | git add . - .venv/bin/prek run --all-files + .venv/bin/prek run --all-files --skip no-commit-to-branch - name: Test with pytest working-directory: ${{ env.WORKING_DIR }} if: matrix.project_type == 'application' diff --git a/src/github_actions.rs b/src/github_actions.rs index 79adf662..5159da52 100644 --- a/src/github_actions.rs +++ b/src/github_actions.rs @@ -15,6 +15,15 @@ fn build_actions_python_test_versions(github_action_python_test_versions: &[Stri .join(", ") } +fn create_prek_skip(type_checker: &TypeChecker) -> String { + let mut prek_skip = String::from("\n env:\n PREK_SKIP: no-commit-to-branch"); + if let TypeChecker::Pyrefly = type_checker { + prek_skip.push_str(",pyrefly-check"); + } + + prek_skip +} + fn create_setuptools_ci_testing_linux_only_file( source_dir: &str, min_python_version: &str, @@ -26,10 +35,7 @@ fn create_setuptools_ci_testing_linux_only_file( TypeChecker::Mypy => format!("mypy {source_dir} tests"), TypeChecker::Pyrefly => "pyrefly check".to_string(), }; - let prek_skip = match type_checker { - TypeChecker::Mypy => "", - TypeChecker::Pyrefly => "\n env:\n SKIP: pyrefly-check", - }; + let prek_skip = create_prek_skip(type_checker); let type_checker = type_checker.to_string(); format!( @@ -102,10 +108,7 @@ fn create_setuptools_ci_testing_fastapi_file( TypeChecker::Mypy => format!("mypy {source_dir} tests"), TypeChecker::Pyrefly => "pyrefly check".to_string(), }; - let prek_skip = match type_checker { - TypeChecker::Mypy => "", - TypeChecker::Pyrefly => "\n env:\n SKIP: pyrefly-check", - }; + let prek_skip = create_prek_skip(type_checker); let type_checker = type_checker.to_string(); format!( @@ -203,10 +206,7 @@ fn create_uv_ci_testing_linux_only_file( TypeChecker::Mypy => format!("uv run mypy {source_dir} tests"), TypeChecker::Pyrefly => "uv run pyrefly check".to_string(), }; - let prek_skip = match type_checker { - TypeChecker::Mypy => "", - TypeChecker::Pyrefly => "\n env:\n SKIP: pyrefly-check", - }; + let prek_skip = create_prek_skip(type_checker); let type_checker = type_checker.to_string(); format!( @@ -281,10 +281,7 @@ fn create_uv_ci_testing_fastapi_file( TypeChecker::Mypy => format!("uv run mypy {source_dir} tests"), TypeChecker::Pyrefly => "uv run pyrefly check".to_string(), }; - let prek_skip = match type_checker { - TypeChecker::Mypy => "", - TypeChecker::Pyrefly => "\n env:\n SKIP: pyrefly-check", - }; + let prek_skip = create_prek_skip(type_checker); let type_checker = type_checker.to_string(); format!( @@ -387,10 +384,7 @@ fn create_ci_testing_linux_only_file_pyo3( (Pyo3PythonManager::Setuptools, TypeChecker::Mypy) => format!("mypy {source_dir} tests"), (Pyo3PythonManager::Setuptools, TypeChecker::Pyrefly) => "pyrefly check".to_string(), }; - let prek_skip = match type_checker { - TypeChecker::Mypy => "", - TypeChecker::Pyrefly => "\n env:\n SKIP: pyrefly-check", - }; + let prek_skip = create_prek_skip(type_checker); let type_checker = type_checker.to_string(); match pyo3_python_manager { Pyo3PythonManager::Uv => format!( @@ -591,10 +585,7 @@ fn create_ci_testing_fastapi_file_pyo3( (Pyo3PythonManager::Setuptools, TypeChecker::Mypy) => format!("mypy {source_dir} tests"), (Pyo3PythonManager::Setuptools, TypeChecker::Pyrefly) => "pyrefly check".to_string(), }; - let prek_skip = match type_checker { - TypeChecker::Mypy => "", - TypeChecker::Pyrefly => "\n env:\n SKIP: pyrefly-check", - }; + let prek_skip = create_prek_skip(type_checker); let type_checker = type_checker.to_string(); match pyo3_python_manager { Pyo3PythonManager::Uv => format!( @@ -940,10 +931,7 @@ fn create_setuptools_ci_testing_multi_os_file( TypeChecker::Mypy => format!("mypy {source_dir} tests"), TypeChecker::Pyrefly => "pyrefly check".to_string(), }; - let prek_skip = match type_checker { - TypeChecker::Mypy => "", - TypeChecker::Pyrefly => "\n env:\n SKIP: pyrefly-check", - }; + let prek_skip = create_prek_skip(type_checker); let type_checker = type_checker.to_string(); format!( @@ -1019,10 +1007,7 @@ fn create_ci_testing_multi_os_file_pyo3( (Pyo3PythonManager::Setuptools, TypeChecker::Mypy) => format!("mypy {source_dir} tests"), (Pyo3PythonManager::Setuptools, TypeChecker::Pyrefly) => "pyrefly check".to_string(), }; - let prek_skip = match type_checker { - TypeChecker::Mypy => "", - TypeChecker::Pyrefly => "\n env:\n SKIP: pyrefly-check", - }; + let prek_skip = create_prek_skip(type_checker); let type_checker = type_checker.to_string(); match pyo3_python_manager { Pyo3PythonManager::Uv => format!( @@ -1221,10 +1206,7 @@ fn create_uv_ci_testing_multi_os_file( TypeChecker::Mypy => format!("uv run mypy {source_dir} tests"), TypeChecker::Pyrefly => "uv run pyrefly check".to_string(), }; - let prek_skip = match type_checker { - TypeChecker::Mypy => "", - TypeChecker::Pyrefly => "\n env:\n SKIP: pyrefly-check", - }; + let prek_skip = create_prek_skip(type_checker); let type_checker = type_checker.to_string(); format!( diff --git a/src/project_generator.rs b/src/project_generator.rs index 997506a0..8cdabd1d 100644 --- a/src/project_generator.rs +++ b/src/project_generator.rs @@ -255,6 +255,7 @@ hooks = [ {{ id = "check-toml" }}, {{ id = "check-yaml" }}, {{ id = "end-of-file-fixer" }}, + {{ id = "no-commit-to-branch" }}, {{ id = "trailing-whitespace" }}, ] "#, diff --git a/src/snapshots/python_project__github_actions__tests__save_ci_testing_fastapi_file_pyo3.snap b/src/snapshots/python_project__github_actions__tests__save_ci_testing_fastapi_file_pyo3.snap index 504aea3d..524e301a 100644 --- a/src/snapshots/python_project__github_actions__tests__save_ci_testing_fastapi_file_pyo3.snap +++ b/src/snapshots/python_project__github_actions__tests__save_ci_testing_fastapi_file_pyo3.snap @@ -2,4 +2,4 @@ source: src/github_actions.rs expression: content --- -"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.10\"\n SECRET_KEY: \"someKey\"\n PRODUCTION_MODE: false\n FIRST_SUPERUSER_EMAIL: \"some@email.com\"\n FIRST_SUPERUSER_PASSWORD: \"somePassword1!\"\n FIRST_SUPERUSER_NAME: \"Super User\"\n POSTGRES_HOST: \"127.0.0.1\"\n POSTGRES_USER: \"postgres\"\n POSTGRES_PASSWORD: \"test_password\"\n POSTGRES_DB: \"test_db\"\n VALKEY_HOST: \"127.0.0.1\"\n VALKEY_PASSWORD: \"test_password\"\n MEILISEARCH_HOST: http://127.0.0.1\n STACK_NAME: \"test-stack\"\n DOMAIN: \"127.0.0.1\"\n LOG_LEVEL: \"DEBUG\"\n CI: true\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: clippy\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: rustfmt\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Install sqlx-cli\n run: cargo install sqlx-cli --no-default-features -F native-tls -F postgres\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: make .env\n run: touch .env\n - name: Start docker containers\n run: docker compose up db valkey migrations -d\n - name: Test with pytest\n run: uv run pytest -n auto\n" +"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.10\"\n SECRET_KEY: \"someKey\"\n PRODUCTION_MODE: false\n FIRST_SUPERUSER_EMAIL: \"some@email.com\"\n FIRST_SUPERUSER_PASSWORD: \"somePassword1!\"\n FIRST_SUPERUSER_NAME: \"Super User\"\n POSTGRES_HOST: \"127.0.0.1\"\n POSTGRES_USER: \"postgres\"\n POSTGRES_PASSWORD: \"test_password\"\n POSTGRES_DB: \"test_db\"\n VALKEY_HOST: \"127.0.0.1\"\n VALKEY_PASSWORD: \"test_password\"\n MEILISEARCH_HOST: http://127.0.0.1\n STACK_NAME: \"test-stack\"\n DOMAIN: \"127.0.0.1\"\n LOG_LEVEL: \"DEBUG\"\n CI: true\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: clippy\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: rustfmt\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n PREK_SKIP: no-commit-to-branch\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Install sqlx-cli\n run: cargo install sqlx-cli --no-default-features -F native-tls -F postgres\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: make .env\n run: touch .env\n - name: Start docker containers\n run: docker compose up db valkey migrations -d\n - name: Test with pytest\n run: uv run pytest -n auto\n" diff --git a/src/snapshots/python_project__github_actions__tests__save_ci_testing_linux_only_file_pyo3.snap b/src/snapshots/python_project__github_actions__tests__save_ci_testing_linux_only_file_pyo3.snap index 76149a6c..f7d76e0f 100644 --- a/src/snapshots/python_project__github_actions__tests__save_ci_testing_linux_only_file_pyo3.snap +++ b/src/snapshots/python_project__github_actions__tests__save_ci_testing_linux_only_file_pyo3.snap @@ -2,4 +2,4 @@ source: src/github_actions.rs expression: content --- -"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.10\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: clippy\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: rustfmt\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Test with pytest\n run: uv run pytest\n" +"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.10\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: clippy\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: rustfmt\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n PREK_SKIP: no-commit-to-branch\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Test with pytest\n run: uv run pytest\n" diff --git a/src/snapshots/python_project__github_actions__tests__save_ci_testing_linux_only_file_pyo3_pyrefly.snap b/src/snapshots/python_project__github_actions__tests__save_ci_testing_linux_only_file_pyo3_pyrefly.snap index f56a80ef..9d06e76d 100644 --- a/src/snapshots/python_project__github_actions__tests__save_ci_testing_linux_only_file_pyo3_pyrefly.snap +++ b/src/snapshots/python_project__github_actions__tests__save_ci_testing_linux_only_file_pyo3_pyrefly.snap @@ -2,4 +2,4 @@ source: src/github_actions.rs expression: content --- -"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.10\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: clippy\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: rustfmt\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: pyrefly check\n run: uv run pyrefly check\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n SKIP: pyrefly-check\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Test with pytest\n run: uv run pytest\n" +"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.10\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: clippy\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: rustfmt\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: pyrefly check\n run: uv run pyrefly check\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n PREK_SKIP: no-commit-to-branch,pyrefly-check\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Test with pytest\n run: uv run pytest\n" diff --git a/src/snapshots/python_project__github_actions__tests__save_ci_testing_multi_os_file_pyo3.snap b/src/snapshots/python_project__github_actions__tests__save_ci_testing_multi_os_file_pyo3.snap index a7ddb63a..199f1a16 100644 --- a/src/snapshots/python_project__github_actions__tests__save_ci_testing_multi_os_file_pyo3.snap +++ b/src/snapshots/python_project__github_actions__tests__save_ci_testing_multi_os_file_pyo3.snap @@ -2,4 +2,4 @@ source: src/github_actions.rs expression: content --- -"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.10\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: clippy\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: rustfmt\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n os: [ubuntu-latest, windows-latest, macos-latest]\n runs-on: ${{ matrix.os }}\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Test with pytest\n run: uv run pytest\n" +"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.10\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: clippy\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: rustfmt\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n PREK_SKIP: no-commit-to-branch\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n os: [ubuntu-latest, windows-latest, macos-latest]\n runs-on: ${{ matrix.os }}\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Test with pytest\n run: uv run pytest\n" diff --git a/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_fastapi_file.snap b/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_fastapi_file.snap index 1ee6dfe4..a8a5bcf6 100644 --- a/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_fastapi_file.snap +++ b/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_fastapi_file.snap @@ -2,4 +2,4 @@ source: src/github_actions.rs expression: content --- -"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\n SECRET_KEY: \"someKey\"\n PRODUCTION_MODE: false\n FIRST_SUPERUSER_EMAIL: \"some@email.com\"\n FIRST_SUPERUSER_PASSWORD: \"somePassword1!\"\n FIRST_SUPERUSER_NAME: \"Super User\"\n POSTGRES_HOST: \"127.0.0.1\"\n POSTGRES_USER: \"postgres\"\n POSTGRES_PASSWORD: \"test_password\"\n POSTGRES_DB: \"test_db\"\n VALKEY_HOST: \"127.0.0.1\"\n VALKEY_PASSWORD: \"test_password\"\n MEILISEARCH_HOST: http://127.0.0.1\n STACK_NAME: \"test-stack\"\n DOMAIN: \"127.0.0.1\"\n LOG_LEVEL: \"DEBUG\"\n CI: true\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Ruff format check\n run: ruff format my_project tests --check\n - name: Lint with ruff\n run: ruff check .\n - name: mypy check\n run: mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Install sqlx-cli\n run: cargo install sqlx-cli --no-default-features -F native-tls -F postgres\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: make .env\n run: touch .env\n - name: Start docker containers\n run: docker compose up db valkey migrations -d\n - name: Test with pytest\n run: python -m pytest -n auto\n" +"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\n SECRET_KEY: \"someKey\"\n PRODUCTION_MODE: false\n FIRST_SUPERUSER_EMAIL: \"some@email.com\"\n FIRST_SUPERUSER_PASSWORD: \"somePassword1!\"\n FIRST_SUPERUSER_NAME: \"Super User\"\n POSTGRES_HOST: \"127.0.0.1\"\n POSTGRES_USER: \"postgres\"\n POSTGRES_PASSWORD: \"test_password\"\n POSTGRES_DB: \"test_db\"\n VALKEY_HOST: \"127.0.0.1\"\n VALKEY_PASSWORD: \"test_password\"\n MEILISEARCH_HOST: http://127.0.0.1\n STACK_NAME: \"test-stack\"\n DOMAIN: \"127.0.0.1\"\n LOG_LEVEL: \"DEBUG\"\n CI: true\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Ruff format check\n run: ruff format my_project tests --check\n - name: Lint with ruff\n run: ruff check .\n - name: mypy check\n run: mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n PREK_SKIP: no-commit-to-branch\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Install sqlx-cli\n run: cargo install sqlx-cli --no-default-features -F native-tls -F postgres\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: make .env\n run: touch .env\n - name: Start docker containers\n run: docker compose up db valkey migrations -d\n - name: Test with pytest\n run: python -m pytest -n auto\n" diff --git a/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_testing_linux_only_file.snap b/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_testing_linux_only_file.snap index cdb24aff..659af388 100644 --- a/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_testing_linux_only_file.snap +++ b/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_testing_linux_only_file.snap @@ -2,4 +2,4 @@ source: src/github_actions.rs expression: content --- -"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Ruff format check\n run: ruff format my_project tests --check\n - name: Lint with ruff\n run: ruff check .\n - name: mypy check\n run: mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Test with pytest\n run: pytest\n" +"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Ruff format check\n run: ruff format my_project tests --check\n - name: Lint with ruff\n run: ruff check .\n - name: mypy check\n run: mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n PREK_SKIP: no-commit-to-branch\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Test with pytest\n run: pytest\n" diff --git a/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_testing_linux_only_file_pyrefly.snap b/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_testing_linux_only_file_pyrefly.snap index 8230d17b..4ea46ccf 100644 --- a/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_testing_linux_only_file_pyrefly.snap +++ b/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_testing_linux_only_file_pyrefly.snap @@ -2,4 +2,4 @@ source: src/github_actions.rs expression: content --- -"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Ruff format check\n run: ruff format my_project tests --check\n - name: Lint with ruff\n run: ruff check .\n - name: pyrefly check\n run: pyrefly check\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n SKIP: pyrefly-check\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Test with pytest\n run: pytest\n" +"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Ruff format check\n run: ruff format my_project tests --check\n - name: Lint with ruff\n run: ruff check .\n - name: pyrefly check\n run: pyrefly check\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n PREK_SKIP: no-commit-to-branch,pyrefly-check\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Test with pytest\n run: pytest\n" diff --git a/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_testing_multi_os_file.snap b/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_testing_multi_os_file.snap index b6ef9c60..e63f52bf 100644 --- a/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_testing_multi_os_file.snap +++ b/src/snapshots/python_project__github_actions__tests__save_setuptools_ci_testing_multi_os_file.snap @@ -2,4 +2,4 @@ source: src/github_actions.rs expression: content --- -"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Ruff format check\n run: ruff format my_project tests --check\n - name: Lint with ruff\n run: ruff check .\n - name: mypy check\n run: mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n os: [ubuntu-latest, windows-latest, macos-latest]\n runs-on: ${{ matrix.os }}\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Test with pytest\n run: pytest\n" +"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Ruff format check\n run: ruff format my_project tests --check\n - name: Lint with ruff\n run: ruff check .\n - name: mypy check\n run: mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n PREK_SKIP: no-commit-to-branch\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n os: [ubuntu-latest, windows-latest, macos-latest]\n runs-on: ${{ matrix.os }}\n steps:\n - uses: actions/checkout@v7\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n - name: Test with pytest\n run: pytest\n" diff --git a/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_fastapi_file.snap b/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_fastapi_file.snap index a16279a7..4993cbaa 100644 --- a/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_fastapi_file.snap +++ b/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_fastapi_file.snap @@ -2,4 +2,4 @@ source: src/github_actions.rs expression: content --- -"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\n SECRET_KEY: \"someKey\"\n PRODUCTION_MODE: false\n FIRST_SUPERUSER_EMAIL: \"some@email.com\"\n FIRST_SUPERUSER_PASSWORD: \"somePassword1!\"\n FIRST_SUPERUSER_NAME: \"Super User\"\n POSTGRES_HOST: \"127.0.0.1\"\n POSTGRES_USER: \"postgres\"\n POSTGRES_PASSWORD: \"test_password\"\n POSTGRES_DB: \"test_db\"\n VALKEY_HOST: \"127.0.0.1\"\n VALKEY_PASSWORD: \"test_password\"\n MEILISEARCH_HOST: http://127.0.0.1\n STACK_NAME: \"test-stack\"\n DOMAIN: \"127.0.0.1\"\n LOG_LEVEL: \"DEBUG\"\n CI: true\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Install sqlx-cli\n run: cargo install sqlx-cli --no-default-features -F native-tls -F postgres\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: make .env\n run: touch .env\n - name: Start docker containers\n run: docker compose up db valkey migrations -d\n - name: Test with pytest\n run: uv run pytest -n auto\n" +"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\n SECRET_KEY: \"someKey\"\n PRODUCTION_MODE: false\n FIRST_SUPERUSER_EMAIL: \"some@email.com\"\n FIRST_SUPERUSER_PASSWORD: \"somePassword1!\"\n FIRST_SUPERUSER_NAME: \"Super User\"\n POSTGRES_HOST: \"127.0.0.1\"\n POSTGRES_USER: \"postgres\"\n POSTGRES_PASSWORD: \"test_password\"\n POSTGRES_DB: \"test_db\"\n VALKEY_HOST: \"127.0.0.1\"\n VALKEY_PASSWORD: \"test_password\"\n MEILISEARCH_HOST: http://127.0.0.1\n STACK_NAME: \"test-stack\"\n DOMAIN: \"127.0.0.1\"\n LOG_LEVEL: \"DEBUG\"\n CI: true\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n PREK_SKIP: no-commit-to-branch\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Install sqlx-cli\n run: cargo install sqlx-cli --no-default-features -F native-tls -F postgres\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: make .env\n run: touch .env\n - name: Start docker containers\n run: docker compose up db valkey migrations -d\n - name: Test with pytest\n run: uv run pytest -n auto\n" diff --git a/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_linux_only_file.snap b/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_linux_only_file.snap index 75d8cbc1..f472d95c 100644 --- a/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_linux_only_file.snap +++ b/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_linux_only_file.snap @@ -2,4 +2,4 @@ source: src/github_actions.rs expression: content --- -"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Test with pytest\n run: uv run pytest\n" +"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n PREK_SKIP: no-commit-to-branch\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Test with pytest\n run: uv run pytest\n" diff --git a/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_linux_only_file_pyrefly.snap b/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_linux_only_file_pyrefly.snap index fcbd173e..b0a57b0b 100644 --- a/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_linux_only_file_pyrefly.snap +++ b/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_linux_only_file_pyrefly.snap @@ -2,4 +2,4 @@ source: src/github_actions.rs expression: content --- -"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: pyrefly check\n run: uv run pyrefly check\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n SKIP: pyrefly-check\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Test with pytest\n run: uv run pytest\n" +"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n PYTHON_VERSION: \"3.10\"\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: pyrefly check\n run: uv run pyrefly check\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n PREK_SKIP: no-commit-to-branch,pyrefly-check\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Test with pytest\n run: uv run pytest\n" diff --git a/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_multi_os_file.snap b/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_multi_os_file.snap index 936f665a..01551d81 100644 --- a/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_multi_os_file.snap +++ b/src/snapshots/python_project__github_actions__tests__save_uv_ci_testing_multi_os_file.snap @@ -2,4 +2,4 @@ source: src/github_actions.rs expression: content --- -"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n UV_CACHE_DIR: /tmp/.uv-cache\n PYTHON_VERSION: \"3.10\"\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n os: [ubuntu-latest, windows-latest, macos-latest]\n runs-on: ${{ matrix.os }}\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Test with pytest\n run: uv run pytest\n" +"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n UV_CACHE_DIR: /tmp/.uv-cache\n PYTHON_VERSION: \"3.10\"\njobs:\n linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n prek:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: j178/prek-action@v2\n env:\n PREK_SKIP: no-commit-to-branch\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n os: [ubuntu-latest, windows-latest, macos-latest]\n runs-on: ${{ matrix.os }}\n steps:\n - uses: actions/checkout@v7\n - name: Install uv\n uses: astral-sh/setup-uv@v8\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: uv sync --frozen\n - name: Test with pytest\n run: uv run pytest\n" diff --git a/src/snapshots/python_project__project_generator__tests__save_prek_toml_file.snap b/src/snapshots/python_project__project_generator__tests__save_prek_toml_file.snap index 53ce6297..b4d10944 100644 --- a/src/snapshots/python_project__project_generator__tests__save_prek_toml_file.snap +++ b/src/snapshots/python_project__project_generator__tests__save_prek_toml_file.snap @@ -2,4 +2,4 @@ source: src/project_generator.rs expression: content --- -"[update]\nexclude_tags = [\"*-{alpha,beta,dev,rc}*\", \"*.{alpha,beta,dev,rc}*\"]\n\n[[repos]]\nrepo = \"builtin\"\nhooks = [\n { id = \"check-added-large-files\" },\n { id = \"check-toml\" },\n { id = \"check-yaml\" },\n { id = \"end-of-file-fixer\" },\n { id = \"trailing-whitespace\" },\n]\n\n[[repos]]\nrepo = \"https://github.com/pre-commit/pre-commit-hooks\"\nrev = \"v6.0.0\"\nhooks = [\n { id = \"debug-statements\" },\n]\n\n[[repos]]\nrepo = \"https://github.com/pre-commit/mirrors-mypy\"\nrev = \"v1.18.2\"\nhooks = [\n { id = \"mypy\" },\n]\n\n[[repos]]\nrepo = \"https://github.com/astral-sh/ruff-pre-commit\"\nrev = \"v0.14.4\"\nhooks = [\n { id = \"ruff-check\", args = [\"--fix\", \"--exit-non-zero-on-fix\"] },\n { id = \"ruff-format\" },\n]\n" +"[update]\nexclude_tags = [\"*-{alpha,beta,dev,rc}*\", \"*.{alpha,beta,dev,rc}*\"]\n\n[[repos]]\nrepo = \"builtin\"\nhooks = [\n { id = \"check-added-large-files\" },\n { id = \"check-toml\" },\n { id = \"check-yaml\" },\n { id = \"end-of-file-fixer\" },\n { id = \"no-commit-to-branch\" },\n { id = \"trailing-whitespace\" },\n]\n\n[[repos]]\nrepo = \"https://github.com/pre-commit/pre-commit-hooks\"\nrev = \"v6.0.0\"\nhooks = [\n { id = \"debug-statements\" },\n]\n\n[[repos]]\nrepo = \"https://github.com/pre-commit/mirrors-mypy\"\nrev = \"v1.18.2\"\nhooks = [\n { id = \"mypy\" },\n]\n\n[[repos]]\nrepo = \"https://github.com/astral-sh/ruff-pre-commit\"\nrev = \"v0.14.4\"\nhooks = [\n { id = \"ruff-check\", args = [\"--fix\", \"--exit-non-zero-on-fix\"] },\n { id = \"ruff-format\" },\n]\n" diff --git a/src/snapshots/python_project__project_generator__tests__save_prek_toml_file_pyrefly.snap b/src/snapshots/python_project__project_generator__tests__save_prek_toml_file_pyrefly.snap index 33fee673..614a52f0 100644 --- a/src/snapshots/python_project__project_generator__tests__save_prek_toml_file_pyrefly.snap +++ b/src/snapshots/python_project__project_generator__tests__save_prek_toml_file_pyrefly.snap @@ -2,4 +2,4 @@ source: src/project_generator.rs expression: content --- -"[update]\nexclude_tags = [\"*-{alpha,beta,dev,rc}*\", \"*.{alpha,beta,dev,rc}*\"]\n\n[[repos]]\nrepo = \"builtin\"\nhooks = [\n { id = \"check-added-large-files\" },\n { id = \"check-toml\" },\n { id = \"check-yaml\" },\n { id = \"end-of-file-fixer\" },\n { id = \"trailing-whitespace\" },\n]\n\n[[repos]]\nrepo = \"https://github.com/pre-commit/pre-commit-hooks\"\nrev = \"v6.0.0\"\nhooks = [\n { id = \"debug-statements\" },\n]\n\n[[repos]]\nrepo = \"https://github.com/facebook/pyrefly-pre-commit\"\nrev = \"1.1.1\"\nhooks = [\n {\n id = \"pyrefly-check\",\n name = \"pyrefly\",\n pass_filenames = false,\n language = \"system\",\n entry = \"uv run pyrefly check\"\n }\n]\n\n[[repos]]\nrepo = \"https://github.com/astral-sh/ruff-pre-commit\"\nrev = \"v0.14.4\"\nhooks = [\n { id = \"ruff-check\", args = [\"--fix\", \"--exit-non-zero-on-fix\"] },\n { id = \"ruff-format\" },\n]\n" +"[update]\nexclude_tags = [\"*-{alpha,beta,dev,rc}*\", \"*.{alpha,beta,dev,rc}*\"]\n\n[[repos]]\nrepo = \"builtin\"\nhooks = [\n { id = \"check-added-large-files\" },\n { id = \"check-toml\" },\n { id = \"check-yaml\" },\n { id = \"end-of-file-fixer\" },\n { id = \"no-commit-to-branch\" },\n { id = \"trailing-whitespace\" },\n]\n\n[[repos]]\nrepo = \"https://github.com/pre-commit/pre-commit-hooks\"\nrev = \"v6.0.0\"\nhooks = [\n { id = \"debug-statements\" },\n]\n\n[[repos]]\nrepo = \"https://github.com/facebook/pyrefly-pre-commit\"\nrev = \"1.1.1\"\nhooks = [\n {\n id = \"pyrefly-check\",\n name = \"pyrefly\",\n pass_filenames = false,\n language = \"system\",\n entry = \"uv run pyrefly check\"\n }\n]\n\n[[repos]]\nrepo = \"https://github.com/astral-sh/ruff-pre-commit\"\nrev = \"v0.14.4\"\nhooks = [\n { id = \"ruff-check\", args = [\"--fix\", \"--exit-non-zero-on-fix\"] },\n { id = \"ruff-format\" },\n]\n"