From 6e5f414db02d38d50ab98a9b22452c9f4474a442 Mon Sep 17 00:00:00 2001 From: Cian Hughes Date: Wed, 14 May 2025 14:20:09 +0100 Subject: [PATCH] Whole project lint --- .github/workflows/tests.yml | 126 +++++++++++++++++----------------- invenio_theme_iform/config.py | 2 - invenio_theme_iform/ext.py | 1 - 3 files changed, 63 insertions(+), 66 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7f26f4a..6a1bf28 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,79 +9,79 @@ name: CI on: - push: - branches: master - pull_request: - branches: master - schedule: - # * is a special character in YAML so you have to quote this string - - cron: "0 3 * * 6" - workflow_dispatch: - inputs: - reason: - description: "Reason" - required: false - default: "Manual trigger" + push: + branches: master + pull_request: + branches: master + schedule: + # * is a special character in YAML so you have to quote this string + - cron: "0 3 * * 6" + workflow_dispatch: + inputs: + reason: + description: "Reason" + required: false + default: "Manual trigger" jobs: - create-strategy: - runs-on: ubuntu-latest + create-strategy: + runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.requirements.outputs.matrix }} + outputs: + matrix: ${{ steps.requirements.outputs.matrix }} - steps: - - name: Checkout - uses: actions/checkout@v4 + steps: + - name: Checkout + uses: actions/checkout@v4 - - name: requirements - id: requirements - run: | - # Define a simple matrix with your Python version - # Since we're using pyproject.toml with Python 3.12 requirement - echo "matrix={\"include\": [{\"python-version\": \"3.12\"}]}" >> $GITHUB_OUTPUT + - name: requirements + id: requirements + run: | + # Define a simple matrix with your Python version + # Since we're using pyproject.toml with Python 3.12 requirement + echo "matrix={\"include\": [{\"python-version\": \"3.12\"}]}" >> $GITHUB_OUTPUT - # Print the matrix for debugging - echo "-------------------" - echo "Matrix: {\"include\": [{\"python-version\": \"3.12\"}]}" - echo "-------------------" + # Print the matrix for debugging + echo "-------------------" + echo "Matrix: {\"include\": [{\"python-version\": \"3.12\"}]}" + echo "-------------------" - tests: - needs: create-strategy - runs-on: ubuntu-latest - name: Test (Python ${{matrix.python-version}}) - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.create-strategy.outputs.matrix) }} + tests: + needs: create-strategy + runs-on: ubuntu-latest + name: Test (Python ${{matrix.python-version}}) + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.create-strategy.outputs.matrix) }} - # Simplified environment without service variables - env: - PYTHON_VERSION: ${{ matrix.python-version }} + # Simplified environment without service variables + env: + PYTHON_VERSION: ${{ matrix.python-version }} - steps: - - name: Checkout - uses: actions/checkout@v4 + steps: + - name: Checkout + uses: actions/checkout@v4 - - name: Set up uv - uses: astral-sh/setup-uv@v6 - with: - python-version: "${{ matrix.python-version }}" - enable-cache: true - cache-dependency-glob: | - pyproject.toml - cache-suffix: ${{ matrix.python-version }} + - name: Set up uv + uses: astral-sh/setup-uv@v6 + with: + python-version: "${{ matrix.python-version }}" + enable-cache: true + cache-dependency-glob: | + pyproject.toml + cache-suffix: ${{ matrix.python-version }} - - name: Show configuration - run: | - uv --version - uv run python --version - docker --version - docker ps + - name: Show configuration + run: | + uv --version + uv run python --version + docker --version + docker ps - - name: Install dependencies - run: | - uv sync --group tests + - name: Install dependencies + run: | + uv sync --group tests - - name: Run tests - run: | - uv run test + - name: Run tests + run: | + uv run test diff --git a/invenio_theme_iform/config.py b/invenio_theme_iform/config.py index 6b7b39f..79fe7ed 100644 --- a/invenio_theme_iform/config.py +++ b/invenio_theme_iform/config.py @@ -8,8 +8,6 @@ """invenio module for I-Form theme.""" -from invenio_i18n import gettext as _ - INVENIO_THEME_IFORM_DEFAULT_VALUE = "I-Form Repository" """Default value for the application.""" diff --git a/invenio_theme_iform/ext.py b/invenio_theme_iform/ext.py index 44afa1f..621c164 100644 --- a/invenio_theme_iform/ext.py +++ b/invenio_theme_iform/ext.py @@ -9,7 +9,6 @@ """invenio module for I-Form theme.""" from flask_login import login_required -from invenio_i18n import lazy_gettext as _ from invenio_records_marc21.ui.theme import current_identity_can_view from . import config