Skip to content

add the .git ignore #155

add the .git ignore

add the .git ignore #155

name: Test python-setup/pip
on:
push:
jobs:
test-pip-basic:
name: Test pip action - defaults
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Test pip action with defaults (cache='')
uses: ./actions/python-setup/pip
- name: Verify Python installation
run: |
python --version
pip --version
pip list
test-pip-with-groups:
name: Test pip action - With optional dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-with-groups/pyproject.toml .
- name: Test pip action with optional dependencies (extras)
uses: ./actions/python-setup/pip
with:
install-groups: 'extras: dev test'
- name: Verify installations
shell: bash
run: |
python --version
pip list
# Verify dev dependencies are installed
python -c "import pytest; import black; print('[OK] Dev dependencies installed')"
python -c "import pytest_cov; print('[OK] Test dependencies installed')"
test-pip-matrix:
name: Test pip action - Matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.11', '3.12', '3.13', '3.14']
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
shell: bash
run: cp tests/data/pip/test-pip-matrix/pyproject.toml .
- name: Test pip action with Python ${{ matrix.python-version }}
uses: ./actions/python-setup/pip
with:
python-version: ${{ matrix.python-version }}
- name: Verify Python version
run: |
python --version
python -c "import sys; assert sys.version_info[:2] == tuple(map(int, '${{ matrix.python-version }}'.split('.')[:2]))"
pip list
- name: Test pip functionality
shell: bash
run: |
pip install requests
python -c "import requests; print(f'[OK] requests {requests.__version__} installed successfully')"
test-pip-cache:
name: Test pip action - Cache validation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-cache/pyproject.toml .
- name: First run - populate cache
uses: ./actions/python-setup/pip
with:
cache: 'pip'
- name: Verify cache is working
run: |
pip list
echo "Cache should be populated for subsequent runs"
test-pip-architecture:
name: Test pip action - Architecture
runs-on: windows-latest
strategy:
matrix:
architecture: [x64, x86]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
shell: bash
run: cp tests/data/pip/test-pip-architecture/pyproject.toml .
- name: Test pip action with ${{ matrix.architecture }}
uses: ./actions/python-setup/pip
with:
architecture: ${{ matrix.architecture }}
- name: Verify architecture
run: |
python --version
python -c "import platform; print(f'Architecture: {platform.architecture()}')"
test-pip-cache-validation-error:
name: Test pip action - Cache validation error
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Test pip action with cache but no dependency file (should fail)
id: test-cache-error
continue-on-error: true
uses: ./actions/python-setup/pip
with:
cache: 'pip'
- name: Verify action failed as expected
shell: bash
run: |
if [ "${{ steps.test-cache-error.outcome }}" != "failure" ]; then
echo "::error::Expected action to fail when cache is enabled without pyproject.toml/requirements.txt"
exit 1
fi
echo "[OK] Action correctly failed when cache enabled without dependency files"
test-pip-cache-with-requirements:
name: Test pip action - Cache with requirements.txt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-cache-with-requirements/requirements.txt .
- name: Test pip action with cache and requirements.txt
uses: ./actions/python-setup/pip
with:
cache: 'pip'
- name: Verify cache validation passed
shell: bash
run: |
python --version
pip list
echo "[OK] Cache validation passed with requirements.txt"
test-pip-no-dependency-file:
name: Test pip action - No dependency files (no cache)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Test pip action without pyproject.toml or requirements.txt
uses: ./actions/python-setup/pip
- name: Verify Python still works
shell: bash
run: |
python --version
pip --version
pip install requests
python -c "import requests; print('[OK] Can still install packages without dependency files')"
test-pip-empty-sections:
name: Test pip action - Empty groups/extras sections
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-empty-sections/pyproject.toml .
- name: Test pip action with empty groups section
uses: ./actions/python-setup/pip
with:
install-groups: 'groups: , extras: aws'
- name: Verify empty groups handling
shell: bash
run: |
pip list
python -c "import requests; print('[OK] Core dependencies installed')"
python -c "import boto3; print('[OK] AWS extra installed')"
test-pip-invalid-format:
name: Test pip action - Invalid format handling
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-invalid-format/pyproject.toml .
- name: Test pip action with invalid format (should show warning)
uses: ./actions/python-setup/pip
with:
install-groups: 'invalid format without colons'
- name: Verify warning shown and core dependencies installed
shell: bash
run: |
pip list
python -c "import requests; print('[OK] Core dependencies installed despite invalid format')"
test-pip-optional-dependencies:
name: Test pip action - Optional dependencies (extras)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-optional-dependencies/pyproject.toml .
- name: Test pip action with optional dependencies only
uses: ./actions/python-setup/pip
with:
install-groups: 'extras: aws viz'
- name: Verify optional dependencies installed
shell: bash
run: |
pip list
# Verify core dependencies are installed
python -c "import requests; print('[OK] Core dependencies installed')"
# Verify optional dependencies are installed
python -c "import boto3; print('[OK] AWS extra installed')"
python -c "import matplotlib; print('[OK] Viz extra installed')"
# Verify dependency groups are NOT installed (no -group support in older pip)
if python -c "import httpx" 2>/dev/null; then
echo "[OK] httpx found - dependency groups may be supported"
else
echo "::error::Dev group not installed - pip version does not support --group"
fi
test-pip-mixed-groups-and-extras:
name: Test pip action - Mixed groups and extras
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-mixed-groups-and-extras/pyproject.toml .
- name: Test pip action with mixed groups and extras
uses: ./actions/python-setup/pip
with:
install-groups: 'groups: dev, extras: aws'
- name: Verify mixed installation
shell: bash
run: |
pip list
# Verify all requested dependencies are installed
python -c "import requests; print('[OK] Core dependencies installed')"
python -c "import boto3; print('[OK] AWS extra installed')"
# Dev group installation depends on pip version support for --group
if python -c "import httpx" 2>/dev/null; then
echo "[OK] Dev group installed (pip supports --group)"
else
echo "::error::Dev group not installed - pip version does not support --group"
exit 1
fi
test-pip-dependency-groups-only:
name: Test pip action - Dependency groups only
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-dependency-groups-only/pyproject.toml .
- name: Test pip action with dependency groups only
uses: ./actions/python-setup/pip
with:
install-groups: 'groups: dev test'
- name: Verify dependency groups installation
shell: bash
run: |
pip list
# Verify core dependencies are installed
python -c "import requests; print('[OK] Core dependencies installed')"
# Dependency group installation depends on pip version
if python -c "import httpx; import pytest" 2>/dev/null; then
echo "[OK] Dependency groups installed (pip supports PEP 735)"
else
echo "[OK] Dependency groups not installed (pip version does not support PEP 735 --dependency-groups)"
echo "[INFO] This is expected for older pip versions. Consider using uv action for dependency groups support."
fi
test-pip-groups-docs-only:
name: Test pip action - Single dependency group (docs)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-groups-only-docs/pyproject.toml .
- name: Test pip action with docs dependency group
uses: ./actions/python-setup/pip
with:
install-groups: 'groups: docs'
- name: Verify installation and expected warning
shell: bash
run: |
pip list
python -c "import requests; print('[OK] Core dependencies installed')"
# This test verifies the warning behavior when pip doesn't support --dependency-groups
if python -c "import mkdocs" 2>/dev/null; then
echo "[OK] Docs group installed (pip supports PEP 735)"
else
echo "[OK] Docs group not installed - this is expected with current pip version"
echo "[INFO] The warning message 'pip version does not support --dependency-groups' is expected"
fi
test-pip-all-combinations:
name: Test pip action - All combinations (groups + extras)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-all-combinations/pyproject.toml .
- name: Test pip action with multiple groups and extras
uses: ./actions/python-setup/pip
with:
install-groups: 'groups: dev test docs, extras: aws azure gcp'
- name: Verify comprehensive installation
shell: bash
run: |
pip list
# Verify core dependencies
python -c "import requests; import click; print('[OK] Core dependencies installed')"
# Verify optional dependencies (extras)
python -c "import boto3; print('[OK] AWS extra installed')"
python -c "from azure.storage.blob import BlobServiceClient; print('[OK] Azure extra installed')"
python -c "from google.cloud import storage; print('[OK] GCP extra installed')"
# Verify dependency groups (if supported)
if python -c "import httpx; import pytest; import mkdocs" 2>/dev/null; then
echo "[OK] All dependency groups installed (pip supports PEP 735)"
else
echo "[OK] Dependency groups not installed (pip doesn't support PEP 735)"
fi
test-pip-single-extra:
name: Test pip action - Single extra only
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-single-extra/pyproject.toml .
- name: Test pip action with single extra
uses: ./actions/python-setup/pip
with:
install-groups: 'extras: dev'
- name: Verify single extra installation
shell: bash
run: |
pip list
python -c "import requests; print('[OK] Core dependencies installed')"
python -c "import pytest; import black; import ruff; print('[OK] Dev extra installed')"
test-pip-single-group:
name: Test pip action - Single group only
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-single-group/pyproject.toml .
- name: Test pip action with single group
uses: ./actions/python-setup/pip
with:
install-groups: 'groups: dev'
- name: Verify single group installation
shell: bash
run: |
pip list
python -c "import requests; print('[OK] Core dependencies installed')"
if python -c "import pytest; import black; import ruff" 2>/dev/null; then
echo "[OK] Dev group installed (pip supports PEP 735)"
else
echo "[OK] Dev group not installed (pip doesn't support PEP 735)"
fi
test-pip-only-core-dependencies:
name: Test pip action - Only core dependencies (no groups/extras)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-only-dependencies/pyproject.toml .
- name: Test pip action without install-groups parameter
uses: ./actions/python-setup/pip
- name: Verify only core dependencies installed
shell: bash
run: |
pip list
python -c "import requests; import click; import httpx; print('[OK] Core dependencies installed')"
echo "[OK] Only core dependencies installed as expected"
test-pip-whitespace-handling:
name: Test pip action - Whitespace handling in groups/extras
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-whitespace-handling/pyproject.toml .
- name: Test pip action with extra whitespace
uses: ./actions/python-setup/pip
with:
install-groups: ' groups: lint format , extras: dev test '
- name: Verify whitespace handling
shell: bash
run: |
pip list
python -c "import requests; print('[OK] Core dependencies installed')"
python -c "import pytest; print('[OK] Dev extra installed')"
python -c "import pytest_cov; print('[OK] Test extra installed')"
if python -c "import ruff; import black" 2>/dev/null; then
echo "[OK] Groups installed with whitespace handling (pip supports PEP 735)"
else
echo "[OK] Groups not installed (pip doesn't support PEP 735)"
fi
test-pip-empty-groups-value:
name: Test pip action - Empty groups value
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-empty-groups-only/pyproject.toml .
- name: Test pip action with empty groups value
uses: ./actions/python-setup/pip
with:
install-groups: 'groups: '
- name: Verify empty groups handling
shell: bash
run: |
pip list
python -c "import requests; print('[OK] Core dependencies installed')"
echo "[OK] Empty groups value handled correctly"
test-pip-empty-extras-value:
name: Test pip action - Empty extras value
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-empty-extras-only/pyproject.toml .
- name: Test pip action with empty extras value
uses: ./actions/python-setup/pip
with:
install-groups: 'extras: '
- name: Verify empty extras handling
shell: bash
run: |
pip list
python -c "import requests; print('[OK] Core dependencies installed')"
echo "[OK] Empty extras value handled correctly"
test-pip-python-version-matrix:
name: Test pip action - Python version matrix with extras
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11', '3.12', '3.13']
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-multiple-python-versions/pyproject.toml .
- name: Test pip action with Python ${{ matrix.python-version }}
uses: ./actions/python-setup/pip
with:
python-version: ${{ matrix.python-version }}
install-groups: 'extras: dev'
- name: Verify Python version and extras
shell: bash
run: |
python --version
pip list
python -c "import requests; print('[OK] Core dependencies installed')"
python -c "import pytest; print('[OK] Dev extra installed')"
test-pip-reverse-order:
name: Test pip action - Reverse order (extras before groups)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-all-combinations/pyproject.toml .
- name: Test pip action with extras before groups
uses: ./actions/python-setup/pip
with:
install-groups: 'extras: aws, groups: dev'
- name: Verify reverse order handling
shell: bash
run: |
pip list
python -c "import requests; print('[OK] Core dependencies installed')"
python -c "import boto3; print('[OK] AWS extra installed')"
if python -c "import httpx" 2>/dev/null; then
echo "[OK] Dev group installed (pip supports PEP 735)"
else
echo "::error::Dev group not installed - pip doesn't support PEP 735"
exit 1
fi
test-pip-cache-with-groups:
name: Test pip action - Cache with groups and extras
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy test fixture files
run: cp tests/data/pip/test-pip-all-combinations/pyproject.toml .
- name: Test pip action with cache and install-groups
uses: ./actions/python-setup/pip
with:
cache: 'pip'
install-groups: 'groups: dev, extras: aws'
- name: Verify cache and installation
shell: bash
run: |
pip list
python -c "import requests; print('[OK] Core dependencies installed')"
python -c "import boto3; print('[OK] AWS extra installed with cache')"
echo "[OK] Cache validation passed with groups and extras"