Skip to content

Commit fa7377d

Browse files
author
abel
committed
(feat) Added Isort to the project and configure it to run in pre-commit
1 parent 71becbf commit fa7377d

File tree

60 files changed

+189
-214
lines changed

Some content is hidden

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

60 files changed

+189
-214
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ repos:
1717
types_or: [ python, jupyter, markdown, rst, yaml ]
1818
require_serial: true
1919
minimum_pre_commit_version: 2.9.0
20+
- repo: https://github.com/pycqa/isort
21+
rev: 5.12.0
22+
hooks:
23+
- id: isort
24+
name: isort (python)

compatibility-tests/tests.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
import asyncio
2-
import aiohttp
32
import base64
43
import json
4+
from typing import Any, Dict, List
5+
6+
import aiohttp
57
import ecdsa
6-
import sha3
78
import grpc
8-
9-
from typing import Any, Dict, List
10-
from injective.chain_client._wallet import (
11-
privkey_to_address,
12-
privkey_to_pubkey,
13-
seed_to_privkey,
14-
DEFAULT_BECH32_HRP,
15-
)
16-
from injective.chain_client._typings import SyncMode
179
import injective.exchange_api.injective_accounts_rpc_pb2 as accounts_rpc_pb
1810
import injective.exchange_api.injective_accounts_rpc_pb2_grpc as accounts_rpc_grpc
19-
11+
import sha3
12+
from injective.chain_client._typings import SyncMode
13+
from injective.chain_client._wallet import DEFAULT_BECH32_HRP, privkey_to_address, privkey_to_pubkey, seed_to_privkey
2014

2115
MIN_GAS_PRICE = 500000000
2216

compatibility-tests/unit_tests.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1-
import pytest
2-
import aiohttp
3-
import json
4-
import ecdsa
5-
import sha3
6-
import grpc
71
import base64
8-
2+
import json
93
from typing import Any, Dict, List
10-
from injective.chain_client._wallet import (
11-
privkey_to_address,
12-
privkey_to_pubkey,
13-
seed_to_privkey,
14-
DEFAULT_BECH32_HRP,
15-
)
164

17-
from injective.chain_client._typings import SyncMode
5+
import aiohttp
6+
import ecdsa
7+
import grpc
188
import injective.exchange_api.injective_accounts_rpc_pb2 as accounts_rpc_pb
199
import injective.exchange_api.injective_accounts_rpc_pb2_grpc as accounts_rpc_grpc
10+
import pytest
11+
import sha3
12+
from injective.chain_client._typings import SyncMode
13+
from injective.chain_client._wallet import DEFAULT_BECH32_HRP, privkey_to_address, privkey_to_pubkey, seed_to_privkey
2014

2115
MIN_GAS_PRICE = 500000000
2216

examples/SendToInjective.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import json
2-
31
import asyncio
2+
import json
43

54
from pyinjective.core.network import Network
65
from pyinjective.sendtocosmos import Peggo

examples/chain_client/0_LocalOrderHash.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import asyncio
22

33
from pyinjective.async_client import AsyncClient
4-
from pyinjective.transaction import Transaction
54
from pyinjective.core.network import Network
6-
from pyinjective.wallet import PrivateKey
75
from pyinjective.orderhash import OrderHashManager
6+
from pyinjective.transaction import Transaction
7+
from pyinjective.wallet import PrivateKey
88

99

1010
async def main() -> None:

examples/chain_client/13_MsgIncreasePositionMargin.py

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

33
from pyinjective.async_client import AsyncClient
4-
from pyinjective.transaction import Transaction
54
from pyinjective.core.network import Network
5+
from pyinjective.transaction import Transaction
66
from pyinjective.wallet import PrivateKey
77

88

examples/chain_client/15_MsgWithdraw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import asyncio
1616

1717
from pyinjective.async_client import AsyncClient
18-
from pyinjective.transaction import Transaction
1918
from pyinjective.core.network import Network
19+
from pyinjective.transaction import Transaction
2020
from pyinjective.wallet import PrivateKey
2121

2222

examples/chain_client/16_MsgSubaccountTransfer.py

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

33
from pyinjective.async_client import AsyncClient
4-
from pyinjective.transaction import Transaction
54
from pyinjective.core.network import Network
5+
from pyinjective.transaction import Transaction
66
from pyinjective.wallet import PrivateKey
77

88

examples/chain_client/17_MsgBatchUpdateOrders.py

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

33
from pyinjective.async_client import AsyncClient
4-
from pyinjective.transaction import Transaction
54
from pyinjective.core.network import Network
5+
from pyinjective.transaction import Transaction
66
from pyinjective.wallet import PrivateKey
77

88

examples/chain_client/18_MsgBid.py

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

33
from pyinjective.async_client import AsyncClient
4-
from pyinjective.transaction import Transaction
54
from pyinjective.core.network import Network
5+
from pyinjective.transaction import Transaction
66
from pyinjective.wallet import PrivateKey
77

88

0 commit comments

Comments
 (0)