Skip to content

Commit c4793af

Browse files
committed
chore: mypy and ruff tweaks wip
1 parent aad3ca1 commit c4793af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+160
-408
lines changed

.github/workflows/check-python.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
# stop the build if there are files that don't meet formatting requirements
3838
poetry run ruff format --check .
3939
40-
- name: Check linting with Ruff
41-
run: |
42-
# stop the build if there are Python syntax errors or undefined names
43-
poetry run ruff check .
40+
# - name: Check linting with Ruff
41+
# run: |
42+
# # stop the build if there are Python syntax errors or undefined names
43+
# poetry run ruff check .
4444

4545
- name: Check types with mypy
4646
run: poetry run mypy

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ repos:
3333
additional_dependencies: []
3434
minimum_pre_commit_version: "2.9.2"
3535
files: "^(src|tests)/"
36+
exclude: "^tests/artifacts/"

legacy_v2_tests/test_account.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from typing import TYPE_CHECKING
22

33
from algokit_utils import get_account
4-
54
from legacy_v2_tests.conftest import get_unique_name
65

76
if TYPE_CHECKING:

legacy_v2_tests/test_app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
23
from algokit_utils import AppDeployMetaData
34

45

legacy_v2_tests/test_app_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
23
from algokit_utils import (
34
DeploymentFailedError,
45
get_next_version,

legacy_v2_tests/test_app_client_clear_state.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
from typing import TYPE_CHECKING
33

44
import pytest
5+
56
from algokit_utils import (
67
Account,
78
ApplicationClient,
89
ApplicationSpecification,
910
)
10-
1111
from legacy_v2_tests.conftest import is_opted_in
1212

1313
if TYPE_CHECKING:
1414
from algosdk.v2client.algod import AlgodClient
1515
from algosdk.v2client.indexer import IndexerClient
1616

1717

18-
@pytest.fixture()
18+
@pytest.fixture
1919
def client_fixture(
2020
algod_client: "AlgodClient",
2121
indexer_client: "IndexerClient",

legacy_v2_tests/test_app_client_close_out.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
from typing import TYPE_CHECKING
22

33
import pytest
4+
45
from algokit_utils import (
56
Account,
67
ApplicationClient,
78
ApplicationSpecification,
89
LogicError,
910
)
10-
1111
from legacy_v2_tests.conftest import check_output_stability, is_opted_in
1212

1313
if TYPE_CHECKING:
1414
from algosdk.v2client.algod import AlgodClient
1515
from algosdk.v2client.indexer import IndexerClient
1616

1717

18-
@pytest.fixture()
18+
@pytest.fixture
1919
def client_fixture(
2020
algod_client: "AlgodClient",
2121
indexer_client: "IndexerClient",

legacy_v2_tests/test_app_client_create.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
from typing import TYPE_CHECKING
33

44
import pytest
5+
from algosdk.atomic_transaction_composer import AccountTransactionSigner, AtomicTransactionComposer, TransactionSigner
6+
from algosdk.transaction import ApplicationCallTxn, GenericSignedTransaction, OnComplete, Transaction
7+
58
from algokit_utils import (
69
Account,
710
ApplicationClient,
@@ -10,9 +13,6 @@
1013
get_account,
1114
get_app_id_from_tx_id,
1215
)
13-
from algosdk.atomic_transaction_composer import AccountTransactionSigner, AtomicTransactionComposer, TransactionSigner
14-
from algosdk.transaction import ApplicationCallTxn, GenericSignedTransaction, OnComplete, Transaction
15-
1616
from legacy_v2_tests.conftest import check_output_stability, get_unique_name
1717

1818
if TYPE_CHECKING:

legacy_v2_tests/test_app_client_delete.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
from typing import TYPE_CHECKING
22

33
import pytest
4+
45
from algokit_utils import (
56
Account,
67
ApplicationClient,
78
ApplicationSpecification,
89
LogicError,
910
)
10-
1111
from legacy_v2_tests.conftest import check_output_stability
1212

1313
if TYPE_CHECKING:
1414
from algosdk.v2client.algod import AlgodClient
1515
from algosdk.v2client.indexer import IndexerClient
1616

1717

18-
@pytest.fixture()
18+
@pytest.fixture
1919
def client_fixture(
2020
algod_client: "AlgodClient",
2121
indexer_client: "IndexerClient",

legacy_v2_tests/test_app_client_deploy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import TYPE_CHECKING
22

33
import pytest
4+
45
from algokit_utils import (
56
ABICreateCallArgs,
67
Account,
@@ -9,15 +10,14 @@
910
TransferParameters,
1011
transfer,
1112
)
12-
1313
from legacy_v2_tests.conftest import get_unique_name, read_spec
1414

1515
if TYPE_CHECKING:
1616
from algosdk.v2client.algod import AlgodClient
1717
from algosdk.v2client.indexer import IndexerClient
1818

1919

20-
@pytest.fixture()
20+
@pytest.fixture
2121
def client_fixture(
2222
algod_client: "AlgodClient",
2323
indexer_client: "IndexerClient",

legacy_v2_tests/test_app_client_opt_in.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
from typing import TYPE_CHECKING
22

33
import pytest
4+
45
from algokit_utils import (
56
Account,
67
ApplicationClient,
78
ApplicationSpecification,
89
LogicError,
910
)
10-
1111
from legacy_v2_tests.conftest import check_output_stability, is_opted_in
1212

1313
if TYPE_CHECKING:
1414
from algosdk.v2client.algod import AlgodClient
1515
from algosdk.v2client.indexer import IndexerClient
1616

1717

18-
@pytest.fixture()
18+
@pytest.fixture
1919
def client_fixture(
2020
algod_client: "AlgodClient",
2121
indexer_client: "IndexerClient",

legacy_v2_tests/test_app_client_prepare.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import base64
22
from typing import TYPE_CHECKING
33

4+
from algosdk.atomic_transaction_composer import AccountTransactionSigner
5+
46
from algokit_utils import (
57
ApplicationClient,
68
ApplicationSpecification,
79
)
8-
from algosdk.atomic_transaction_composer import AccountTransactionSigner
910

1011
if TYPE_CHECKING:
1112
from algosdk.v2client.algod import AlgodClient

legacy_v2_tests/test_app_client_resolve.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
ApplicationClient,
66
DefaultArgumentDict,
77
)
8-
98
from legacy_v2_tests.conftest import read_spec
109

1110
if TYPE_CHECKING:

legacy_v2_tests/test_app_client_signer_sender.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
from typing import TYPE_CHECKING, Any
44

55
import pytest
6+
from algosdk.atomic_transaction_composer import AccountTransactionSigner, TransactionSigner
7+
68
from algokit_utils import (
79
ApplicationClient,
810
ApplicationSpecification,
911
get_sender_from_signer,
1012
)
11-
from algosdk.atomic_transaction_composer import AccountTransactionSigner, TransactionSigner
1213

1314
if TYPE_CHECKING:
1415
from algosdk import transaction
@@ -30,7 +31,7 @@ def sign_transactions(
3031
@pytest.mark.parametrize("override_signer", [CustomSigner(), AccountTransactionSigner(fake_key), None])
3132
@pytest.mark.parametrize("default_sender", ["default_sender", None])
3233
@pytest.mark.parametrize("default_signer", [CustomSigner(), AccountTransactionSigner(fake_key), None])
33-
def test_resolve_signer_sender( # noqa: PLR0913
34+
def test_resolve_signer_sender(
3435
*,
3536
algod_client: "AlgodClient",
3637
app_spec: ApplicationSpecification,

legacy_v2_tests/test_app_client_template_values.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from typing import TYPE_CHECKING
22

3-
import algokit_utils
43
import pytest
54

5+
import algokit_utils
66
from legacy_v2_tests.conftest import get_unique_name, read_spec
77

88
if TYPE_CHECKING:

legacy_v2_tests/test_app_client_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from typing import TYPE_CHECKING
22

33
import pytest
4+
45
from algokit_utils import (
56
Account,
67
ApplicationClient,
78
ApplicationSpecification,
89
LogicError,
910
)
10-
1111
from legacy_v2_tests.conftest import check_output_stability
1212

1313
if TYPE_CHECKING:

legacy_v2_tests/test_asset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from typing import TYPE_CHECKING
33

44
import pytest
5+
56
from algokit_utils import (
67
Account,
78
EnsureBalanceParameters,
@@ -19,7 +20,7 @@
1920
from legacy_v2_tests.conftest import assure_funds, generate_test_asset, get_unique_name
2021

2122

22-
@pytest.fixture()
23+
@pytest.fixture
2324
def to_account(kmd_client: "KMDClient") -> Account:
2425
return create_kmd_wallet_account(kmd_client, get_unique_name())
2526

legacy_v2_tests/test_debug_utils.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
from unittest.mock import Mock
44

55
import pytest
6+
from algosdk.atomic_transaction_composer import (
7+
AccountTransactionSigner,
8+
AtomicTransactionComposer,
9+
TransactionWithSigner,
10+
)
11+
from algosdk.transaction import PaymentTxn
12+
613
from algokit_utils._debugging import (
714
AVMDebuggerSourceMap,
815
PersistSourceMapInput,
@@ -14,20 +21,13 @@
1421
from algokit_utils.application_specification import ApplicationSpecification
1522
from algokit_utils.common import Program
1623
from algokit_utils.models import Account
17-
from algosdk.atomic_transaction_composer import (
18-
AccountTransactionSigner,
19-
AtomicTransactionComposer,
20-
TransactionWithSigner,
21-
)
22-
from algosdk.transaction import PaymentTxn
23-
2424
from legacy_v2_tests.conftest import check_output_stability, get_unique_name
2525

2626
if TYPE_CHECKING:
2727
from algosdk.v2client.algod import AlgodClient
2828

2929

30-
@pytest.fixture()
30+
@pytest.fixture
3131
def client_fixture(algod_client: "AlgodClient", app_spec: ApplicationSpecification) -> ApplicationClient:
3232
creator_name = get_unique_name()
3333
creator = get_account(algod_client, creator_name)

legacy_v2_tests/test_deploy.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
replace_template_variables,
33
)
44
from algokit_utils._legacy_v2.deploy import strip_comments
5-
65
from legacy_v2_tests.conftest import check_output_stability
76

87

legacy_v2_tests/test_deploy_scenarios.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from unittest.mock import Mock, patch
77

88
import pytest
9+
910
from algokit_utils import (
1011
Account,
1112
ApplicationClient,
@@ -19,7 +20,6 @@
1920
get_indexer_client,
2021
get_localnet_default_account,
2122
)
22-
2323
from legacy_v2_tests.conftest import check_output_stability, get_specs, get_unique_name, read_spec
2424

2525
logger = logging.getLogger(__name__)
@@ -56,7 +56,7 @@ def __init__(
5656
self.creator = creator
5757
self.app_name = get_unique_name()
5858

59-
def deploy( # noqa: PLR0913
59+
def deploy(
6060
self,
6161
app_spec: ApplicationSpecification,
6262
*,
@@ -128,12 +128,12 @@ def creator(creator_name: str) -> Account:
128128
return get_account(get_algod_client(), creator_name)
129129

130130

131-
@pytest.fixture()
131+
@pytest.fixture
132132
def app_name() -> str:
133133
return get_unique_name()
134134

135135

136-
@pytest.fixture()
136+
@pytest.fixture
137137
def deploy_fixture(
138138
caplog: pytest.LogCaptureFixture, request: pytest.FixtureRequest, creator_name: str, creator: Account
139139
) -> DeployFixture:

legacy_v2_tests/test_dispenser_api_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import json
22

33
import pytest
4+
from pytest_httpx import HTTPXMock
5+
46
from algokit_utils.dispenser_api import (
57
DISPENSER_ASSETS,
68
DispenserApiConfig,
79
DispenserAssetName,
810
TestNetDispenserApiClient,
911
)
10-
from pytest_httpx import HTTPXMock
1112

1213

1314
class TestDispenserApiTestnetClient:

0 commit comments

Comments
 (0)