Whole project lint

This commit is contained in:
2025-05-14 14:20:09 +01:00
parent 1661c02de0
commit 6e5f414db0
3 changed files with 63 additions and 66 deletions

View File

@@ -9,79 +9,79 @@
name: CI name: CI
on: on:
push: push:
branches: master branches: master
pull_request: pull_request:
branches: master branches: master
schedule: schedule:
# * is a special character in YAML so you have to quote this string # * is a special character in YAML so you have to quote this string
- cron: "0 3 * * 6" - cron: "0 3 * * 6"
workflow_dispatch: workflow_dispatch:
inputs: inputs:
reason: reason:
description: "Reason" description: "Reason"
required: false required: false
default: "Manual trigger" default: "Manual trigger"
jobs: jobs:
create-strategy: create-strategy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
matrix: ${{ steps.requirements.outputs.matrix }} matrix: ${{ steps.requirements.outputs.matrix }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: requirements - name: requirements
id: requirements id: requirements
run: | run: |
# Define a simple matrix with your Python version # Define a simple matrix with your Python version
# Since we're using pyproject.toml with Python 3.12 requirement # Since we're using pyproject.toml with Python 3.12 requirement
echo "matrix={\"include\": [{\"python-version\": \"3.12\"}]}" >> $GITHUB_OUTPUT echo "matrix={\"include\": [{\"python-version\": \"3.12\"}]}" >> $GITHUB_OUTPUT
# Print the matrix for debugging # Print the matrix for debugging
echo "-------------------" echo "-------------------"
echo "Matrix: {\"include\": [{\"python-version\": \"3.12\"}]}" echo "Matrix: {\"include\": [{\"python-version\": \"3.12\"}]}"
echo "-------------------" echo "-------------------"
tests: tests:
needs: create-strategy needs: create-strategy
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Test (Python ${{matrix.python-version}}) name: Test (Python ${{matrix.python-version}})
strategy: strategy:
fail-fast: false fail-fast: false
matrix: ${{ fromJson(needs.create-strategy.outputs.matrix) }} matrix: ${{ fromJson(needs.create-strategy.outputs.matrix) }}
# Simplified environment without service variables # Simplified environment without service variables
env: env:
PYTHON_VERSION: ${{ matrix.python-version }} PYTHON_VERSION: ${{ matrix.python-version }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up uv - name: Set up uv
uses: astral-sh/setup-uv@v6 uses: astral-sh/setup-uv@v6
with: with:
python-version: "${{ matrix.python-version }}" python-version: "${{ matrix.python-version }}"
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
pyproject.toml pyproject.toml
cache-suffix: ${{ matrix.python-version }} cache-suffix: ${{ matrix.python-version }}
- name: Show configuration - name: Show configuration
run: | run: |
uv --version uv --version
uv run python --version uv run python --version
docker --version docker --version
docker ps docker ps
- name: Install dependencies - name: Install dependencies
run: | run: |
uv sync --group tests uv sync --group tests
- name: Run tests - name: Run tests
run: | run: |
uv run test uv run test

View File

@@ -8,8 +8,6 @@
"""invenio module for I-Form theme.""" """invenio module for I-Form theme."""
from invenio_i18n import gettext as _
INVENIO_THEME_IFORM_DEFAULT_VALUE = "I-Form Repository" INVENIO_THEME_IFORM_DEFAULT_VALUE = "I-Form Repository"
"""Default value for the application.""" """Default value for the application."""

View File

@@ -9,7 +9,6 @@
"""invenio module for I-Form theme.""" """invenio module for I-Form theme."""
from flask_login import login_required 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 invenio_records_marc21.ui.theme import current_identity_can_view
from . import config from . import config