Skip to content

Commit 4ad2552

Browse files
committed
Adds __all__ to easy_imports.py to get rid of all the #noqa stuff
1 parent bc9ec3e commit 4ad2552

File tree

1 file changed

+148
-22
lines changed

1 file changed

+148
-22
lines changed

bittensor/utils/easy_imports.py

Lines changed: 148 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import importlib
88
import sys
99

10-
from bittensor_wallet import Keypair # noqa: F401
11-
from bittensor_wallet.errors import KeyFileError # noqa: F401
12-
from bittensor_wallet.keyfile import ( # noqa: F401
10+
from bittensor_wallet import Keypair
11+
from bittensor_wallet.errors import KeyFileError
12+
from bittensor_wallet.keyfile import (
1313
serialized_keypair_to_keyfile_data,
1414
deserialize_keypair_from_keyfile_data,
1515
validate_password,
@@ -25,12 +25,12 @@
2525
decrypt_keyfile_data,
2626
Keyfile,
2727
)
28-
from bittensor_wallet.wallet import display_mnemonic_msg, Wallet # noqa: F401
28+
from bittensor_wallet.wallet import display_mnemonic_msg, Wallet
2929

30-
from bittensor.core import settings, timelock # noqa: F401
30+
from bittensor.core import settings, timelock
3131
from bittensor.core.async_subtensor import AsyncSubtensor
3232
from bittensor.core.axon import Axon
33-
from bittensor.core.chain_data import ( # noqa: F401
33+
from bittensor.core.chain_data import (
3434
AxonInfo,
3535
ChainIdentity,
3636
DelegateInfo,
@@ -55,14 +55,14 @@
5555
SubnetState,
5656
WeightCommitInfo,
5757
)
58-
from bittensor.core.config import ( # noqa: F401
58+
from bittensor.core.config import (
5959
InvalidConfigFile,
6060
DefaultConfig,
6161
Config,
6262
T,
6363
)
64-
from bittensor.core.dendrite import Dendrite # noqa: F401
65-
from bittensor.core.errors import ( # noqa: F401
64+
from bittensor.core.dendrite import Dendrite
65+
from bittensor.core.errors import (
6666
BlacklistedException,
6767
ChainConnectionError,
6868
ChainError,
@@ -102,15 +102,13 @@
102102
)
103103
from bittensor.core.metagraph import Metagraph
104104
from bittensor.core.settings import BLOCKTIME
105-
from bittensor.core.stream import StreamingSynapse # noqa: F401
105+
from bittensor.core.stream import StreamingSynapse
106106
from bittensor.core.subtensor import Subtensor
107-
from bittensor.core.subtensor_api import SubtensorApi # noqa: F401
108-
from bittensor.core.synapse import TerminalInfo, Synapse # noqa: F401
109-
from bittensor.core.tensor import Tensor # noqa: F401
110-
from bittensor.core.threadpool import ( # noqa: F401
111-
PriorityThreadPoolExecutor as PriorityThreadPoolExecutor,
112-
)
113-
from bittensor.utils import ( # noqa: F401
107+
from bittensor.core.subtensor_api import SubtensorApi
108+
from bittensor.core.synapse import TerminalInfo, Synapse
109+
from bittensor.core.tensor import Tensor
110+
from bittensor.core.threadpool import PriorityThreadPoolExecutor
111+
from bittensor.utils import (
114112
ss58_to_vec_u8,
115113
version_checking,
116114
strtobool,
@@ -120,14 +118,12 @@
120118
u64_normalized_float,
121119
get_hash,
122120
)
123-
from bittensor.utils.balance import Balance as Balance # noqa: F401
121+
from bittensor.utils.balance import Balance
124122
from bittensor.utils.balance import tao, rao
125123
from bittensor.utils.btlogging import logging
126-
from bittensor.utils.mock.subtensor_mock import MockSubtensor as MockSubtensor # noqa: F401
127-
from bittensor.utils.subnets import SubnetsAPI # noqa: F401
124+
from bittensor.utils.mock.subtensor_mock import MockSubtensor
125+
from bittensor.utils.subnets import SubnetsAPI
128126

129-
tao = tao
130-
rao = rao
131127

132128
# Backwards compatibility with previous bittensor versions.
133129
async_subtensor = AsyncSubtensor
@@ -201,3 +197,133 @@ def info(on: bool = True):
201197
on (bool): If True, enables info logging. If False, disables info logging and sets default (WARNING) level.
202198
"""
203199
logging.set_info(on)
200+
201+
202+
__all__ = [
203+
"Keypair",
204+
"KeyFileError",
205+
"serialized_keypair_to_keyfile_data",
206+
"deserialize_keypair_from_keyfile_data",
207+
"validate_password",
208+
"ask_password_to_encrypt",
209+
"keyfile_data_is_encrypted_nacl",
210+
"keyfile_data_is_encrypted_ansible",
211+
"keyfile_data_is_encrypted_legacy",
212+
"keyfile_data_is_encrypted",
213+
"keyfile_data_encryption_method",
214+
"legacy_encrypt_keyfile_data",
215+
"encrypt_keyfile_data",
216+
"get_coldkey_password_from_environment",
217+
"decrypt_keyfile_data",
218+
"Keyfile",
219+
"display_mnemonic_msg",
220+
"Wallet",
221+
"settings",
222+
"timelock",
223+
"AsyncSubtensor",
224+
"Axon",
225+
"AxonInfo",
226+
"ChainIdentity",
227+
"DelegateInfo",
228+
"DelegateInfoLite",
229+
"DynamicInfo",
230+
"IPInfo",
231+
"MetagraphInfo",
232+
"MetagraphInfoEmissions",
233+
"MetagraphInfoParams",
234+
"MetagraphInfoPool",
235+
"NeuronInfo",
236+
"NeuronInfoLite",
237+
"PrometheusInfo",
238+
"ProposalCallData",
239+
"ProposalVoteData",
240+
"ScheduledColdkeySwapInfo",
241+
"SelectiveMetagraphIndex",
242+
"StakeInfo",
243+
"SubnetHyperparameters",
244+
"SubnetIdentity",
245+
"SubnetInfo",
246+
"SubnetState",
247+
"WeightCommitInfo",
248+
"InvalidConfigFile",
249+
"DefaultConfig",
250+
"Config",
251+
"T",
252+
"Dendrite",
253+
"BlacklistedException",
254+
"ChainConnectionError",
255+
"ChainError",
256+
"ChainQueryError",
257+
"ChainTransactionError",
258+
"DelegateTakeTooHigh",
259+
"DelegateTakeTooLow",
260+
"DelegateTxRateLimitExceeded",
261+
"DuplicateChild",
262+
"HotKeyAccountNotExists",
263+
"IdentityError",
264+
"InternalServerError",
265+
"InvalidChild",
266+
"InvalidRequestNameError",
267+
"MetadataError",
268+
"NominationError",
269+
"NonAssociatedColdKey",
270+
"NotDelegateError",
271+
"NotEnoughStakeToSetChildkeys",
272+
"NotRegisteredError",
273+
"NotVerifiedException",
274+
"PostProcessException",
275+
"PriorityException",
276+
"ProportionOverflow",
277+
"RegistrationError",
278+
"RegistrationNotPermittedOnRootSubnet",
279+
"RunException",
280+
"StakeError",
281+
"SubNetworkDoesNotExist",
282+
"SynapseDendriteNoneException",
283+
"SynapseParsingError",
284+
"TooManyChildren",
285+
"TransferError",
286+
"TxRateLimitExceeded",
287+
"UnknownSynapseError",
288+
"UnstakeError",
289+
"Metagraph",
290+
"BLOCKTIME",
291+
"StreamingSynapse",
292+
"Subtensor",
293+
"SubtensorApi",
294+
"TerminalInfo",
295+
"Synapse",
296+
"Tensor",
297+
"PriorityThreadPoolExecutor",
298+
"ss58_to_vec_u8",
299+
"version_checking",
300+
"strtobool",
301+
"get_explorer_url_for_network",
302+
"ss58_address_to_bytes",
303+
"u16_normalized_float",
304+
"u64_normalized_float",
305+
"get_hash",
306+
"Balance",
307+
"tao",
308+
"rao",
309+
"logging",
310+
"MockSubtensor",
311+
"SubnetsAPI",
312+
"__blocktime__",
313+
"__network_explorer_map__",
314+
"__pipaddress__",
315+
"__ss58_format__",
316+
"__type_registry__",
317+
"__ss58_address_length__",
318+
"__networks__",
319+
"__finney_entrypoint__",
320+
"__finney_test_entrypoint__",
321+
"__archive_entrypoint__",
322+
"__local_entrypoint__",
323+
"__tao_symbol__",
324+
"__rao_symbol__",
325+
"trace",
326+
"debug",
327+
"warning",
328+
"info",
329+
]

0 commit comments

Comments
 (0)