From 30fe0a89f7598f5939378713431210359d8bd6ee Mon Sep 17 00:00:00 2001 From: Mohcine Chraibi Date: Mon, 30 Sep 2024 07:43:08 +0900 Subject: [PATCH] update CI --- .github/workflows/streamlit-actions.yml | 38 ++++++++++++++----------- .ruff.toml | 12 ++++++-- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/.github/workflows/streamlit-actions.yml b/.github/workflows/streamlit-actions.yml index 1537cbd..27cfc7c 100644 --- a/.github/workflows/streamlit-actions.yml +++ b/.github/workflows/streamlit-actions.yml @@ -1,3 +1,4 @@ + name: madras-data-app on: @@ -13,25 +14,28 @@ jobs: streamlit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 with: python-version: '3.11' - - uses: streamlit/streamlit-app-action@v0.0.3 - with: - app-path: app.py - ruff: true + - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install black mypy ruff - pip install -r requirements.txt + python -m pip install --upgrade pip --quiet + pip install -r requirements.txt --quiet + pip install mypy ruff --quiet + - name: Lint with Ruff - run: ruff . - - name: Format with Black - run: | - black --diff $(git ls-files '*.py') - - name: Analysing with Mypy - run: | - mypy --strict $(git ls-files '*.py') - \ No newline at end of file + run: ruff check . + + - name: Analyze with Mypy + run: mypy --strict --jobs 4 $(git ls-files '*.py') + + - name: Run Streamlit app + uses: streamlit/streamlit-app-action@v0.0.3 + with: + app-path: app.py + ruff: true diff --git a/.ruff.toml b/.ruff.toml index 58004c4..943bc7f 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -1,5 +1,11 @@ line-length = 180 target-version = "py311" -lint.select = ["E", "W", "F", "C", "R"] -lint.ignore = ["E501"] -# --extend-ignore = "E203, W503" + +# Linting rule selection +select = ["E", "W", "F", "C", "R"] +ignore = ["E501"] # Ignore long line errors + +# Exclude files from checks +exclude = [ + "**/*.ipynb" +] \ No newline at end of file