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

Upgrade pyupgrade target to Python3.9 #620

Merged
merged 1 commit into from
Dec 13, 2024
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ format-check:
black --diff --check streamflow tests

pyupgrade:
pyupgrade --py3-only --py38-plus $(shell git ls-files | grep .py | grep -v streamflow/cwl/antlr)
pyupgrade --py3-only --py39-plus $(shell git ls-files | grep .py | grep -v streamflow/cwl/antlr)

test:
python -m pytest -rs ${PYTEST_EXTRA}
Expand Down
3 changes: 1 addition & 2 deletions streamflow/cwl/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
from types import ModuleType
from typing import (
Any,
MutableMapping,
MutableSequence,
cast,
get_args,
)
from collections.abc import MutableMapping, MutableSequence

import cwl_utils.parser
import cwl_utils.parser.utils
Expand Down
7 changes: 3 additions & 4 deletions tests/test_build_wf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import Type, cast

import pytest
from typing import cast

from streamflow.core import utils
from streamflow.core.config import BindingConfig
Expand Down Expand Up @@ -74,7 +73,7 @@ async def _clone_step(step, workflow, context):
return new_workflow, new_step


async def _general_test_port(context: StreamFlowContext, cls_port: Type[Port]):
async def _general_test_port(context: StreamFlowContext, cls_port: type[Port]):
workflow, ports = await create_workflow(context)
port = workflow.create_port(cls_port)
await workflow.save(context)
Expand Down Expand Up @@ -325,7 +324,7 @@ async def test_schedule_step(context: StreamFlowContext):

@pytest.mark.asyncio
@pytest.mark.parametrize("port_cls", [Port, JobPort, ConnectorPort])
async def test_port(context: StreamFlowContext, port_cls: Type[Port]):
async def test_port(context: StreamFlowContext, port_cls: type[Port]):
"""Test saving Port on database and re-load it in a new Workflow"""
await _general_test_port(context, port_cls)

Expand Down
8 changes: 4 additions & 4 deletions tests/test_cwl_build_wf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
import posixpath
from typing import Type, cast
from typing import cast

import pytest

from streamflow.core import utils
from streamflow.core.context import StreamFlowContext
Expand Down Expand Up @@ -45,7 +45,7 @@

@pytest.mark.asyncio
@pytest.mark.parametrize("step_cls", [CWLLoopOutputAllStep, CWLLoopOutputLastStep])
async def test_cwl_loop_output(context: StreamFlowContext, step_cls: Type[Step]):
async def test_cwl_loop_output(context: StreamFlowContext, step_cls: type[Step]):
"""Test saving CWLLoopOutputAllStep on database and re-load it in a new Workflow"""
workflow, _ = await create_workflow(context, num_port=0)
await _base_step_test_process(
Expand Down Expand Up @@ -181,7 +181,7 @@ async def test_loop_value_from_transformer(context: StreamFlowContext):
[AllNonNullTransformer, FirstNonNullTransformer, OnlyNonNullTransformer],
)
async def test_non_null_transformer(
context: StreamFlowContext, transformer_cls: Type[Step]
context: StreamFlowContext, transformer_cls: type[Step]
):
"""Test saving All/First/Only NonNullTransformer on database and re-load it in a new Workflow"""
workflow, _ = await create_workflow(context, num_port=0)
Expand Down
Loading