Migrate env-compat checker to packages.txt/constraints.txt with uv parity and robust package self-exclusion #51
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.11', '3.12', '3.13'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run tests | |
| run: | | |
| pytest tests/ -v --cov=src/pyhc_actions --cov-report=xml | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| if: matrix.python-version == '3.11' | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| - name: Test PHEP 3 checker CLI | |
| run: | | |
| # Generate schedule first | |
| phep3-check --generate-schedule --schedule-output test-schedule.json | |
| # Create a test pyproject.toml | |
| cat > test-pyproject.toml << 'EOF' | |
| [project] | |
| name = "test-package" | |
| version = "1.0.0" | |
| requires-python = ">=3.11" | |
| dependencies = [ | |
| "numpy>=1.26", | |
| ] | |
| EOF | |
| # Run check (should pass) | |
| phep3-check --schedule test-schedule.json test-pyproject.toml || true | |
| - name: Test PyHC env compat checker CLI | |
| run: | | |
| # Create a simple test pyproject.toml | |
| cat > test-pyproject.toml << 'EOF' | |
| [project] | |
| name = "test-package" | |
| version = "1.0.0" | |
| requires-python = ">=3.11" | |
| dependencies = [ | |
| "numpy>=1.26", | |
| ] | |
| EOF | |
| # Run check (may fail if conflicts, but should not crash) | |
| pyhc-env-compat-check test-pyproject.toml || true |