Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI/CD] linting: share job steps up-to-and-including pip and lint dependency installation. #12175

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ jobs:
- name: Install pip
run: python -m pip install --upgrade pip

- name: Install Ruff
run: |
ruff_version=$(awk -F'[="]' '/\[project\.optional-dependencies\]/ {p=1} /ruff/ {if (p) print $4}' pyproject.toml)
python -m pip install "ruff==${ruff_version}"
- name: Install linting dependencies
run: python -m pip install ".[lint]"

- name: Lint with Ruff
run: ruff check . --output-format github
Expand All @@ -48,10 +46,10 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade "flake8>=3.5.0"
- name: Install pip
run: python -m pip install --upgrade pip
- name: Install linting dependencies
run: python -m pip install ".[lint]"
- name: Lint with flake8
run: flake8 .

Expand All @@ -64,10 +62,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[lint,test]"
- name: Install pip
run: python -m pip install --upgrade pip
- name: Install linting dependencies
run: python -m pip install ".[lint]"
- name: Install test dependencies to support type-checks
run: python -m pip install ".[test]"
- name: Type check with mypy
run: mypy

Expand Down