Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 4 additions & 75 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,77 +154,6 @@ jobs:
working-directory: ${{ env.WORKING_DIR }}
if: matrix.project_type == 'application'
run: uv run pytest
poetry-linting:
strategy:
fail-fast: false
matrix:
project_type: ["application", "lib"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2.9.1
- name: Install Poetry
run: pipx install poetry
- name: Configure poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "${{ env.MIN_PYTHON_VERSION }}"
- name: Build package
run: cargo build --release
- name: Run creation
run: ./scripts/ci_run.sh ${{ matrix.project_type }} 2
- name: MyPy
working-directory: ${{ env.WORKING_DIR }}
run: poetry run mypy .
- name: ruff check
working-directory: ${{ env.WORKING_DIR }}
run: poetry run ruff check .
- name: ruff format
working-directory: ${{ env.WORKING_DIR }}
run: poetry run ruff format --check .
poetry-test:
strategy:
fail-fast: false
matrix:
project_type: ["application", "lib"]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2.9.1
- name: Install Poetry
run: pipx install poetry
- name: Configure poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Build package
run: cargo build --release
- name: Run creation
run: ./scripts/ci_run.sh ${{ matrix.project_type }} 2
shell: bash
- name: prek check
working-directory: ${{ env.WORKING_DIR }}
run: |
git add .
poetry run prek run --all-files
- name: Test with pytest
working-directory: ${{ env.WORKING_DIR }}
run: poetry run pytest
pyo3-linting:
strategy:
fail-fast: false
Expand Down Expand Up @@ -254,7 +183,7 @@ jobs:
- name: Build package
run: cargo build --release
- name: Run creation
run: ./scripts/ci_run.sh ${{ matrix.project_type }} 3
run: ./scripts/ci_run.sh ${{ matrix.project_type }} 2
- name: MyPy
working-directory: ${{ env.WORKING_DIR }}
run: just mypy
Expand Down Expand Up @@ -296,7 +225,7 @@ jobs:
- name: Build package
run: cargo build --release
- name: Run creation
run: ./scripts/ci_run.sh ${{ matrix.project_type }} 3
run: ./scripts/ci_run.sh ${{ matrix.project_type }} 2
shell: bash
- name: Compile Rust
working-directory: ${{ env.WORKING_DIR }}
Expand Down Expand Up @@ -330,7 +259,7 @@ jobs:
run: cargo build --release
- name: Run creation
run: |
./scripts/ci_run.sh ${{ matrix.project_type }} 4
./scripts/ci_run.sh ${{ matrix.project_type }} 3
- name: MyPy
working-directory: ${{ env.WORKING_DIR }}
run: $PYTHON -m mypy .
Expand Down Expand Up @@ -369,7 +298,7 @@ jobs:
- name: Build package
run: cargo build --release
- name: Run creation
run: ./scripts/ci_run.sh ${{ matrix.project_type }} 4
run: ./scripts/ci_run.sh ${{ matrix.project_type }} 3
shell: bash
- name: prek check
working-directory: ${{ env.WORKING_DIR }}
Expand Down
91 changes: 6 additions & 85 deletions .github/workflows/testing_fastapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,85 +97,6 @@ jobs:
working-directory: ${{ env.WORKING_DIR }}
if: matrix.project_type == 'application'
run: uv run pytest
test-poetry-fastapi-project:
name: test-fastapi-poetry-setup-fastapi
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache dependencies
uses: Swatinem/rust-cache@v2.9.1
- name: Install sqlx-cli
run: cargo install sqlx-cli --no-default-features -F native-tls -F postgres
- name: Install Poetry
run: pipx install poetry
- name: Configure poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.MIN_PYTHON_VERSION }}
- name: Build package
run: cargo build --release -F fastapi
- name: Run creation
run: ./scripts/ci_run_fastapi.sh "fastapi" 2
shell: bash
- name: prek check
working-directory: ${{ env.WORKING_DIR }}
run: |
git add .
poetry run prek run --all-files
- name: make .env
working-directory: ${{ env.WORKING_DIR }}
run: touch .env
- name: Build and start Docker containers
working-directory: ${{ env.WORKING_DIR }}
run: docker compose up -d
- name: Test with pytest
working-directory: ${{ env.WORKING_DIR }}
run: poetry run pytest -n auto
test-poetry-non-fastapi-project:
name: test-fastapi-poetry-setup-non-fastapi
strategy:
fail-fast: false
matrix:
project_type: ["application", "lib"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache dependencies
uses: Swatinem/rust-cache@v2.9.1
- name: Install Poetry
run: pipx install poetry
- name: Configure poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.MIN_PYTHON_VERSION }}
- name: Build package
run: cargo build --release -F fastapi
- name: Run creation
run: ./scripts/ci_run_fastapi.sh ${{ matrix.project_type }} 2
shell: bash
- name: prek check
working-directory: ${{ env.WORKING_DIR }}
run: |
git add .
poetry run prek run --all-files
- name: Test with pytest
working-directory: ${{ env.WORKING_DIR }}
if: matrix.project_type == 'application'
run: poetry run pytest
test-setuptools-fastapi-project:
name: test-fastapi-setuptools-setup-fastapi
strategy:
Expand All @@ -196,7 +117,7 @@ jobs:
- name: Build package
run: cargo build --release -F fastapi
- name: Run creation
run: ./scripts/ci_run_fastapi.sh "fastapi" 4
run: ./scripts/ci_run_fastapi.sh "fastapi" 3
shell: bash
- name: prek check
working-directory: ${{ env.WORKING_DIR }}
Expand Down Expand Up @@ -232,7 +153,7 @@ jobs:
- name: Build package
run: cargo build --release -F fastapi
- name: Run creation
run: ./scripts/ci_run_fastapi.sh ${{ matrix.project_type }} 4
run: ./scripts/ci_run_fastapi.sh ${{ matrix.project_type }} 3
shell: bash
- name: prek check
working-directory: ${{ env.WORKING_DIR }}
Expand Down Expand Up @@ -265,7 +186,7 @@ jobs:
- name: Build package
run: cargo build --release -F fastapi
- name: Run creation
run: ./scripts/ci_run_fastapi.sh "fastapi" 3
run: ./scripts/ci_run_fastapi.sh "fastapi" 2
shell: bash
- name: prek check
working-directory: ${{ env.WORKING_DIR }}
Expand Down Expand Up @@ -303,7 +224,7 @@ jobs:
- name: Build package
run: cargo build --release -F fastapi
- name: Run creation
run: ./scripts/ci_run_fastapi.sh ${{ matrix.project_type }} 3
run: ./scripts/ci_run_fastapi.sh ${{ matrix.project_type }} 2
shell: bash
- name: Compile Rust
working-directory: ${{ env.WORKING_DIR }}
Expand Down Expand Up @@ -338,7 +259,7 @@ jobs:
- name: Build package
run: cargo build --release -F fastapi
- name: Run creation
run: ./scripts/ci_run_fastapi.sh "fastapi" 3 2
run: ./scripts/ci_run_fastapi.sh "fastapi" 2 2
shell: bash
- name: Compile Rust
working-directory: ${{ env.WORKING_DIR }}
Expand Down Expand Up @@ -378,7 +299,7 @@ jobs:
- name: Build package
run: cargo build --release -F fastapi
- name: Run creation
run: ./scripts/ci_run_fastapi.sh ${{ matrix.project_type }} 3 2
run: ./scripts/ci_run_fastapi.sh ${{ matrix.project_type }} 2 2
shell: bash
- name: Compile Rust
working-directory: ${{ env.WORKING_DIR }}
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ created. Additionally FastAPI projects can be generated.

