From d00ddcbb1a6cbfb3e71d2e25f21a4428bb495bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9r=C3=A9nice=20Batut?= Date: Fri, 11 Oct 2024 14:20:01 +0200 Subject: [PATCH] Fix linting on Python 3.8 - @nsoranzo commit --- .github/workflows/run_tests.yaml | 9 ++++++--- pyproject.toml | 4 +++- sources/bin/extract_galaxy_workflows.py | 15 ++++++++------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 31b8a1d0..50fff3e3 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -4,13 +4,16 @@ on: [push, pull_request_target] jobs: test-tools: runs-on: ubuntu-20.04 + strategy: + matrix: + python-version: ['3.8', '3.11'] environment: fetch-tools steps: - name: Checkout uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: ${{ matrix.python-version }} - name: Install requirement run: python -m pip install -r requirements.txt - name: Tool extraction @@ -31,7 +34,7 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: ${{ matrix.python-version }} - name: Install requirement run: python -m pip install -r requirements.txt - name: Tutorial extraction @@ -49,7 +52,7 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: ${{ matrix.python-version }} - name: Install requirement run: python -m pip install -r requirements.txt - name: Workflow extraction diff --git a/pyproject.toml b/pyproject.toml index ca4018da..32e1a463 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,10 +7,12 @@ include = '\.pyi?$' isort = true [tool.ruff] +target-version = "py38" + +[tool.ruff.lint] # Enable: pycodestyle errors (E), Pyflakes (F), flake8-bugbear (B), # flake8-logging-format (G) and pyupgrade (UP) select = ["E", "F", "B", "G", "UP"] -target-version = "py38" # Exceptions: # B008 Do not perform function calls in argument defaults (for FastAPI Depends and Body) # B9 flake8-bugbear opinionated warnings diff --git a/sources/bin/extract_galaxy_workflows.py b/sources/bin/extract_galaxy_workflows.py index 261919b2..3aaaaa73 100644 --- a/sources/bin/extract_galaxy_workflows.py +++ b/sources/bin/extract_galaxy_workflows.py @@ -3,6 +3,7 @@ import argparse from typing import ( Any, + Dict, List, ) @@ -20,16 +21,16 @@ def __init__(self) -> None: self.id = 0 self.link = "" self.name = "" - self.creators: list[str] = [] - self.tags: list[str] = [] + self.creators: List[str] = [] + self.tags: List[str] = [] self.create_time = "" self.update_time = "" self.latest_version = 0 self.versions = 0 self.number_of_steps = 0 - self.tools: list[str] = [] - self.edam_operation: list[str] = [] - self.edam_topic: list[str] = [] + self.tools: List[str] = [] + self.edam_operation: List[str] = [] + self.edam_topic: List[str] = [] self.license = "" self.doi = "" @@ -122,8 +123,8 @@ class Workflows: """ def __init__(self, test: bool = False) -> None: - self.workflows: list[Workflow] = [] - self.tools: dict[Any, Any] = {} + self.workflows: List[Workflow] = [] + self.tools: Dict[Any, Any] = {} self.test = test def init_by_searching(self, tool_fp: str) -> None: