chore: add support for ty and pyrefly #2390
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: Check Commit | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| merge_group: | |
| jobs: | |
| format: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| lib: | |
| - scaleway-core | |
| - scaleway | |
| - scaleway-async | |
| python-version: ['3.10' ,'3.11', '3.12', '3.13'] | |
| defaults: | |
| run: | |
| working-directory: ${{ matrix.lib }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install poetry | |
| run: pipx install poetry | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "poetry" | |
| - name: Install dependencies and library | |
| run: poetry install | |
| - name: Check format | |
| run: poetry run ruff format --check | |
| typing: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| lib: | |
| - scaleway-core | |
| - scaleway | |
| - scaleway-async | |
| defaults: | |
| run: | |
| working-directory: ${{ matrix.lib }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install poetry | |
| run: pipx install poetry | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "poetry" | |
| - name: Install dependencies and library | |
| run: poetry install | |
| - name: Check typing with mypy | |
| run: poetry run mypy --install-types --non-interactive --strict --no-warn-unused-ignores $(echo "${{ matrix.lib }}" | tr "-" "_") | |
| - name: Check typing with ty | |
| run: poetry run ty check | |
| - name: Check typing with pyrefly | |
| run: poetry run pyrefly check | |
| linting: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| lib: | |
| - scaleway-core | |
| - scaleway | |
| - scaleway-async | |
| defaults: | |
| run: | |
| working-directory: ${{ matrix.lib }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install poetry | |
| run: pipx install poetry | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "poetry" | |
| - name: Install dependencies and library | |
| run: poetry install | |
| # We ignore the following rules for now: | |
| # E721 (https://docs.astral.sh/ruff/rules/type-comparison) | |
| # F541 (https://docs.astral.sh/ruff/rules/f-string-missing-placeholders) | |
| - name: Check linting | |
| run: poetry run ruff check . --ignore E721 --ignore F541 | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| lib: | |
| - scaleway-core | |
| - scaleway | |
| - scaleway-async | |
| defaults: | |
| run: | |
| working-directory: ${{ matrix.lib }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install poetry | |
| run: pipx install poetry | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "poetry" | |
| - name: Install dependencies and library | |
| run: poetry install | |
| - name: Run tests | |
| env: | |
| SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }} | |
| SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
| SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }} | |
| SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }} | |
| SCW_DEFAULT_REGION: ${{ secrets.SCW_DEFAULT_REGION }} | |
| run: poetry run python -m unittest discover -s tests -v | |