For package management choose between:

- [poetry](https://python-poetry.org/)
- [setuptools](https://github.com/pypa/setuptools)
- [uv](https://docs.astral.sh/uv/)

Expand Down
4 changes: 2 additions & 2 deletions scripts/ci_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ project_manager="1"

# Check for user provided project manager input
if [ $# -gt 1 ]; then
if [ $2 -lt 1 ] || [ $2 -gt 5 ]; then
if [ $2 -lt 1 ] || [ $2 -gt 3 ]; then
echo "Invalid project_manager value"
exit 1
else
Expand All @@ -44,7 +44,7 @@ use_release_drafter=""
use_multi_os_ci=""
pyo3_python_manager=""

if [[ project_manager -eq 3 ]]; then
if [[ project_manager -eq 2 ]]; then
./target/release/python-project create << EOF
$project_name
$project_slug
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci_run_fastapi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ project_manager="1"

# Check for user provided project manager input
if [ $# -gt 1 ]; then
if [ $2 -lt 1 ] || [ $2 -gt 5 ]; then
if [ $2 -lt 1 ] || [ $2 -gt 3 ]; then
echo "Invalid project_manager value"
exit 1
else
Expand Down Expand Up @@ -60,7 +60,7 @@ if [ $# -gt 2 ]; then
fi
fi

if [[ $project_manager -eq 3 ]]; then
if [[ $project_manager -eq 2 ]]; then
if [ "$fastapi_project" = "1" ]; then
./target/release/python-project create << EOF
$project_name
Expand Down
Loading