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

chore: Improve code style checks #253

Merged
merged 1 commit into from
Jan 2, 2025
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
75 changes: 67 additions & 8 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
cache: pip
cache-dependency-path: |
**/pyproject.toml
Expand All @@ -26,10 +26,10 @@ jobs:
run: |
bash scripts/build-info.sh

- name: Install Flake8 (5.0.4)
- name: Install Flake8 (7.1.1)
run: |
python -m pip install --upgrade pip
pip install flake8==5.0.4
pip install flake8==7.1.1

- name: Install dependencies
run: |
Expand All @@ -51,6 +51,7 @@ jobs:
echo "- $package"
echo "-------------------------------------------------"
pip install packages/$package
rm -rf packages/$package/build
echo "================================================="
done

Expand All @@ -71,7 +72,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
cache: pip
cache-dependency-path: |
**/pyproject.toml
Expand All @@ -81,10 +82,10 @@ jobs:
run: |
bash scripts/build-info.sh

- name: Install MyPy (1.4.1)
- name: Install MyPy (1.14.0)
run: |
python -m pip install --upgrade pip
pip install mypy==1.4.1
pip install mypy==1.14.0

- name: Install dependencies
run: |
Expand All @@ -106,14 +107,17 @@ jobs:
echo "- $package"
echo "-------------------------------------------------"
pip install packages/$package
rm -rf packages/$package/build
echo "================================================="
done

- name: Check typing with MyPy
run: |
mypy --install-types --ignore-missing-imports --check-untyped-defs --non-interactive packages/*/dsw

mypy --install-types --ignore-missing-imports \
--check-untyped-defs --non-interactive \
packages/*/dsw

# Consistency of version tagging
version:
name: Version consts.py
runs-on: ubuntu-latest
Expand Down Expand Up @@ -145,3 +149,58 @@ jobs:
bash scripts/check-version.sh \
packages/dsw-tdk/dsw/tdk/consts.py \
packages/dsw-tdk/pyproject.toml

# Pylint
pylint:
name: Pylint
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: |
**/pyproject.toml
**/requirements*.txt

- name: Create build info
run: |
bash scripts/build-info.sh

- name: Install PyLint (3.3.3)
run: |
python -m pip install --upgrade pip
pip install pylint==3.3.3

- name: Install dependencies
run: |
ROOT=$(pwd)
for package in $(ls packages); do
echo "-------------------------------------------------"
echo "- $package"
echo "-------------------------------------------------"
cd "$ROOT/packages/$package"
pip install -r requirements.txt
make local-deps
echo "================================================="
done

- name: Install packages
run: |
for package in $(ls packages); do
echo "-------------------------------------------------"
echo "- $package"
echo "-------------------------------------------------"
pip install packages/$package
rm -rf packages/$package/build
echo "================================================="
done

- name: Lint with PyLint
run: |
pylint --rcfile=.pylintrc.ini packages/*/dsw
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- 'ubuntu-latest'
- 'windows-latest'
python-version:
- '3.10'
- '3.11'
- '3.12'

runs-on: ${{ matrix.os }}

Expand Down
Loading
Loading