From 3b084a165b0121a5918b8b7ff4db15a9e4d78d64 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 30 Sep 2022 04:40:22 -0400 Subject: [PATCH] configure isort to add the future annotations import (#13327) * configure isort to add the future annotations import * apply the new isort setting * remove type ignores for new mypy (#13539) https://pypi.org/project/mypy/0.981/ * another --- .isort.cfg | 1 + activated.py | 2 ++ benchmarks/block_ref.py | 2 ++ benchmarks/block_store.py | 2 ++ benchmarks/coin_store.py | 2 ++ benchmarks/jsonify.py | 2 ++ benchmarks/mempool.py | 2 ++ benchmarks/streamable.py | 2 ++ benchmarks/utils.py | 2 ++ build_scripts/check_dependency_artifacts.py | 2 ++ build_scripts/installer-version.py | 2 ++ chia/__init__.py | 2 ++ chia/clvm/singleton.py | 2 ++ chia/cmds/beta.py | 2 ++ chia/cmds/beta_funcs.py | 2 ++ chia/cmds/cmds_util.py | 2 ++ chia/cmds/configure.py | 2 ++ chia/cmds/data.py | 2 ++ chia/cmds/data_funcs.py | 2 ++ chia/cmds/db_backup_func.py | 2 ++ chia/cmds/db_validate_func.py | 2 ++ chia/cmds/netspace_funcs.py | 2 ++ chia/cmds/peer.py | 2 ++ chia/cmds/peer_funcs.py | 2 ++ chia/cmds/plots.py | 2 ++ chia/cmds/rpc.py | 2 ++ chia/cmds/show_funcs.py | 2 ++ chia/cmds/stop.py | 2 ++ chia/cmds/units.py | 2 ++ chia/consensus/block_body_validation.py | 2 ++ chia/consensus/block_creation.py | 2 ++ chia/consensus/block_header_validation.py | 2 ++ chia/consensus/block_record.py | 2 ++ chia/consensus/block_rewards.py | 2 ++ chia/consensus/block_root_validation.py | 2 ++ chia/consensus/blockchain.py | 2 ++ chia/consensus/blockchain_interface.py | 2 ++ chia/consensus/coinbase.py | 2 ++ chia/consensus/condition_costs.py | 2 ++ chia/consensus/constants.py | 2 ++ chia/consensus/cost_calculator.py | 2 ++ chia/consensus/default_constants.py | 2 ++ chia/consensus/deficit.py | 2 ++ chia/consensus/difficulty_adjustment.py | 2 ++ chia/consensus/find_fork_point.py | 2 ++ chia/consensus/full_block_to_block_record.py | 2 ++ chia/consensus/get_block_challenge.py | 2 ++ chia/consensus/make_sub_epoch_summary.py | 2 ++ chia/consensus/multiprocess_validation.py | 2 ++ chia/consensus/pos_quality.py | 2 ++ chia/consensus/pot_iterations.py | 2 ++ chia/consensus/vdf_info_computation.py | 2 ++ chia/daemon/client.py | 2 ++ chia/daemon/windows_signal.py | 2 ++ chia/data_layer/data_layer.py | 2 ++ chia/data_layer/data_layer_api.py | 2 ++ chia/data_layer/data_layer_errors.py | 2 ++ chia/data_layer/data_layer_server.py | 2 ++ chia/data_layer/data_store.py | 2 ++ chia/data_layer/dl_wallet_store.py | 2 ++ chia/data_layer/download_data.py | 2 ++ chia/data_layer/util/benchmark.py | 2 ++ chia/farmer/farmer.py | 2 ++ chia/farmer/farmer_api.py | 2 ++ chia/full_node/hint_management.py | 2 ++ chia/full_node/mempool.py | 2 ++ chia/full_node/pending_tx_cache.py | 2 ++ chia/full_node/signage_point.py | 2 ++ chia/harvester/harvester.py | 2 ++ chia/harvester/harvester_api.py | 2 ++ chia/introducer/introducer_api.py | 2 ++ chia/plot_sync/delta.py | 2 ++ chia/plot_sync/exceptions.py | 2 ++ chia/plot_sync/receiver.py | 2 ++ chia/plot_sync/util.py | 2 ++ chia/plotters/plotters_util.py | 2 ++ chia/plotting/cache.py | 2 ++ chia/plotting/check_plots.py | 2 ++ chia/plotting/create_plots.py | 2 ++ chia/plotting/manager.py | 2 ++ chia/plotting/util.py | 2 ++ chia/pools/pool_config.py | 2 ++ chia/protocols/farmer_protocol.py | 2 ++ chia/protocols/full_node_protocol.py | 2 ++ chia/protocols/harvester_protocol.py | 2 ++ chia/protocols/introducer_protocol.py | 2 ++ chia/protocols/protocol_message_types.py | 2 ++ chia/protocols/protocol_timing.py | 2 ++ chia/protocols/shared_protocol.py | 2 ++ chia/protocols/timelord_protocol.py | 2 ++ chia/protocols/wallet_protocol.py | 2 ++ chia/rpc/crawler_rpc_api.py | 2 ++ chia/rpc/data_layer_rpc_client.py | 2 ++ chia/rpc/data_layer_rpc_util.py | 2 ++ chia/rpc/farmer_rpc_api.py | 2 ++ chia/rpc/farmer_rpc_client.py | 2 ++ chia/rpc/full_node_rpc_api.py | 2 ++ chia/rpc/harvester_rpc_api.py | 2 ++ chia/rpc/harvester_rpc_client.py | 2 ++ chia/rpc/timelord_rpc_api.py | 2 ++ chia/rpc/util.py | 2 ++ chia/seeder/crawler_api.py | 2 ++ chia/seeder/peer_record.py | 2 ++ chia/seeder/start_crawler.py | 2 ++ chia/server/address_manager.py | 2 ++ chia/server/connection_utils.py | 2 ++ chia/server/outbound_message.py | 2 ++ chia/server/rate_limit_numbers.py | 2 ++ chia/server/rate_limits.py | 2 ++ chia/server/server.py | 2 ++ chia/server/ssl_context.py | 2 ++ chia/server/start_data_layer.py | 2 ++ chia/server/start_farmer.py | 2 ++ chia/server/start_full_node.py | 2 ++ chia/server/start_harvester.py | 2 ++ chia/server/start_introducer.py | 2 ++ chia/server/start_timelord.py | 2 ++ chia/server/ws_connection.py | 2 ++ chia/simulator/block_tools.py | 2 ++ chia/simulator/full_node_simulator.py | 2 ++ chia/simulator/simulator_full_node_rpc_api.py | 2 ++ chia/simulator/simulator_full_node_rpc_client.py | 2 ++ chia/simulator/simulator_protocol.py | 2 ++ chia/simulator/simulator_test_tools.py | 2 ++ chia/simulator/socket.py | 2 ++ chia/simulator/ssl_certs.py | 2 ++ chia/simulator/ssl_certs_1.py | 2 ++ chia/simulator/ssl_certs_10.py | 2 ++ chia/simulator/ssl_certs_2.py | 2 ++ chia/simulator/ssl_certs_3.py | 2 ++ chia/simulator/ssl_certs_4.py | 2 ++ chia/simulator/ssl_certs_5.py | 2 ++ chia/simulator/ssl_certs_6.py | 2 ++ chia/simulator/ssl_certs_7.py | 2 ++ chia/simulator/ssl_certs_8.py | 2 ++ chia/simulator/ssl_certs_9.py | 2 ++ chia/simulator/time_out_assert.py | 2 ++ chia/simulator/wallet_tools.py | 2 ++ chia/timelord/iters_from_block.py | 2 ++ chia/timelord/timelord.py | 2 ++ chia/timelord/timelord_api.py | 2 ++ chia/timelord/timelord_state.py | 2 ++ chia/timelord/types.py | 2 ++ chia/types/announcement.py | 2 ++ chia/types/block_protocol.py | 2 ++ chia/types/blockchain_format/classgroup.py | 2 ++ chia/types/blockchain_format/coin.py | 2 ++ chia/types/blockchain_format/foliage.py | 2 ++ chia/types/blockchain_format/pool_target.py | 2 ++ chia/types/blockchain_format/reward_chain_block.py | 2 ++ chia/types/blockchain_format/sized_bytes.py | 2 ++ chia/types/blockchain_format/slots.py | 2 ++ chia/types/blockchain_format/sub_epoch_summary.py | 2 ++ chia/types/blockchain_format/tree_hash.py | 2 ++ chia/types/coin_record.py | 2 ++ chia/types/condition_opcodes.py | 2 ++ chia/types/condition_with_args.py | 2 ++ chia/types/end_of_slot_bundle.py | 2 ++ chia/types/header_block.py | 2 ++ chia/types/mempool_inclusion_status.py | 2 ++ chia/types/mempool_item.py | 2 ++ chia/types/mempool_submission_status.py | 2 ++ chia/types/peer_info.py | 2 ++ chia/types/spend_bundle_conditions.py | 2 ++ chia/types/transaction_queue_entry.py | 2 ++ chia/types/unfinished_block.py | 2 ++ chia/types/unfinished_header_block.py | 2 ++ chia/types/weight_proof.py | 2 ++ chia/util/api_decorators.py | 2 ++ chia/util/block_cache.py | 2 ++ chia/util/cached_bls.py | 2 ++ chia/util/chunks.py | 2 ++ chia/util/config.py | 2 ++ chia/util/create_alert_file.py | 2 ++ chia/util/db_synchronous.py | 3 +++ chia/util/db_version.py | 2 ++ chia/util/default_root.py | 2 ++ chia/util/errors.py | 2 ++ chia/util/full_block_utils.py | 2 ++ chia/util/hash.py | 2 ++ chia/util/json_util.py | 2 ++ chia/util/make_test_constants.py | 2 ++ chia/util/merkle_set.py | 2 ++ chia/util/misc.py | 2 ++ chia/util/partial_func.py | 3 +++ chia/util/path.py | 2 ++ chia/util/permissions.py | 2 ++ chia/util/pip_import.py | 2 ++ chia/util/prev_transaction_block.py | 2 ++ chia/util/recursive_replace.py | 2 ++ chia/util/safe_cancel_task.py | 2 ++ chia/util/setproctitle.py | 2 ++ chia/util/significant_bits.py | 3 +++ chia/util/struct_stream.py | 2 ++ chia/util/validate_alert.py | 2 ++ chia/util/vdf_prover.py | 2 ++ chia/wallet/block_record.py | 2 ++ chia/wallet/cat_wallet/cat_constants.py | 2 ++ chia/wallet/cat_wallet/cat_outer_puzzle.py | 2 ++ chia/wallet/cat_wallet/lineage_store.py | 2 ++ chia/wallet/chialisp.py | 3 +++ chia/wallet/coin_selection.py | 2 ++ chia/wallet/db_wallet/db_wallet_puzzles.py | 2 ++ chia/wallet/derivation_record.py | 2 ++ chia/wallet/driver_protocol.py | 2 ++ chia/wallet/key_val_store.py | 2 ++ chia/wallet/nft_wallet/metadata_outer_puzzle.py | 2 ++ chia/wallet/nft_wallet/nft_info.py | 2 ++ chia/wallet/nft_wallet/nft_off_chain.py | 2 ++ chia/wallet/nft_wallet/nft_puzzles.py | 2 ++ chia/wallet/nft_wallet/nft_wallet.py | 2 ++ chia/wallet/nft_wallet/ownership_outer_puzzle.py | 2 ++ chia/wallet/nft_wallet/singleton_outer_puzzle.py | 2 ++ chia/wallet/nft_wallet/transfer_program_puzzle.py | 2 ++ chia/wallet/notification_store.py | 2 ++ chia/wallet/outer_puzzles.py | 2 ++ chia/wallet/puzzles/cat_loader.py | 2 ++ chia/wallet/puzzles/decompress_block_spends.py | 2 ++ chia/wallet/puzzles/p2_conditions.py | 2 ++ chia/wallet/puzzles/p2_delegated_conditions.py | 2 ++ chia/wallet/puzzles/p2_delegated_puzzle.py | 2 ++ chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py | 2 ++ chia/wallet/puzzles/p2_m_of_n_delegate_direct.py | 2 ++ chia/wallet/puzzles/p2_puzzle_hash.py | 2 ++ chia/wallet/puzzles/rom_bootstrap_generator.py | 2 ++ chia/wallet/puzzles/singleton_top_layer_v1_1.py | 2 ++ chia/wallet/secret_key_store.py | 2 ++ chia/wallet/settings/default_settings.py | 2 ++ chia/wallet/settings/settings_objects.py | 2 ++ chia/wallet/settings/user_settings.py | 2 ++ chia/wallet/trading/trade_status.py | 2 ++ chia/wallet/transaction_sorting.py | 2 ++ chia/wallet/uncurried_puzzle.py | 2 ++ chia/wallet/util/address_type.py | 2 ++ chia/wallet/util/curry_and_treehash.py | 2 ++ chia/wallet/util/json_clvm_utils.py | 2 ++ chia/wallet/util/merkle_tree.py | 2 ++ chia/wallet/util/merkle_utils.py | 2 ++ chia/wallet/util/new_peak_queue.py | 2 ++ chia/wallet/util/notifications.py | 2 ++ chia/wallet/util/transaction_type.py | 2 ++ chia/wallet/util/wallet_types.py | 2 ++ chia/wallet/wallet_action.py | 2 ++ chia/wallet/wallet_coin_record.py | 2 ++ chia/wallet/wallet_info.py | 2 ++ chia/wallet/wallet_nft_store.py | 2 ++ chia/wallet/wallet_puzzle_store.py | 2 ++ chia/wallet/wallet_transaction_store.py | 2 ++ chia/wallet/wallet_user_store.py | 2 ++ installhelper.py | 2 ++ setup.py | 2 ++ tests/blockchain/config.py | 2 ++ tests/build-job-matrix.py | 2 ++ tests/check_pytest_monitor_output.py | 2 ++ tests/check_sql_statements.py | 2 ++ tests/clvm/config.py | 2 ++ tests/clvm/test_clvm_step.py | 2 ++ tests/clvm/test_curry_and_treehash.py | 2 ++ tests/clvm/test_puzzle_drivers.py | 2 ++ tests/clvm/test_puzzles.py | 2 ++ tests/connection_utils.py | 2 ++ tests/core/cmds/config.py | 2 ++ tests/core/cmds/test_beta.py | 2 ++ tests/core/cmds/test_wallet.py | 2 ++ tests/core/config.py | 2 ++ tests/core/consensus/config.py | 2 ++ tests/core/consensus/test_pot_iterations.py | 2 ++ tests/core/custom_types/config.py | 2 ++ tests/core/custom_types/test_proof_of_space.py | 2 ++ tests/core/daemon/config.py | 2 ++ tests/core/data_layer/config.py | 2 ++ tests/core/data_layer/conftest.py | 2 ++ tests/core/data_layer/test_data_cli.py | 2 ++ tests/core/data_layer/test_data_layer_util.py | 2 ++ tests/core/data_layer/test_data_store.py | 2 ++ tests/core/data_layer/test_data_store_schema.py | 2 ++ tests/core/data_layer/util.py | 2 ++ tests/core/full_node/config.py | 2 ++ tests/core/full_node/conftest.py | 2 ++ tests/core/full_node/dos/config.py | 2 ++ tests/core/full_node/full_sync/config.py | 2 ++ tests/core/full_node/stores/config.py | 2 ++ tests/core/full_node/stores/test_sync_store.py | 2 ++ tests/core/full_node/test_address_manager.py | 2 ++ tests/core/full_node/test_generator_tools.py | 2 ++ tests/core/full_node/test_hint_management.py | 2 ++ tests/core/full_node/test_node_load.py | 2 ++ tests/core/full_node/test_peer_store_resolver.py | 2 ++ tests/core/full_node/test_transactions.py | 2 ++ tests/core/large_block.py | 2 ++ tests/core/make_block_generator.py | 2 ++ tests/core/node_height.py | 3 +++ tests/core/server/config.py | 2 ++ tests/core/ssl/config.py | 2 ++ tests/core/test_coins.py | 2 ++ tests/core/test_cost_calculation.py | 2 ++ tests/core/test_crawler_rpc.py | 2 ++ tests/core/test_db_validation.py | 2 ++ tests/core/test_farmer_harvester_rpc.py | 2 ++ tests/core/test_merkle_set.py | 2 ++ tests/core/test_setproctitle.py | 2 ++ tests/core/util/config.py | 2 ++ tests/core/util/test_jsonify.py | 2 ++ tests/core/util/test_lockfile.py | 2 ++ tests/core/util/test_lru_cache.py | 2 ++ tests/core/util/test_significant_bits.py | 2 ++ tests/db/test_db_wrapper.py | 2 ++ tests/farmer_harvester/config.py | 2 ++ tests/farmer_harvester/test_farmer_harvester.py | 2 ++ tests/generator/config.py | 2 ++ tests/plot_sync/config.py | 2 ++ tests/plot_sync/test_delta.py | 2 ++ tests/plot_sync/test_plot_sync.py | 2 ++ tests/plot_sync/test_receiver.py | 2 ++ tests/plot_sync/test_sender.py | 2 ++ tests/plot_sync/test_sync_simulated.py | 2 ++ tests/plot_sync/util.py | 2 ++ tests/plotting/config.py | 2 ++ tests/plotting/test_plot_manager.py | 2 ++ tests/plotting/util.py | 2 ++ tests/pools/config.py | 2 ++ tests/pools/test_pool_wallet.py | 2 ++ tests/setup_services.py | 2 ++ tests/simulation/config.py | 2 ++ tests/simulation/test_start_simulator.py | 2 ++ tests/tools/config.py | 2 ++ tests/tools/test_full_sync.py | 2 ++ tests/tools/test_run_block.py | 2 ++ tests/util/alert_server.py | 2 ++ tests/util/config.py | 2 ++ tests/util/gen_ssl_certs.py | 2 ++ tests/util/generator_tools_testing.py | 2 ++ tests/util/protocol_messages_json.py | 2 ++ tests/util/rpc.py | 2 ++ tests/util/temp_file.py | 2 ++ tests/util/test_chunks.py | 2 ++ tests/util/test_full_block_utils.py | 2 ++ tests/util/test_network_protocol_json.py | 2 ++ tests/util/test_network_protocol_test.py | 2 ++ tests/util/test_paginator.py | 2 ++ tests/util/wallet_is_synced.py | 2 ++ tests/wallet/cat_wallet/config.py | 2 ++ tests/wallet/cat_wallet/test_cat_outer_puzzle.py | 2 ++ tests/wallet/cat_wallet/test_trades.py | 2 ++ tests/wallet/config.py | 2 ++ tests/wallet/db_wallet/config.py | 2 ++ tests/wallet/db_wallet/test_db_graftroot.py | 2 ++ tests/wallet/db_wallet/test_dl_offers.py | 2 ++ tests/wallet/db_wallet/test_dl_wallet.py | 2 ++ tests/wallet/did_wallet/config.py | 2 ++ tests/wallet/nft_wallet/config.py | 2 ++ tests/wallet/nft_wallet/test_nft_1_offers.py | 2 ++ tests/wallet/nft_wallet/test_nft_bulk_mint.py | 2 ++ tests/wallet/nft_wallet/test_nft_lifecycle.py | 2 ++ tests/wallet/nft_wallet/test_nft_off_chain.py | 2 ++ tests/wallet/nft_wallet/test_nft_offers.py | 2 ++ tests/wallet/nft_wallet/test_nft_puzzles.py | 2 ++ tests/wallet/nft_wallet/test_nft_wallet.py | 2 ++ tests/wallet/nft_wallet/test_ownership_outer_puzzle.py | 2 ++ tests/wallet/rpc/config.py | 2 ++ tests/wallet/rpc/test_dl_wallet_rpc.py | 2 ++ tests/wallet/rpc/test_wallet_rpc.py | 2 ++ tests/wallet/simple_sync/config.py | 2 ++ tests/wallet/sync/config.py | 2 ++ tests/wallet/sync/test_wallet_sync.py | 2 ++ tests/wallet/test_address_type.py | 2 ++ tests/wallet/test_bech32m.py | 2 ++ tests/wallet/test_chialisp.py | 2 ++ tests/wallet/test_coin_selection.py | 2 ++ tests/wallet/test_nft_store.py | 2 ++ tests/wallet/test_notifications.py | 2 ++ tests/wallet/test_offer_parsing_performance.py | 2 ++ tests/wallet/test_puzzle_store.py | 2 ++ tests/wallet/test_taproot.py | 2 ++ tests/wallet/test_transaction_store.py | 2 ++ tests/wallet/test_wallet_coin_store.py | 2 ++ tests/wallet/test_wallet_node.py | 2 ++ tests/wallet/test_wallet_retry.py | 2 ++ tests/wallet/test_wallet_trade_store.py | 2 ++ tests/wallet/test_wallet_user_store.py | 2 ++ tests/weight_proof/config.py | 2 ++ tools/cpu_utilization.py | 2 ++ tools/generate_chain.py | 2 ++ tools/run_block.py | 2 ++ tools/test_constants.py | 2 ++ tools/test_full_sync.py | 2 ++ 386 files changed, 776 insertions(+) diff --git a/.isort.cfg b/.isort.cfg index d0b1383ff5..d854c28ad0 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -2,6 +2,7 @@ line_length = 120 profile=black skip_gitignore=true +add_imports=from __future__ import annotations # venv/bin/isort --check . |& sed -n "s;ERROR: ${PWD}/\(.*\) Imports are.*; \1;p" | sort | uniq extend_skip= chia/clvm/spend_sim.py diff --git a/activated.py b/activated.py index 59c1710527..4ee076c235 100755 --- a/activated.py +++ b/activated.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +from __future__ import annotations + import os import pathlib import subprocess diff --git a/benchmarks/block_ref.py b/benchmarks/block_ref.py index f7a505de98..00968c8adc 100644 --- a/benchmarks/block_ref.py +++ b/benchmarks/block_ref.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import os import random diff --git a/benchmarks/block_store.py b/benchmarks/block_store.py index 0b21ba2a7e..1a63049302 100644 --- a/benchmarks/block_store.py +++ b/benchmarks/block_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import os import random diff --git a/benchmarks/coin_store.py b/benchmarks/coin_store.py index 165fd11321..3591bd1f83 100644 --- a/benchmarks/coin_store.py +++ b/benchmarks/coin_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import os import random diff --git a/benchmarks/jsonify.py b/benchmarks/jsonify.py index d53679990e..a96244777e 100644 --- a/benchmarks/jsonify.py +++ b/benchmarks/jsonify.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import random from time import perf_counter diff --git a/benchmarks/mempool.py b/benchmarks/mempool.py index 52643fc833..ca4bd79bbc 100644 --- a/benchmarks/mempool.py +++ b/benchmarks/mempool.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import cProfile from contextlib import contextmanager diff --git a/benchmarks/streamable.py b/benchmarks/streamable.py index d940a421a6..b3fb6829a5 100644 --- a/benchmarks/streamable.py +++ b/benchmarks/streamable.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import json import sys from dataclasses import dataclass diff --git a/benchmarks/utils.py b/benchmarks/utils.py index 2f9b8481fa..75e19ade94 100644 --- a/benchmarks/utils.py +++ b/benchmarks/utils.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import os import random import subprocess diff --git a/build_scripts/check_dependency_artifacts.py b/build_scripts/check_dependency_artifacts.py index 07fe57b834..d02d7db5bc 100644 --- a/build_scripts/check_dependency_artifacts.py +++ b/build_scripts/check_dependency_artifacts.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import os import pathlib import platform diff --git a/build_scripts/installer-version.py b/build_scripts/installer-version.py index 3aa06a2f48..2ac07153d1 100644 --- a/build_scripts/installer-version.py +++ b/build_scripts/installer-version.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools_scm import get_version diff --git a/chia/__init__.py b/chia/__init__.py index c136c9c3d6..373e0aaebf 100644 --- a/chia/__init__.py +++ b/chia/__init__.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pkg_resources import DistributionNotFound, get_distribution, resource_filename try: diff --git a/chia/clvm/singleton.py b/chia/clvm/singleton.py index fae8019656..3a1419de64 100644 --- a/chia/clvm/singleton.py +++ b/chia/clvm/singleton.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile P2_SINGLETON_MOD = load_clvm_maybe_recompile("p2_singleton.clvm") diff --git a/chia/cmds/beta.py b/chia/cmds/beta.py index 7ab53feaf1..0750058209 100644 --- a/chia/cmds/beta.py +++ b/chia/cmds/beta.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import zipfile from datetime import datetime from pathlib import Path diff --git a/chia/cmds/beta_funcs.py b/chia/cmds/beta_funcs.py index f5f629f8c2..24e1354c9a 100644 --- a/chia/cmds/beta_funcs.py +++ b/chia/cmds/beta_funcs.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import os import sys from pathlib import Path diff --git a/chia/cmds/cmds_util.py b/chia/cmds/cmds_util.py index 621d276e61..9ef9a2ce57 100644 --- a/chia/cmds/cmds_util.py +++ b/chia/cmds/cmds_util.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from contextlib import asynccontextmanager from pathlib import Path from typing import Any, AsyncIterator, Awaitable, Callable, Dict, Optional, Tuple, Type diff --git a/chia/cmds/configure.py b/chia/cmds/configure.py index e97701610d..91aa04b0cc 100644 --- a/chia/cmds/configure.py +++ b/chia/cmds/configure.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path from typing import Optional diff --git a/chia/cmds/data.py b/chia/cmds/data.py index bcd433d926..dfa9ccf3ab 100644 --- a/chia/cmds/data.py +++ b/chia/cmds/data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import json import logging from pathlib import Path diff --git a/chia/cmds/data_funcs.py b/chia/cmds/data_funcs.py index 2abee122cb..aee8f4eb02 100644 --- a/chia/cmds/data_funcs.py +++ b/chia/cmds/data_funcs.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from decimal import Decimal from pathlib import Path from types import TracebackType diff --git a/chia/cmds/db_backup_func.py b/chia/cmds/db_backup_func.py index 7039c95852..d63c12bece 100644 --- a/chia/cmds/db_backup_func.py +++ b/chia/cmds/db_backup_func.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path from typing import Any, Dict, Optional diff --git a/chia/cmds/db_validate_func.py b/chia/cmds/db_validate_func.py index d5d3bdb367..0d310345ad 100644 --- a/chia/cmds/db_validate_func.py +++ b/chia/cmds/db_validate_func.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path from typing import Any, Dict, Optional diff --git a/chia/cmds/netspace_funcs.py b/chia/cmds/netspace_funcs.py index 6ecba76b33..7c76ad388d 100644 --- a/chia/cmds/netspace_funcs.py +++ b/chia/cmds/netspace_funcs.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Optional from chia.cmds.cmds_util import get_any_service_client diff --git a/chia/cmds/peer.py b/chia/cmds/peer.py index d35d7fe444..c636635da9 100644 --- a/chia/cmds/peer.py +++ b/chia/cmds/peer.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Optional import click diff --git a/chia/cmds/peer_funcs.py b/chia/cmds/peer_funcs.py index acef3d928c..963bf51b7b 100644 --- a/chia/cmds/peer_funcs.py +++ b/chia/cmds/peer_funcs.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path from typing import Any, Dict, Optional diff --git a/chia/cmds/plots.py b/chia/cmds/plots.py index 6c772812ec..56778c0db9 100644 --- a/chia/cmds/plots.py +++ b/chia/cmds/plots.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import logging import sys diff --git a/chia/cmds/rpc.py b/chia/cmds/rpc.py index df0231b4fa..541980b38c 100644 --- a/chia/cmds/rpc.py +++ b/chia/cmds/rpc.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import json import sys diff --git a/chia/cmds/show_funcs.py b/chia/cmds/show_funcs.py index 8a9166eea4..aa5b4af046 100644 --- a/chia/cmds/show_funcs.py +++ b/chia/cmds/show_funcs.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path from typing import Any, Dict, List, Optional, Union diff --git a/chia/cmds/stop.py b/chia/cmds/stop.py index 3316e53207..55962ee221 100644 --- a/chia/cmds/stop.py +++ b/chia/cmds/stop.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import sys from pathlib import Path diff --git a/chia/cmds/units.py b/chia/cmds/units.py index 1365acc9cc..d352d4813b 100644 --- a/chia/cmds/units.py +++ b/chia/cmds/units.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict # The rest of the codebase uses mojos everywhere. diff --git a/chia/consensus/block_body_validation.py b/chia/consensus/block_body_validation.py index c4de8a0e13..9bf0b1e639 100644 --- a/chia/consensus/block_body_validation.py +++ b/chia/consensus/block_body_validation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import collections import logging from typing import Awaitable, Callable, Dict, List, Optional, Set, Tuple, Union diff --git a/chia/consensus/block_creation.py b/chia/consensus/block_creation.py index 225298f80c..b31951d623 100644 --- a/chia/consensus/block_creation.py +++ b/chia/consensus/block_creation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import random from dataclasses import replace diff --git a/chia/consensus/block_header_validation.py b/chia/consensus/block_header_validation.py index ee9974a431..ee187f241e 100644 --- a/chia/consensus/block_header_validation.py +++ b/chia/consensus/block_header_validation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses import logging import time diff --git a/chia/consensus/block_record.py b/chia/consensus/block_record.py index 0f75d90b16..e132179f34 100644 --- a/chia/consensus/block_record.py +++ b/chia/consensus/block_record.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List, Optional diff --git a/chia/consensus/block_rewards.py b/chia/consensus/block_rewards.py index b2c21bb92b..17dd028bac 100644 --- a/chia/consensus/block_rewards.py +++ b/chia/consensus/block_rewards.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.util.ints import uint32, uint64 # 1 Chia coin = 1,000,000,000,000 = 1 trillion mojo. diff --git a/chia/consensus/block_root_validation.py b/chia/consensus/block_root_validation.py index a2fe150108..a4815419f6 100644 --- a/chia/consensus/block_root_validation.py +++ b/chia/consensus/block_root_validation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, List, Optional, Tuple from chia_rs import compute_merkle_set_root diff --git a/chia/consensus/blockchain.py b/chia/consensus/blockchain.py index fe9b521b91..ce90f60abc 100644 --- a/chia/consensus/blockchain.py +++ b/chia/consensus/blockchain.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import dataclasses import logging diff --git a/chia/consensus/blockchain_interface.py b/chia/consensus/blockchain_interface.py index bbb2524bca..0a44bcf665 100644 --- a/chia/consensus/blockchain_interface.py +++ b/chia/consensus/blockchain_interface.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, List, Optional from chia.consensus.block_record import BlockRecord diff --git a/chia/consensus/coinbase.py b/chia/consensus/coinbase.py index 5a562af8be..4828b2de15 100644 --- a/chia/consensus/coinbase.py +++ b/chia/consensus/coinbase.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from blspy import G1Element from chia.types.blockchain_format.coin import Coin diff --git a/chia/consensus/condition_costs.py b/chia/consensus/condition_costs.py index 3a58eee774..2eaef0508c 100644 --- a/chia/consensus/condition_costs.py +++ b/chia/consensus/condition_costs.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from enum import Enum diff --git a/chia/consensus/constants.py b/chia/consensus/constants.py index 349c09c2be..14715687ab 100644 --- a/chia/consensus/constants.py +++ b/chia/consensus/constants.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses import logging from typing import Any diff --git a/chia/consensus/cost_calculator.py b/chia/consensus/cost_calculator.py index 34577a82cb..468c7f3763 100644 --- a/chia/consensus/cost_calculator.py +++ b/chia/consensus/cost_calculator.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional diff --git a/chia/consensus/default_constants.py b/chia/consensus/default_constants.py index 898c2b3e1a..57b5adb591 100644 --- a/chia/consensus/default_constants.py +++ b/chia/consensus/default_constants.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.util.ints import uint64 from .constants import ConsensusConstants diff --git a/chia/consensus/deficit.py b/chia/consensus/deficit.py index bd4dc4fd69..050dbcf33f 100644 --- a/chia/consensus/deficit.py +++ b/chia/consensus/deficit.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Optional from chia.consensus.block_record import BlockRecord diff --git a/chia/consensus/difficulty_adjustment.py b/chia/consensus/difficulty_adjustment.py index 5db520feed..8c91fcf88b 100644 --- a/chia/consensus/difficulty_adjustment.py +++ b/chia/consensus/difficulty_adjustment.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import List, Optional, Tuple from chia.consensus.block_record import BlockRecord diff --git a/chia/consensus/find_fork_point.py b/chia/consensus/find_fork_point.py index 4f2d08f50c..1dc233c15a 100644 --- a/chia/consensus/find_fork_point.py +++ b/chia/consensus/find_fork_point.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Union from chia.consensus.block_record import BlockRecord diff --git a/chia/consensus/full_block_to_block_record.py b/chia/consensus/full_block_to_block_record.py index cabe631ff2..b817e5d8d4 100644 --- a/chia/consensus/full_block_to_block_record.py +++ b/chia/consensus/full_block_to_block_record.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import List, Optional, Union from chia.consensus.block_record import BlockRecord diff --git a/chia/consensus/get_block_challenge.py b/chia/consensus/get_block_challenge.py index 2585086263..f3ac1f84c5 100644 --- a/chia/consensus/get_block_challenge.py +++ b/chia/consensus/get_block_challenge.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from typing import List, Union diff --git a/chia/consensus/make_sub_epoch_summary.py b/chia/consensus/make_sub_epoch_summary.py index 393767cd3f..09e7d072df 100644 --- a/chia/consensus/make_sub_epoch_summary.py +++ b/chia/consensus/make_sub_epoch_summary.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from typing import Optional, Union diff --git a/chia/consensus/multiprocess_validation.py b/chia/consensus/multiprocess_validation.py index 44d663a74f..b4d1fa9bc7 100644 --- a/chia/consensus/multiprocess_validation.py +++ b/chia/consensus/multiprocess_validation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import logging import traceback diff --git a/chia/consensus/pos_quality.py b/chia/consensus/pos_quality.py index 6e4ef84776..cc0678e44f 100644 --- a/chia/consensus/pos_quality.py +++ b/chia/consensus/pos_quality.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.util.ints import uint64 # The actual space in bytes of a plot, is _expected_plot_size(k) * UI_ACTUAL_SPACE_CONSTANT_FACTO diff --git a/chia/consensus/pot_iterations.py b/chia/consensus/pot_iterations.py index 31576dbdba..0aee32f522 100644 --- a/chia/consensus/pot_iterations.py +++ b/chia/consensus/pot_iterations.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.consensus.constants import ConsensusConstants from chia.consensus.pos_quality import _expected_plot_size from chia.types.blockchain_format.sized_bytes import bytes32 diff --git a/chia/consensus/vdf_info_computation.py b/chia/consensus/vdf_info_computation.py index 77408aa0c5..915d863c2f 100644 --- a/chia/consensus/vdf_info_computation.py +++ b/chia/consensus/vdf_info_computation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import List, Optional, Tuple from chia.consensus.block_record import BlockRecord diff --git a/chia/daemon/client.py b/chia/daemon/client.py index 68cc2d1900..99df01a12e 100644 --- a/chia/daemon/client.py +++ b/chia/daemon/client.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import json import ssl diff --git a/chia/daemon/windows_signal.py b/chia/daemon/windows_signal.py index fca663914a..67f8789e6a 100644 --- a/chia/daemon/windows_signal.py +++ b/chia/daemon/windows_signal.py @@ -3,6 +3,8 @@ Code taken from Stack Overflow Eryk Sun. https://stackoverflow.com/questions/35772001/how-to-handle-the-signal-in-python-on-windows-machine """ +from __future__ import annotations + import os import signal import sys diff --git a/chia/data_layer/data_layer.py b/chia/data_layer/data_layer.py index 345da5971b..d8b72b9723 100644 --- a/chia/data_layer/data_layer.py +++ b/chia/data_layer/data_layer.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import logging import random diff --git a/chia/data_layer/data_layer_api.py b/chia/data_layer/data_layer_api.py index 63f7e5b628..adbeaafa64 100644 --- a/chia/data_layer/data_layer_api.py +++ b/chia/data_layer/data_layer_api.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from chia.data_layer.data_layer import DataLayer diff --git a/chia/data_layer/data_layer_errors.py b/chia/data_layer/data_layer_errors.py index 3d5302dac6..b7bb9c9807 100644 --- a/chia/data_layer/data_layer_errors.py +++ b/chia/data_layer/data_layer_errors.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Iterable, List from chia.types.blockchain_format.sized_bytes import bytes32 diff --git a/chia/data_layer/data_layer_server.py b/chia/data_layer/data_layer_server.py index f623efd7c0..ce4c3d3240 100644 --- a/chia/data_layer/data_layer_server.py +++ b/chia/data_layer/data_layer_server.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import functools import logging diff --git a/chia/data_layer/data_store.py b/chia/data_layer/data_store.py index db616ddf34..5b801d39e8 100644 --- a/chia/data_layer/data_store.py +++ b/chia/data_layer/data_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from collections import defaultdict from contextlib import asynccontextmanager diff --git a/chia/data_layer/dl_wallet_store.py b/chia/data_layer/dl_wallet_store.py index be011f74ed..5a615506ba 100644 --- a/chia/data_layer/dl_wallet_store.py +++ b/chia/data_layer/dl_wallet_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses from typing import List, Optional, Type, TypeVar, Union diff --git a/chia/data_layer/download_data.py b/chia/data_layer/download_data.py index 26888704aa..b5f88053c8 100644 --- a/chia/data_layer/download_data.py +++ b/chia/data_layer/download_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import logging import os diff --git a/chia/data_layer/util/benchmark.py b/chia/data_layer/util/benchmark.py index 0c705c6b8d..9427e9868c 100644 --- a/chia/data_layer/util/benchmark.py +++ b/chia/data_layer/util/benchmark.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import os import sys diff --git a/chia/farmer/farmer.py b/chia/farmer/farmer.py index 49471c88a5..a3cf2df664 100644 --- a/chia/farmer/farmer.py +++ b/chia/farmer/farmer.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import json import logging diff --git a/chia/farmer/farmer_api.py b/chia/farmer/farmer_api.py index e1e646dcff..704eb19256 100644 --- a/chia/farmer/farmer_api.py +++ b/chia/farmer/farmer_api.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import json import time from typing import Any, Dict, List, Optional, Tuple diff --git a/chia/full_node/hint_management.py b/chia/full_node/hint_management.py index f13d6cc56a..261fb4b532 100644 --- a/chia/full_node/hint_management.py +++ b/chia/full_node/hint_management.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, List, Optional, Set, Tuple from chia.consensus.blockchain import StateChangeSummary diff --git a/chia/full_node/mempool.py b/chia/full_node/mempool.py index 670ed07f96..b67c14b943 100644 --- a/chia/full_node/mempool.py +++ b/chia/full_node/mempool.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, List, Optional from sortedcontainers import SortedDict diff --git a/chia/full_node/pending_tx_cache.py b/chia/full_node/pending_tx_cache.py index 52f50f8260..1e84fa72e6 100644 --- a/chia/full_node/pending_tx_cache.py +++ b/chia/full_node/pending_tx_cache.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict from chia.types.blockchain_format.sized_bytes import bytes32 diff --git a/chia/full_node/signage_point.py b/chia/full_node/signage_point.py index 9230d6f3f3..31c0789ef6 100644 --- a/chia/full_node/signage_point.py +++ b/chia/full_node/signage_point.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional diff --git a/chia/harvester/harvester.py b/chia/harvester/harvester.py index 9e9559c5fa..c2c93083d0 100644 --- a/chia/harvester/harvester.py +++ b/chia/harvester/harvester.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import concurrent import dataclasses diff --git a/chia/harvester/harvester_api.py b/chia/harvester/harvester_api.py index 01e6a6633d..9cceb00c7e 100644 --- a/chia/harvester/harvester_api.py +++ b/chia/harvester/harvester_api.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import time from pathlib import Path diff --git a/chia/introducer/introducer_api.py b/chia/introducer/introducer_api.py index ec6e92a3b7..13c171bee5 100644 --- a/chia/introducer/introducer_api.py +++ b/chia/introducer/introducer_api.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Callable, Optional from chia.introducer.introducer import Introducer diff --git a/chia/plot_sync/delta.py b/chia/plot_sync/delta.py index d94ecec877..ec0295b7ce 100644 --- a/chia/plot_sync/delta.py +++ b/chia/plot_sync/delta.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass, field from typing import Dict, List, Union diff --git a/chia/plot_sync/exceptions.py b/chia/plot_sync/exceptions.py index e972a2a293..dce1bd1fb4 100644 --- a/chia/plot_sync/exceptions.py +++ b/chia/plot_sync/exceptions.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any from chia.plot_sync.util import ErrorCodes, State diff --git a/chia/plot_sync/receiver.py b/chia/plot_sync/receiver.py index 2c35ce5d04..f5eea1260a 100644 --- a/chia/plot_sync/receiver.py +++ b/chia/plot_sync/receiver.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import time from dataclasses import dataclass, field diff --git a/chia/plot_sync/util.py b/chia/plot_sync/util.py index ad21dbd56b..25221ea2d9 100644 --- a/chia/plot_sync/util.py +++ b/chia/plot_sync/util.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from enum import IntEnum from typing import TypeVar diff --git a/chia/plotters/plotters_util.py b/chia/plotters/plotters_util.py index 4ec36876fc..cdd9da4324 100644 --- a/chia/plotters/plotters_util.py +++ b/chia/plotters/plotters_util.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import contextlib import json diff --git a/chia/plotting/cache.py b/chia/plotting/cache.py index 1d625fc7c8..df5046c415 100644 --- a/chia/plotting/cache.py +++ b/chia/plotting/cache.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import time import traceback diff --git a/chia/plotting/check_plots.py b/chia/plotting/check_plots.py index fd503a6e34..e2b7cef353 100644 --- a/chia/plotting/check_plots.py +++ b/chia/plotting/check_plots.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from collections import Counter from pathlib import Path diff --git a/chia/plotting/create_plots.py b/chia/plotting/create_plots.py index 4206fb2f91..4e0de32876 100644 --- a/chia/plotting/create_plots.py +++ b/chia/plotting/create_plots.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from datetime import datetime from pathlib import Path diff --git a/chia/plotting/manager.py b/chia/plotting/manager.py index 96a883ec71..7620852be6 100644 --- a/chia/plotting/manager.py +++ b/chia/plotting/manager.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import threading import time diff --git a/chia/plotting/util.py b/chia/plotting/util.py index e453e3b577..2c02b9678d 100644 --- a/chia/plotting/util.py +++ b/chia/plotting/util.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from dataclasses import dataclass, field from enum import Enum diff --git a/chia/pools/pool_config.py b/chia/pools/pool_config.py index cc4519169a..48477e32ef 100644 --- a/chia/pools/pool_config.py +++ b/chia/pools/pool_config.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from dataclasses import dataclass from pathlib import Path diff --git a/chia/protocols/farmer_protocol.py b/chia/protocols/farmer_protocol.py index e60a421d16..5bd401e3ab 100644 --- a/chia/protocols/farmer_protocol.py +++ b/chia/protocols/farmer_protocol.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional diff --git a/chia/protocols/full_node_protocol.py b/chia/protocols/full_node_protocol.py index 793dabbe94..c9baf051f0 100644 --- a/chia/protocols/full_node_protocol.py +++ b/chia/protocols/full_node_protocol.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List, Optional diff --git a/chia/protocols/harvester_protocol.py b/chia/protocols/harvester_protocol.py index bc4f5da8a4..e130839c1d 100644 --- a/chia/protocols/harvester_protocol.py +++ b/chia/protocols/harvester_protocol.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List, Optional, Tuple diff --git a/chia/protocols/introducer_protocol.py b/chia/protocols/introducer_protocol.py index e9eeab9978..2247bcb240 100644 --- a/chia/protocols/introducer_protocol.py +++ b/chia/protocols/introducer_protocol.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List diff --git a/chia/protocols/protocol_message_types.py b/chia/protocols/protocol_message_types.py index e8b6bf7603..e32fbae3de 100644 --- a/chia/protocols/protocol_message_types.py +++ b/chia/protocols/protocol_message_types.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from enum import Enum diff --git a/chia/protocols/protocol_timing.py b/chia/protocols/protocol_timing.py index 7a9bfa6b65..4c08560d31 100644 --- a/chia/protocols/protocol_timing.py +++ b/chia/protocols/protocol_timing.py @@ -1,4 +1,6 @@ # These settings should not be end-user configurable +from __future__ import annotations + INVALID_PROTOCOL_BAN_SECONDS = 10 API_EXCEPTION_BAN_SECONDS = 10 INTERNAL_PROTOCOL_ERROR_BAN_SECONDS = 10 # Don't flap if our client is at fault diff --git a/chia/protocols/shared_protocol.py b/chia/protocols/shared_protocol.py index fe68018ae0..d192e163c6 100644 --- a/chia/protocols/shared_protocol.py +++ b/chia/protocols/shared_protocol.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from enum import IntEnum from typing import List, Tuple diff --git a/chia/protocols/timelord_protocol.py b/chia/protocols/timelord_protocol.py index 6db1c32e8d..48dbfab408 100644 --- a/chia/protocols/timelord_protocol.py +++ b/chia/protocols/timelord_protocol.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List, Optional, Tuple diff --git a/chia/protocols/wallet_protocol.py b/chia/protocols/wallet_protocol.py index 0cdd550d8a..8962754485 100644 --- a/chia/protocols/wallet_protocol.py +++ b/chia/protocols/wallet_protocol.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List, Optional, Tuple diff --git a/chia/rpc/crawler_rpc_api.py b/chia/rpc/crawler_rpc_api.py index c1c9a8c772..6a96dec50c 100644 --- a/chia/rpc/crawler_rpc_api.py +++ b/chia/rpc/crawler_rpc_api.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import ipaddress from typing import Any, Dict, List, Optional diff --git a/chia/rpc/data_layer_rpc_client.py b/chia/rpc/data_layer_rpc_client.py index 3cf443d33d..d365337ea0 100644 --- a/chia/rpc/data_layer_rpc_client.py +++ b/chia/rpc/data_layer_rpc_client.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path from typing import Any, Dict, List, Optional diff --git a/chia/rpc/data_layer_rpc_util.py b/chia/rpc/data_layer_rpc_util.py index 67f8ff0752..d904fa08e3 100644 --- a/chia/rpc/data_layer_rpc_util.py +++ b/chia/rpc/data_layer_rpc_util.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any, Dict, Type, TypeVar from typing_extensions import Protocol diff --git a/chia/rpc/farmer_rpc_api.py b/chia/rpc/farmer_rpc_api.py index d036fe38f3..d2afd05c19 100644 --- a/chia/rpc/farmer_rpc_api.py +++ b/chia/rpc/farmer_rpc_api.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses import operator from typing import Any, Callable, Dict, List, Optional diff --git a/chia/rpc/farmer_rpc_client.py b/chia/rpc/farmer_rpc_client.py index 26bb9e0c24..fdd7a31bb6 100644 --- a/chia/rpc/farmer_rpc_client.py +++ b/chia/rpc/farmer_rpc_client.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any, Dict, List, Optional from chia.rpc.farmer_rpc_api import PlotInfoRequestData, PlotPathRequestData diff --git a/chia/rpc/full_node_rpc_api.py b/chia/rpc/full_node_rpc_api.py index adb674723a..f2329f8d8f 100644 --- a/chia/rpc/full_node_rpc_api.py +++ b/chia/rpc/full_node_rpc_api.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any, Dict, List, Optional from clvm.casts import int_from_bytes diff --git a/chia/rpc/harvester_rpc_api.py b/chia/rpc/harvester_rpc_api.py index 0853fd3263..ac42ac8822 100644 --- a/chia/rpc/harvester_rpc_api.py +++ b/chia/rpc/harvester_rpc_api.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any, Dict, List from chia.harvester.harvester import Harvester diff --git a/chia/rpc/harvester_rpc_client.py b/chia/rpc/harvester_rpc_client.py index 3a27a43b39..2c542ed87c 100644 --- a/chia/rpc/harvester_rpc_client.py +++ b/chia/rpc/harvester_rpc_client.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any, Dict, List from chia.rpc.rpc_client import RpcClient diff --git a/chia/rpc/timelord_rpc_api.py b/chia/rpc/timelord_rpc_api.py index ad38d11f76..20ad636817 100644 --- a/chia/rpc/timelord_rpc_api.py +++ b/chia/rpc/timelord_rpc_api.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any, Dict, List, Optional from chia.rpc.rpc_server import Endpoint diff --git a/chia/rpc/util.py b/chia/rpc/util.py index d1e2248caa..ce52938012 100644 --- a/chia/rpc/util.py +++ b/chia/rpc/util.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import traceback from typing import Callable diff --git a/chia/seeder/crawler_api.py b/chia/seeder/crawler_api.py index 666aeb18ba..c59d3b6383 100644 --- a/chia/seeder/crawler_api.py +++ b/chia/seeder/crawler_api.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Optional import chia.server.ws_connection as ws diff --git a/chia/seeder/peer_record.py b/chia/seeder/peer_record.py index 2a6f8dde48..dea9053387 100644 --- a/chia/seeder/peer_record.py +++ b/chia/seeder/peer_record.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import math import time from dataclasses import dataclass diff --git a/chia/seeder/start_crawler.py b/chia/seeder/start_crawler.py index c8338d984c..4bcec3f176 100644 --- a/chia/seeder/start_crawler.py +++ b/chia/seeder/start_crawler.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import pathlib import sys diff --git a/chia/server/address_manager.py b/chia/server/address_manager.py index 3288978db9..63ae962253 100644 --- a/chia/server/address_manager.py +++ b/chia/server/address_manager.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import math import time diff --git a/chia/server/connection_utils.py b/chia/server/connection_utils.py index 72cc7c843b..5b270fd1c1 100644 --- a/chia/server/connection_utils.py +++ b/chia/server/connection_utils.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import random from typing import Any, List, Optional, Tuple diff --git a/chia/server/outbound_message.py b/chia/server/outbound_message.py index d844d348d4..1cde0f0a06 100644 --- a/chia/server/outbound_message.py +++ b/chia/server/outbound_message.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from enum import IntEnum from typing import Optional, SupportsBytes, Union diff --git a/chia/server/rate_limit_numbers.py b/chia/server/rate_limit_numbers.py index 9ed9dde214..fb8b677693 100644 --- a/chia/server/rate_limit_numbers.py +++ b/chia/server/rate_limit_numbers.py @@ -1,4 +1,6 @@ # All of these rate limits scale with the number of transactions so the aggregate amounts are higher +from __future__ import annotations + import copy import dataclasses import functools diff --git a/chia/server/rate_limits.py b/chia/server/rate_limits.py index b40b1a7b28..1b2ab6cde5 100644 --- a/chia/server/rate_limits.py +++ b/chia/server/rate_limits.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses import logging import time diff --git a/chia/server/server.py b/chia/server/server.py index 29e6c8e73f..b6342ce812 100644 --- a/chia/server/server.py +++ b/chia/server/server.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import logging import ssl diff --git a/chia/server/ssl_context.py b/chia/server/ssl_context.py index 282b796590..4491615e3b 100644 --- a/chia/server/ssl_context.py +++ b/chia/server/ssl_context.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path from typing import Dict diff --git a/chia/server/start_data_layer.py b/chia/server/start_data_layer.py index 11261d5288..007edb244a 100644 --- a/chia/server/start_data_layer.py +++ b/chia/server/start_data_layer.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import pathlib import sys diff --git a/chia/server/start_farmer.py b/chia/server/start_farmer.py index 4944de58e3..d75cd013be 100644 --- a/chia/server/start_farmer.py +++ b/chia/server/start_farmer.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pathlib import sys from typing import Dict, Optional diff --git a/chia/server/start_full_node.py b/chia/server/start_full_node.py index 197a2f75ad..6a07dd611d 100644 --- a/chia/server/start_full_node.py +++ b/chia/server/start_full_node.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import os import pathlib diff --git a/chia/server/start_harvester.py b/chia/server/start_harvester.py index 66ccd421f9..064319c1bf 100644 --- a/chia/server/start_harvester.py +++ b/chia/server/start_harvester.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pathlib import sys from typing import Dict, Optional diff --git a/chia/server/start_introducer.py b/chia/server/start_introducer.py index d8d472881a..da6b2c596d 100644 --- a/chia/server/start_introducer.py +++ b/chia/server/start_introducer.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pathlib import sys from typing import Dict, Optional diff --git a/chia/server/start_timelord.py b/chia/server/start_timelord.py index ce77712f6a..94b11da021 100644 --- a/chia/server/start_timelord.py +++ b/chia/server/start_timelord.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import pathlib import sys diff --git a/chia/server/ws_connection.py b/chia/server/ws_connection.py index 7073f30303..cb1be23ea4 100644 --- a/chia/server/ws_connection.py +++ b/chia/server/ws_connection.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import contextlib import logging diff --git a/chia/simulator/block_tools.py b/chia/simulator/block_tools.py index e6f7a4ef48..f71e517c01 100644 --- a/chia/simulator/block_tools.py +++ b/chia/simulator/block_tools.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import copy import logging diff --git a/chia/simulator/full_node_simulator.py b/chia/simulator/full_node_simulator.py index dd069ad17d..007a1cd3dc 100644 --- a/chia/simulator/full_node_simulator.py +++ b/chia/simulator/full_node_simulator.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import itertools import time diff --git a/chia/simulator/simulator_full_node_rpc_api.py b/chia/simulator/simulator_full_node_rpc_api.py index 95a12381dd..87234892e3 100644 --- a/chia/simulator/simulator_full_node_rpc_api.py +++ b/chia/simulator/simulator_full_node_rpc_api.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from secrets import token_bytes from typing import Dict, List diff --git a/chia/simulator/simulator_full_node_rpc_client.py b/chia/simulator/simulator_full_node_rpc_client.py index fa0352d4f3..c5876bc063 100644 --- a/chia/simulator/simulator_full_node_rpc_client.py +++ b/chia/simulator/simulator_full_node_rpc_client.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, List, Tuple from chia.rpc.full_node_rpc_client import FullNodeRpcClient diff --git a/chia/simulator/simulator_protocol.py b/chia/simulator/simulator_protocol.py index 57b4585a29..725ed8e993 100644 --- a/chia/simulator/simulator_protocol.py +++ b/chia/simulator/simulator_protocol.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional diff --git a/chia/simulator/simulator_test_tools.py b/chia/simulator/simulator_test_tools.py index 96cce95bcd..732303fceb 100644 --- a/chia/simulator/simulator_test_tools.py +++ b/chia/simulator/simulator_test_tools.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import sys import tempfile diff --git a/chia/simulator/socket.py b/chia/simulator/socket.py index 74526a1dde..cb901ffc5c 100644 --- a/chia/simulator/socket.py +++ b/chia/simulator/socket.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import secrets import socket from typing import Set diff --git a/chia/simulator/ssl_certs.py b/chia/simulator/ssl_certs.py index 3abfb9db77..1318e2773d 100644 --- a/chia/simulator/ssl_certs.py +++ b/chia/simulator/ssl_certs.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import itertools from dataclasses import dataclass from typing import Dict, Generic, List, Tuple, TypeVar diff --git a/chia/simulator/ssl_certs_1.py b/chia/simulator/ssl_certs_1.py index 0c2c899fdf..17a89730dc 100644 --- a/chia/simulator/ssl_certs_1.py +++ b/chia/simulator/ssl_certs_1.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, Tuple SSL_TEST_PRIVATE_CA_CRT = b"""-----BEGIN CERTIFICATE----- diff --git a/chia/simulator/ssl_certs_10.py b/chia/simulator/ssl_certs_10.py index b8ef2c6602..cc2e4f5311 100644 --- a/chia/simulator/ssl_certs_10.py +++ b/chia/simulator/ssl_certs_10.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, Tuple SSL_TEST_PRIVATE_CA_CRT = b"""-----BEGIN CERTIFICATE----- diff --git a/chia/simulator/ssl_certs_2.py b/chia/simulator/ssl_certs_2.py index ffacbd4594..e949376f2c 100644 --- a/chia/simulator/ssl_certs_2.py +++ b/chia/simulator/ssl_certs_2.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, Tuple SSL_TEST_PRIVATE_CA_CRT = b"""-----BEGIN CERTIFICATE----- diff --git a/chia/simulator/ssl_certs_3.py b/chia/simulator/ssl_certs_3.py index cb3bf0677f..fcdcd9f211 100644 --- a/chia/simulator/ssl_certs_3.py +++ b/chia/simulator/ssl_certs_3.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, Tuple SSL_TEST_PRIVATE_CA_CRT = b"""-----BEGIN CERTIFICATE----- diff --git a/chia/simulator/ssl_certs_4.py b/chia/simulator/ssl_certs_4.py index ca3c576bd2..5ab06a50f2 100644 --- a/chia/simulator/ssl_certs_4.py +++ b/chia/simulator/ssl_certs_4.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, Tuple SSL_TEST_PRIVATE_CA_CRT = b"""-----BEGIN CERTIFICATE----- diff --git a/chia/simulator/ssl_certs_5.py b/chia/simulator/ssl_certs_5.py index a0ddac66ce..c975f7e213 100644 --- a/chia/simulator/ssl_certs_5.py +++ b/chia/simulator/ssl_certs_5.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, Tuple SSL_TEST_PRIVATE_CA_CRT = b"""-----BEGIN CERTIFICATE----- diff --git a/chia/simulator/ssl_certs_6.py b/chia/simulator/ssl_certs_6.py index 3cb5205c14..aabab144a2 100644 --- a/chia/simulator/ssl_certs_6.py +++ b/chia/simulator/ssl_certs_6.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, Tuple SSL_TEST_PRIVATE_CA_CRT = b"""-----BEGIN CERTIFICATE----- diff --git a/chia/simulator/ssl_certs_7.py b/chia/simulator/ssl_certs_7.py index d7f79f2763..b4710f73b6 100644 --- a/chia/simulator/ssl_certs_7.py +++ b/chia/simulator/ssl_certs_7.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, Tuple SSL_TEST_PRIVATE_CA_CRT = b"""-----BEGIN CERTIFICATE----- diff --git a/chia/simulator/ssl_certs_8.py b/chia/simulator/ssl_certs_8.py index b11a66197b..9b564db183 100644 --- a/chia/simulator/ssl_certs_8.py +++ b/chia/simulator/ssl_certs_8.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, Tuple SSL_TEST_PRIVATE_CA_CRT = b"""-----BEGIN CERTIFICATE----- diff --git a/chia/simulator/ssl_certs_9.py b/chia/simulator/ssl_certs_9.py index 16555a0b3c..ae431ac26e 100644 --- a/chia/simulator/ssl_certs_9.py +++ b/chia/simulator/ssl_certs_9.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, Tuple SSL_TEST_PRIVATE_CA_CRT = b"""-----BEGIN CERTIFICATE----- diff --git a/chia/simulator/time_out_assert.py b/chia/simulator/time_out_assert.py index 7720a08551..fef5e000a6 100644 --- a/chia/simulator/time_out_assert.py +++ b/chia/simulator/time_out_assert.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import logging import time diff --git a/chia/simulator/wallet_tools.py b/chia/simulator/wallet_tools.py index 786e173104..5d34b194ef 100644 --- a/chia/simulator/wallet_tools.py +++ b/chia/simulator/wallet_tools.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any, Dict, List, Optional, Tuple from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey diff --git a/chia/timelord/iters_from_block.py b/chia/timelord/iters_from_block.py index 2cca5394c7..2fdaf26c32 100644 --- a/chia/timelord/iters_from_block.py +++ b/chia/timelord/iters_from_block.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Optional, Tuple, Union from chia.consensus.pot_iterations import calculate_ip_iters, calculate_iterations_quality, calculate_sp_iters diff --git a/chia/timelord/timelord.py b/chia/timelord/timelord.py index ddfa0e9f21..36dd29b535 100644 --- a/chia/timelord/timelord.py +++ b/chia/timelord/timelord.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import dataclasses import io diff --git a/chia/timelord/timelord_api.py b/chia/timelord/timelord_api.py index e6d1e810c6..94a620873c 100644 --- a/chia/timelord/timelord_api.py +++ b/chia/timelord/timelord_api.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import time from typing import Callable, Optional diff --git a/chia/timelord/timelord_state.py b/chia/timelord/timelord_state.py index 6431d336b8..45f44009f9 100644 --- a/chia/timelord/timelord_state.py +++ b/chia/timelord/timelord_state.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from typing import List, Optional, Tuple, Union diff --git a/chia/timelord/types.py b/chia/timelord/types.py index 5abf196804..fa73b37673 100644 --- a/chia/timelord/types.py +++ b/chia/timelord/types.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from enum import Enum diff --git a/chia/types/announcement.py b/chia/types/announcement.py index d4324f0bdf..fb93c7884a 100644 --- a/chia/types/announcement.py +++ b/chia/types/announcement.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional diff --git a/chia/types/block_protocol.py b/chia/types/block_protocol.py index 47ed24f3fc..f57424ab62 100644 --- a/chia/types/block_protocol.py +++ b/chia/types/block_protocol.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import List, Optional from typing_extensions import Protocol diff --git a/chia/types/blockchain_format/classgroup.py b/chia/types/blockchain_format/classgroup.py index 10a83e93e9..6a1ffc8d45 100644 --- a/chia/types/blockchain_format/classgroup.py +++ b/chia/types/blockchain_format/classgroup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from chia.consensus.constants import ConsensusConstants diff --git a/chia/types/blockchain_format/coin.py b/chia/types/blockchain_format/coin.py index 29d4196689..3f5ad914e9 100644 --- a/chia/types/blockchain_format/coin.py +++ b/chia/types/blockchain_format/coin.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import List, Union from chia_rs import Coin diff --git a/chia/types/blockchain_format/foliage.py b/chia/types/blockchain_format/foliage.py index 412e40ba39..b67d2afe8c 100644 --- a/chia/types/blockchain_format/foliage.py +++ b/chia/types/blockchain_format/foliage.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List, Optional diff --git a/chia/types/blockchain_format/pool_target.py b/chia/types/blockchain_format/pool_target.py index 6d9b126d76..41e1b57b80 100644 --- a/chia/types/blockchain_format/pool_target.py +++ b/chia/types/blockchain_format/pool_target.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from chia.types.blockchain_format.sized_bytes import bytes32 diff --git a/chia/types/blockchain_format/reward_chain_block.py b/chia/types/blockchain_format/reward_chain_block.py index 515d032c09..d0ba887e32 100644 --- a/chia/types/blockchain_format/reward_chain_block.py +++ b/chia/types/blockchain_format/reward_chain_block.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional diff --git a/chia/types/blockchain_format/sized_bytes.py b/chia/types/blockchain_format/sized_bytes.py index c2775a176a..51cd622dc4 100644 --- a/chia/types/blockchain_format/sized_bytes.py +++ b/chia/types/blockchain_format/sized_bytes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.util.byte_types import SizedBytes diff --git a/chia/types/blockchain_format/slots.py b/chia/types/blockchain_format/slots.py index a230dcf043..4c06d10610 100644 --- a/chia/types/blockchain_format/slots.py +++ b/chia/types/blockchain_format/slots.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional diff --git a/chia/types/blockchain_format/sub_epoch_summary.py b/chia/types/blockchain_format/sub_epoch_summary.py index 6a1fc89fa6..8eff2e113e 100644 --- a/chia/types/blockchain_format/sub_epoch_summary.py +++ b/chia/types/blockchain_format/sub_epoch_summary.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional diff --git a/chia/types/blockchain_format/tree_hash.py b/chia/types/blockchain_format/tree_hash.py index 5bd03db8b5..844aac8156 100644 --- a/chia/types/blockchain_format/tree_hash.py +++ b/chia/types/blockchain_format/tree_hash.py @@ -6,6 +6,8 @@ This implementation goes to great pains to be non-recursive so we don't have to worry about blowing out the python stack. """ +from __future__ import annotations + from typing import Optional, Set from clvm import CLVMObject diff --git a/chia/types/coin_record.py b/chia/types/coin_record.py index b195ad3de0..69a6d64932 100644 --- a/chia/types/coin_record.py +++ b/chia/types/coin_record.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional diff --git a/chia/types/condition_opcodes.py b/chia/types/condition_opcodes.py index 0e98d6f589..5902863c81 100644 --- a/chia/types/condition_opcodes.py +++ b/chia/types/condition_opcodes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import enum from typing import Any diff --git a/chia/types/condition_with_args.py b/chia/types/condition_with_args.py index 5f0dbce11f..721ecbeca6 100644 --- a/chia/types/condition_with_args.py +++ b/chia/types/condition_with_args.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List diff --git a/chia/types/end_of_slot_bundle.py b/chia/types/end_of_slot_bundle.py index 72d708f5e7..d97a3237d5 100644 --- a/chia/types/end_of_slot_bundle.py +++ b/chia/types/end_of_slot_bundle.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional diff --git a/chia/types/header_block.py b/chia/types/header_block.py index e0b44abd24..634cb59650 100644 --- a/chia/types/header_block.py +++ b/chia/types/header_block.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List, Optional diff --git a/chia/types/mempool_inclusion_status.py b/chia/types/mempool_inclusion_status.py index 41b2f8ad74..3fb5434b40 100644 --- a/chia/types/mempool_inclusion_status.py +++ b/chia/types/mempool_inclusion_status.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from enum import IntEnum diff --git a/chia/types/mempool_item.py b/chia/types/mempool_item.py index 5a91e80a90..50513fee56 100644 --- a/chia/types/mempool_item.py +++ b/chia/types/mempool_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List diff --git a/chia/types/mempool_submission_status.py b/chia/types/mempool_submission_status.py index 9ba1d5c70c..c72a10f79b 100644 --- a/chia/types/mempool_submission_status.py +++ b/chia/types/mempool_submission_status.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Dict, Optional, Union diff --git a/chia/types/peer_info.py b/chia/types/peer_info.py index 7435cb1809..317105201a 100644 --- a/chia/types/peer_info.py +++ b/chia/types/peer_info.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import ipaddress from dataclasses import dataclass from typing import Optional, Union diff --git a/chia/types/spend_bundle_conditions.py b/chia/types/spend_bundle_conditions.py index a822579851..83ea4dea43 100644 --- a/chia/types/spend_bundle_conditions.py +++ b/chia/types/spend_bundle_conditions.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia_rs import Spend, SpendBundleConditions __all__ = ["Spend", "SpendBundleConditions"] diff --git a/chia/types/transaction_queue_entry.py b/chia/types/transaction_queue_entry.py index 9fe237161e..85ccc38f1a 100644 --- a/chia/types/transaction_queue_entry.py +++ b/chia/types/transaction_queue_entry.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional diff --git a/chia/types/unfinished_block.py b/chia/types/unfinished_block.py index da110a66c1..a26445a013 100644 --- a/chia/types/unfinished_block.py +++ b/chia/types/unfinished_block.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List, Optional diff --git a/chia/types/unfinished_header_block.py b/chia/types/unfinished_header_block.py index da6f3b436a..a3831cc4da 100644 --- a/chia/types/unfinished_header_block.py +++ b/chia/types/unfinished_header_block.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List, Optional diff --git a/chia/types/weight_proof.py b/chia/types/weight_proof.py index 47f5b91187..74a7df8104 100644 --- a/chia/types/weight_proof.py +++ b/chia/types/weight_proof.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List, Optional diff --git a/chia/util/api_decorators.py b/chia/util/api_decorators.py index be4c06a647..9638a3971d 100644 --- a/chia/util/api_decorators.py +++ b/chia/util/api_decorators.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import functools import logging from inspect import signature diff --git a/chia/util/block_cache.py b/chia/util/block_cache.py index a07dc20810..1950d74ebc 100644 --- a/chia/util/block_cache.py +++ b/chia/util/block_cache.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from typing import Dict, List, Optional diff --git a/chia/util/cached_bls.py b/chia/util/cached_bls.py index 6c323eac4f..fcbbf3ebfc 100644 --- a/chia/util/cached_bls.py +++ b/chia/util/cached_bls.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import functools from typing import Dict, List, Optional, Sequence diff --git a/chia/util/chunks.py b/chia/util/chunks.py index b35b784cb6..a6ff9dbc25 100644 --- a/chia/util/chunks.py +++ b/chia/util/chunks.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Iterator, List, TypeVar T = TypeVar("T") diff --git a/chia/util/config.py b/chia/util/config.py index 08c44af168..af38e9dc6f 100644 --- a/chia/util/config.py +++ b/chia/util/config.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import argparse import contextlib import copy diff --git a/chia/util/create_alert_file.py b/chia/util/create_alert_file.py index 5c2e464250..a78619ae5a 100644 --- a/chia/util/create_alert_file.py +++ b/chia/util/create_alert_file.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path from typing import List diff --git a/chia/util/db_synchronous.py b/chia/util/db_synchronous.py index 636fbc5983..3fbc048a6d 100644 --- a/chia/util/db_synchronous.py +++ b/chia/util/db_synchronous.py @@ -1,3 +1,6 @@ +from __future__ import annotations + + def db_synchronous_on(setting: str) -> str: if setting == "on": return "NORMAL" diff --git a/chia/util/db_version.py b/chia/util/db_version.py index c4a8e3a88c..f2dc98b3fc 100644 --- a/chia/util/db_version.py +++ b/chia/util/db_version.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import sqlite3 import aiosqlite diff --git a/chia/util/default_root.py b/chia/util/default_root.py index 7e9727af07..e29543c490 100644 --- a/chia/util/default_root.py +++ b/chia/util/default_root.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import os from pathlib import Path diff --git a/chia/util/errors.py b/chia/util/errors.py index 795b2562eb..4e79c02b70 100644 --- a/chia/util/errors.py +++ b/chia/util/errors.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from enum import Enum from pathlib import Path from typing import Any, List diff --git a/chia/util/full_block_utils.py b/chia/util/full_block_utils.py index 2a4392c392..3fcb519501 100644 --- a/chia/util/full_block_utils.py +++ b/chia/util/full_block_utils.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import io from dataclasses import dataclass from typing import Callable, List, Optional, Tuple diff --git a/chia/util/hash.py b/chia/util/hash.py index 6c28f10152..60304d2de8 100644 --- a/chia/util/hash.py +++ b/chia/util/hash.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from hashlib import sha256 from chia.types.blockchain_format.sized_bytes import bytes32 diff --git a/chia/util/json_util.py b/chia/util/json_util.py index 914ae99ae5..dc89511f3a 100644 --- a/chia/util/json_util.py +++ b/chia/util/json_util.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses import json from typing import Any diff --git a/chia/util/make_test_constants.py b/chia/util/make_test_constants.py index 659c75b065..bd4506356b 100644 --- a/chia/util/make_test_constants.py +++ b/chia/util/make_test_constants.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict from chia.consensus.constants import ConsensusConstants diff --git a/chia/util/merkle_set.py b/chia/util/merkle_set.py index ba24ecac05..c8faa7735a 100644 --- a/chia/util/merkle_set.py +++ b/chia/util/merkle_set.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from abc import ABCMeta, abstractmethod from hashlib import sha256 from typing import Any, Dict, List, Tuple diff --git a/chia/util/misc.py b/chia/util/misc.py index 65befb5027..6bcbf560dd 100644 --- a/chia/util/misc.py +++ b/chia/util/misc.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses from pathlib import Path from typing import Any, Dict, Sequence, Union diff --git a/chia/util/partial_func.py b/chia/util/partial_func.py index b2e164c3dd..465489f395 100644 --- a/chia/util/partial_func.py +++ b/chia/util/partial_func.py @@ -1,3 +1,6 @@ +from __future__ import annotations + + def partial_async_gen(f, *args): """ Returns an async generator function which is equalivalent to the passed in function, diff --git a/chia/util/path.py b/chia/util/path.py index 5109fa43c8..70589796b2 100644 --- a/chia/util/path.py +++ b/chia/util/path.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import os from pathlib import Path from typing import Union diff --git a/chia/util/permissions.py b/chia/util/permissions.py index a9e6599459..835146cbad 100644 --- a/chia/util/permissions.py +++ b/chia/util/permissions.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import os from pathlib import Path from typing import Tuple diff --git a/chia/util/pip_import.py b/chia/util/pip_import.py index 2df0d335bc..3df108645c 100644 --- a/chia/util/pip_import.py +++ b/chia/util/pip_import.py @@ -1,5 +1,7 @@ "Import a package and install it with PIP if it doesn't exist." +from __future__ import annotations + import subprocess import sys diff --git a/chia/util/prev_transaction_block.py b/chia/util/prev_transaction_block.py index 8a9eacd2c0..c42aec02d7 100644 --- a/chia/util/prev_transaction_block.py +++ b/chia/util/prev_transaction_block.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Tuple from chia.consensus.block_record import BlockRecord diff --git a/chia/util/recursive_replace.py b/chia/util/recursive_replace.py index cf3bc11d7b..4ef0f692ad 100644 --- a/chia/util/recursive_replace.py +++ b/chia/util/recursive_replace.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import replace from typing import Any diff --git a/chia/util/safe_cancel_task.py b/chia/util/safe_cancel_task.py index ab7156bb69..81ba81523f 100644 --- a/chia/util/safe_cancel_task.py +++ b/chia/util/safe_cancel_task.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import logging from typing import Optional diff --git a/chia/util/setproctitle.py b/chia/util/setproctitle.py index beb68c5322..1034452369 100644 --- a/chia/util/setproctitle.py +++ b/chia/util/setproctitle.py @@ -1,3 +1,5 @@ +from __future__ import annotations + try: import setproctitle as pysetproctitle diff --git a/chia/util/significant_bits.py b/chia/util/significant_bits.py index 25547e690e..580cca704d 100644 --- a/chia/util/significant_bits.py +++ b/chia/util/significant_bits.py @@ -1,3 +1,6 @@ +from __future__ import annotations + + def truncate_to_significant_bits(input_x: int, num_significant_bits: int) -> int: """ Truncates the number such that only the top num_significant_bits contain 1s. diff --git a/chia/util/struct_stream.py b/chia/util/struct_stream.py index 69b297322b..dacda0a0ea 100644 --- a/chia/util/struct_stream.py +++ b/chia/util/struct_stream.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import BinaryIO, SupportsInt, Type, TypeVar, Union from typing_extensions import Protocol, SupportsIndex diff --git a/chia/util/validate_alert.py b/chia/util/validate_alert.py index 031226ef1f..e7ed7651cc 100644 --- a/chia/util/validate_alert.py +++ b/chia/util/validate_alert.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import json from pathlib import Path diff --git a/chia/util/vdf_prover.py b/chia/util/vdf_prover.py index 30d0382bf3..455f7ad358 100644 --- a/chia/util/vdf_prover.py +++ b/chia/util/vdf_prover.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Tuple from chiavdf import prove diff --git a/chia/wallet/block_record.py b/chia/wallet/block_record.py index 8324592523..33b6b0ea54 100644 --- a/chia/wallet/block_record.py +++ b/chia/wallet/block_record.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List diff --git a/chia/wallet/cat_wallet/cat_constants.py b/chia/wallet/cat_wallet/cat_constants.py index 1d757402f0..ab5fb729d3 100644 --- a/chia/wallet/cat_wallet/cat_constants.py +++ b/chia/wallet/cat_wallet/cat_constants.py @@ -1,3 +1,5 @@ +from __future__ import annotations + SPACEBUCKS = { "asset_id": "a628c1c2c6fcb74d53746157e438e108eab5c0bb3e5c80ff9b1910b3e4832913", "name": "Spacebucks", diff --git a/chia/wallet/cat_wallet/cat_outer_puzzle.py b/chia/wallet/cat_wallet/cat_outer_puzzle.py index 3374e27587..58511a70b3 100644 --- a/chia/wallet/cat_wallet/cat_outer_puzzle.py +++ b/chia/wallet/cat_wallet/cat_outer_puzzle.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Callable, List, Optional diff --git a/chia/wallet/cat_wallet/lineage_store.py b/chia/wallet/cat_wallet/lineage_store.py index db0d4848b8..9a51cfa960 100644 --- a/chia/wallet/cat_wallet/lineage_store.py +++ b/chia/wallet/cat_wallet/lineage_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from typing import Dict, Optional diff --git a/chia/wallet/chialisp.py b/chia/wallet/chialisp.py index f598375e9a..64b5afea4a 100644 --- a/chia/wallet/chialisp.py +++ b/chia/wallet/chialisp.py @@ -1,3 +1,6 @@ +from __future__ import annotations + + def sexp(*argv): return f'({f" ".join([str(arg) for arg in argv])})' diff --git a/chia/wallet/coin_selection.py b/chia/wallet/coin_selection.py index a59b3a8f16..aeeb7bbfba 100644 --- a/chia/wallet/coin_selection.py +++ b/chia/wallet/coin_selection.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import random from typing import Dict, List, Optional, Set diff --git a/chia/wallet/db_wallet/db_wallet_puzzles.py b/chia/wallet/db_wallet/db_wallet_puzzles.py index ba28c89fcf..0b66bd8544 100644 --- a/chia/wallet/db_wallet/db_wallet_puzzles.py +++ b/chia/wallet/db_wallet/db_wallet_puzzles.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Iterator, List, Tuple, Union from chia.types.blockchain_format.program import Program diff --git a/chia/wallet/derivation_record.py b/chia/wallet/derivation_record.py index 7856bb45d4..04ca1631c0 100644 --- a/chia/wallet/derivation_record.py +++ b/chia/wallet/derivation_record.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from blspy import G1Element diff --git a/chia/wallet/driver_protocol.py b/chia/wallet/driver_protocol.py index 9797507ca7..624400a8e9 100644 --- a/chia/wallet/driver_protocol.py +++ b/chia/wallet/driver_protocol.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Optional from typing_extensions import Protocol diff --git a/chia/wallet/key_val_store.py b/chia/wallet/key_val_store.py index fbfdd9678c..66d9e3f367 100644 --- a/chia/wallet/key_val_store.py +++ b/chia/wallet/key_val_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any from chia.util.db_wrapper import DBWrapper2 diff --git a/chia/wallet/nft_wallet/metadata_outer_puzzle.py b/chia/wallet/nft_wallet/metadata_outer_puzzle.py index 83c775967f..80b9348530 100644 --- a/chia/wallet/nft_wallet/metadata_outer_puzzle.py +++ b/chia/wallet/nft_wallet/metadata_outer_puzzle.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Callable, List, Optional, Tuple diff --git a/chia/wallet/nft_wallet/nft_info.py b/chia/wallet/nft_wallet/nft_info.py index 61f21a1a06..1017bc5a27 100644 --- a/chia/wallet/nft_wallet/nft_info.py +++ b/chia/wallet/nft_wallet/nft_info.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List, Optional diff --git a/chia/wallet/nft_wallet/nft_off_chain.py b/chia/wallet/nft_wallet/nft_off_chain.py index 7387b23c54..07a116c918 100644 --- a/chia/wallet/nft_wallet/nft_off_chain.py +++ b/chia/wallet/nft_wallet/nft_off_chain.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import re from pathlib import Path diff --git a/chia/wallet/nft_wallet/nft_puzzles.py b/chia/wallet/nft_wallet/nft_puzzles.py index 604a7e8ba1..7f132cf46e 100644 --- a/chia/wallet/nft_wallet/nft_puzzles.py +++ b/chia/wallet/nft_wallet/nft_puzzles.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from typing import Any, Dict, List, Optional, Tuple diff --git a/chia/wallet/nft_wallet/nft_wallet.py b/chia/wallet/nft_wallet/nft_wallet.py index 4a5096a932..5eb09f5bd1 100644 --- a/chia/wallet/nft_wallet/nft_wallet.py +++ b/chia/wallet/nft_wallet/nft_wallet.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import dataclasses import json diff --git a/chia/wallet/nft_wallet/ownership_outer_puzzle.py b/chia/wallet/nft_wallet/ownership_outer_puzzle.py index 090f6efc58..62b297a113 100644 --- a/chia/wallet/nft_wallet/ownership_outer_puzzle.py +++ b/chia/wallet/nft_wallet/ownership_outer_puzzle.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Callable, List, Optional, Tuple, Union diff --git a/chia/wallet/nft_wallet/singleton_outer_puzzle.py b/chia/wallet/nft_wallet/singleton_outer_puzzle.py index 003a887f9a..60adaf81f1 100644 --- a/chia/wallet/nft_wallet/singleton_outer_puzzle.py +++ b/chia/wallet/nft_wallet/singleton_outer_puzzle.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Callable, Optional diff --git a/chia/wallet/nft_wallet/transfer_program_puzzle.py b/chia/wallet/nft_wallet/transfer_program_puzzle.py index 64de0842e5..bb4db84e44 100644 --- a/chia/wallet/nft_wallet/transfer_program_puzzle.py +++ b/chia/wallet/nft_wallet/transfer_program_puzzle.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Callable, List, Optional, Tuple diff --git a/chia/wallet/notification_store.py b/chia/wallet/notification_store.py index afa6ba1f99..100cc56e0c 100644 --- a/chia/wallet/notification_store.py +++ b/chia/wallet/notification_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses import logging from typing import List, Optional, Tuple diff --git a/chia/wallet/outer_puzzles.py b/chia/wallet/outer_puzzles.py index ea1cea945a..61ba4dd41c 100644 --- a/chia/wallet/outer_puzzles.py +++ b/chia/wallet/outer_puzzles.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from enum import Enum from typing import Dict, Optional diff --git a/chia/wallet/puzzles/cat_loader.py b/chia/wallet/puzzles/cat_loader.py index 26db20f81a..e89af5d540 100644 --- a/chia/wallet/puzzles/cat_loader.py +++ b/chia/wallet/puzzles/cat_loader.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile CAT_MOD = load_clvm_maybe_recompile("cat_v2.clvm", package_or_requirement=__name__) diff --git a/chia/wallet/puzzles/decompress_block_spends.py b/chia/wallet/puzzles/decompress_block_spends.py index c0bfbac02c..bc6d86442e 100644 --- a/chia/wallet/puzzles/decompress_block_spends.py +++ b/chia/wallet/puzzles/decompress_block_spends.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.wallet.puzzles.load_clvm import load_serialized_clvm DECOMPRESS_BLOCK_SPENDS = load_serialized_clvm("decompress_block_spends.clvm", package_or_requirement=__name__) diff --git a/chia/wallet/puzzles/p2_conditions.py b/chia/wallet/puzzles/p2_conditions.py index 89bc6e3022..ae649bcad4 100644 --- a/chia/wallet/puzzles/p2_conditions.py +++ b/chia/wallet/puzzles/p2_conditions.py @@ -10,6 +10,8 @@ require a delegated puzzle program, so in those cases, this is just what the doctor ordered. """ +from __future__ import annotations + from chia.types.blockchain_format.program import Program from .load_clvm import load_clvm_maybe_recompile diff --git a/chia/wallet/puzzles/p2_delegated_conditions.py b/chia/wallet/puzzles/p2_delegated_conditions.py index 94e0bafd8a..a382c3fa16 100644 --- a/chia/wallet/puzzles/p2_delegated_conditions.py +++ b/chia/wallet/puzzles/p2_delegated_conditions.py @@ -6,6 +6,8 @@ is returned literally. """ +from __future__ import annotations + from chia.types.blockchain_format.program import Program from .load_clvm import load_clvm_maybe_recompile diff --git a/chia/wallet/puzzles/p2_delegated_puzzle.py b/chia/wallet/puzzles/p2_delegated_puzzle.py index 8bb6f3434f..7ae342a651 100644 --- a/chia/wallet/puzzles/p2_delegated_puzzle.py +++ b/chia/wallet/puzzles/p2_delegated_puzzle.py @@ -12,6 +12,8 @@ you can use p2_conditions. This roughly corresponds to bitcoin's graftroot. """ +from __future__ import annotations + from chia.types.blockchain_format.program import Program from . import p2_conditions diff --git a/chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py b/chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py index 6f86c25a9a..5738cb9048 100644 --- a/chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +++ b/chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py @@ -55,6 +55,8 @@ following mechanism: key whose derivation is within. Any wallets which intend to use standard coins in this way must try to resolve a public key to a secret key via this derivation. """ +from __future__ import annotations + import hashlib from typing import Union diff --git a/chia/wallet/puzzles/p2_m_of_n_delegate_direct.py b/chia/wallet/puzzles/p2_m_of_n_delegate_direct.py index 614b285535..10cbfd2d3c 100644 --- a/chia/wallet/puzzles/p2_m_of_n_delegate_direct.py +++ b/chia/wallet/puzzles/p2_m_of_n_delegate_direct.py @@ -5,6 +5,8 @@ This puzzle program is like p2_delegated_puzzle except instead of one public key it includes N public keys, any M of which needs to sign the delegated puzzle. """ +from __future__ import annotations + from chia.types.blockchain_format.program import Program from .load_clvm import load_clvm_maybe_recompile diff --git a/chia/wallet/puzzles/p2_puzzle_hash.py b/chia/wallet/puzzles/p2_puzzle_hash.py index 1d76adb6c3..5fe18d65d6 100644 --- a/chia/wallet/puzzles/p2_puzzle_hash.py +++ b/chia/wallet/puzzles/p2_puzzle_hash.py @@ -5,6 +5,8 @@ In this puzzle program, the solution must be a reveal of the puzzle with the giv hash along with its solution. """ +from __future__ import annotations + from chia.types.blockchain_format.program import Program from chia.types.blockchain_format.sized_bytes import bytes32 diff --git a/chia/wallet/puzzles/rom_bootstrap_generator.py b/chia/wallet/puzzles/rom_bootstrap_generator.py index 5922b27d42..81f3c59208 100644 --- a/chia/wallet/puzzles/rom_bootstrap_generator.py +++ b/chia/wallet/puzzles/rom_bootstrap_generator.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.types.blockchain_format.program import SerializedProgram from .load_clvm import load_serialized_clvm diff --git a/chia/wallet/puzzles/singleton_top_layer_v1_1.py b/chia/wallet/puzzles/singleton_top_layer_v1_1.py index 02daaa445f..c4d43bff8f 100644 --- a/chia/wallet/puzzles/singleton_top_layer_v1_1.py +++ b/chia/wallet/puzzles/singleton_top_layer_v1_1.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Iterator, List, Optional, Tuple from chia.types.blockchain_format.coin import Coin diff --git a/chia/wallet/secret_key_store.py b/chia/wallet/secret_key_store.py index f1757181a2..3bf2afeb12 100644 --- a/chia/wallet/secret_key_store.py +++ b/chia/wallet/secret_key_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, Optional from blspy import G1Element, PrivateKey diff --git a/chia/wallet/settings/default_settings.py b/chia/wallet/settings/default_settings.py index 1456a345dc..80b8b1b6fd 100644 --- a/chia/wallet/settings/default_settings.py +++ b/chia/wallet/settings/default_settings.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.wallet.settings.settings_objects import BackupInitialized default_backup_initialized = BackupInitialized(False, False, False, True) diff --git a/chia/wallet/settings/settings_objects.py b/chia/wallet/settings/settings_objects.py index 27f6f92c60..7de564b2d8 100644 --- a/chia/wallet/settings/settings_objects.py +++ b/chia/wallet/settings/settings_objects.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from chia.util.streamable import Streamable, streamable diff --git a/chia/wallet/settings/user_settings.py b/chia/wallet/settings/user_settings.py index b83acec18a..0cfafc5909 100644 --- a/chia/wallet/settings/user_settings.py +++ b/chia/wallet/settings/user_settings.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any, Dict from chia.wallet.key_val_store import KeyValStore diff --git a/chia/wallet/trading/trade_status.py b/chia/wallet/trading/trade_status.py index 6d368bb3b3..9e4d1b9796 100644 --- a/chia/wallet/trading/trade_status.py +++ b/chia/wallet/trading/trade_status.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from enum import Enum diff --git a/chia/wallet/transaction_sorting.py b/chia/wallet/transaction_sorting.py index 09d778cf92..9732c9441e 100644 --- a/chia/wallet/transaction_sorting.py +++ b/chia/wallet/transaction_sorting.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import enum diff --git a/chia/wallet/uncurried_puzzle.py b/chia/wallet/uncurried_puzzle.py index 2e16580e57..a00c0f670b 100644 --- a/chia/wallet/uncurried_puzzle.py +++ b/chia/wallet/uncurried_puzzle.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from chia.types.blockchain_format.program import Program diff --git a/chia/wallet/util/address_type.py b/chia/wallet/util/address_type.py index f1ade59064..a9e908e021 100644 --- a/chia/wallet/util/address_type.py +++ b/chia/wallet/util/address_type.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from enum import Enum from typing import Any, Dict, Set diff --git a/chia/wallet/util/curry_and_treehash.py b/chia/wallet/util/curry_and_treehash.py index b1524324a4..dd6d16c992 100644 --- a/chia/wallet/util/curry_and_treehash.py +++ b/chia/wallet/util/curry_and_treehash.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from hashlib import sha256 from typing import Callable, List diff --git a/chia/wallet/util/json_clvm_utils.py b/chia/wallet/util/json_clvm_utils.py index b3eff0c8e0..a81f4ba977 100644 --- a/chia/wallet/util/json_clvm_utils.py +++ b/chia/wallet/util/json_clvm_utils.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any from chia.types.blockchain_format.program import Program diff --git a/chia/wallet/util/merkle_tree.py b/chia/wallet/util/merkle_tree.py index f1d4b51cbb..d8905c7083 100644 --- a/chia/wallet/util/merkle_tree.py +++ b/chia/wallet/util/merkle_tree.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import math from enum import Enum from typing import List, Optional, Tuple diff --git a/chia/wallet/util/merkle_utils.py b/chia/wallet/util/merkle_utils.py index 31d576afe1..598ed52b9d 100644 --- a/chia/wallet/util/merkle_utils.py +++ b/chia/wallet/util/merkle_utils.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import hashlib from typing import Any, Dict, List, Tuple diff --git a/chia/wallet/util/new_peak_queue.py b/chia/wallet/util/new_peak_queue.py index 10d813e08a..a6109dfd33 100644 --- a/chia/wallet/util/new_peak_queue.py +++ b/chia/wallet/util/new_peak_queue.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import dataclasses from enum import IntEnum diff --git a/chia/wallet/util/notifications.py b/chia/wallet/util/notifications.py index 2aa3792542..a219411c97 100644 --- a/chia/wallet/util/notifications.py +++ b/chia/wallet/util/notifications.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.types.blockchain_format.program import Program from chia.types.blockchain_format.sized_bytes import bytes32 from chia.util.ints import uint64 diff --git a/chia/wallet/util/transaction_type.py b/chia/wallet/util/transaction_type.py index d98103bfcd..5e1c7980fd 100644 --- a/chia/wallet/util/transaction_type.py +++ b/chia/wallet/util/transaction_type.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from enum import IntEnum diff --git a/chia/wallet/util/wallet_types.py b/chia/wallet/util/wallet_types.py index 3e3de9ca24..23f3e36ca2 100644 --- a/chia/wallet/util/wallet_types.py +++ b/chia/wallet/util/wallet_types.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from enum import IntEnum from typing import List diff --git a/chia/wallet/wallet_action.py b/chia/wallet/wallet_action.py index 3c94e47012..cf6e3bf126 100644 --- a/chia/wallet/wallet_action.py +++ b/chia/wallet/wallet_action.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional diff --git a/chia/wallet/wallet_coin_record.py b/chia/wallet/wallet_coin_record.py index 70ba07211b..ec076ffe15 100644 --- a/chia/wallet/wallet_coin_record.py +++ b/chia/wallet/wallet_coin_record.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from chia.types.blockchain_format.coin import Coin diff --git a/chia/wallet/wallet_info.py b/chia/wallet/wallet_info.py index 1d02bb6e72..7cb1fb9f42 100644 --- a/chia/wallet/wallet_info.py +++ b/chia/wallet/wallet_info.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import List diff --git a/chia/wallet/wallet_nft_store.py b/chia/wallet/wallet_nft_store.py index d3d586cf6f..9fd1dba68a 100644 --- a/chia/wallet/wallet_nft_store.py +++ b/chia/wallet/wallet_nft_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import json import logging from sqlite3 import Row diff --git a/chia/wallet/wallet_puzzle_store.py b/chia/wallet/wallet_puzzle_store.py index 9f8b9b96d7..6701754d7e 100644 --- a/chia/wallet/wallet_puzzle_store.py +++ b/chia/wallet/wallet_puzzle_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import logging from typing import Dict, List, Optional, Set, Tuple diff --git a/chia/wallet/wallet_transaction_store.py b/chia/wallet/wallet_transaction_store.py index 9bd4a96edd..6afe6a17c1 100644 --- a/chia/wallet/wallet_transaction_store.py +++ b/chia/wallet/wallet_transaction_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses import time from typing import Dict, List, Optional, Tuple diff --git a/chia/wallet/wallet_user_store.py b/chia/wallet/wallet_user_store.py index 0c0c54b327..68a5df268a 100644 --- a/chia/wallet/wallet_user_store.py +++ b/chia/wallet/wallet_user_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import List, Optional from chia.util.db_wrapper import DBWrapper2, execute_fetchone diff --git a/installhelper.py b/installhelper.py index 7416ecf4c5..c075862cb2 100644 --- a/installhelper.py +++ b/installhelper.py @@ -4,6 +4,8 @@ # Converts to proper symver format so NPM doesn't complain # Adds the version info to the package.json file # +from __future__ import annotations + import json import os import subprocess diff --git a/setup.py b/setup.py index e663eaf899..47c6fc3f4e 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import os from setuptools import setup diff --git a/tests/blockchain/config.py b/tests/blockchain/config.py index 6a5974362b..9bd6ead88b 100644 --- a/tests/blockchain/config.py +++ b/tests/blockchain/config.py @@ -1,3 +1,5 @@ +from __future__ import annotations + parallel = True job_timeout = 60 checkout_blocks_and_plots = True diff --git a/tests/build-job-matrix.py b/tests/build-job-matrix.py index a291e446e6..da899ba3d4 100644 --- a/tests/build-job-matrix.py +++ b/tests/build-job-matrix.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import argparse import json import logging diff --git a/tests/check_pytest_monitor_output.py b/tests/check_pytest_monitor_output.py index 1431c91972..f6a740272d 100755 --- a/tests/check_pytest_monitor_output.py +++ b/tests/check_pytest_monitor_output.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +from __future__ import annotations + import sys ret = 0 diff --git a/tests/check_sql_statements.py b/tests/check_sql_statements.py index f848292004..3130a8d01a 100755 --- a/tests/check_sql_statements.py +++ b/tests/check_sql_statements.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +from __future__ import annotations + import sys from subprocess import check_output from typing import Dict, Set, Tuple diff --git a/tests/clvm/config.py b/tests/clvm/config.py index 031b82365b..b16e163aa2 100644 --- a/tests/clvm/config.py +++ b/tests/clvm/config.py @@ -1,2 +1,4 @@ +from __future__ import annotations + parallel = True checkout_blocks_and_plots = False diff --git a/tests/clvm/test_clvm_step.py b/tests/clvm/test_clvm_step.py index 84f47f0f30..9948b601d1 100644 --- a/tests/clvm/test_clvm_step.py +++ b/tests/clvm/test_clvm_step.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any, Optional from unittest import TestCase diff --git a/tests/clvm/test_curry_and_treehash.py b/tests/clvm/test_curry_and_treehash.py index 81366fcbab..b3fd0df992 100644 --- a/tests/clvm/test_curry_and_treehash.py +++ b/tests/clvm/test_curry_and_treehash.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.types.blockchain_format.program import Program from chia.wallet.puzzles import p2_delegated_puzzle_or_hidden_puzzle # import (puzzle_for_pk, puzzle_hash_for_pk, MOD) from chia.wallet.util.curry_and_treehash import calculate_hash_of_quoted_mod_hash, curry_and_treehash diff --git a/tests/clvm/test_puzzle_drivers.py b/tests/clvm/test_puzzle_drivers.py index 4c62975ba5..2ac99d96de 100644 --- a/tests/clvm/test_puzzle_drivers.py +++ b/tests/clvm/test_puzzle_drivers.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any, Dict, Union import pytest diff --git a/tests/clvm/test_puzzles.py b/tests/clvm/test_puzzles.py index 0912de7719..03ace5f0ba 100644 --- a/tests/clvm/test_puzzles.py +++ b/tests/clvm/test_puzzles.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Iterable, List, Tuple from unittest import TestCase diff --git a/tests/connection_utils.py b/tests/connection_utils.py index a30c534df4..f09933d81e 100644 --- a/tests/connection_utils.py +++ b/tests/connection_utils.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import logging from typing import Tuple diff --git a/tests/core/cmds/config.py b/tests/core/cmds/config.py index 7f9e1e1a76..562db3171a 100644 --- a/tests/core/cmds/config.py +++ b/tests/core/cmds/config.py @@ -1 +1,3 @@ +from __future__ import annotations + parallel = True diff --git a/tests/core/cmds/test_beta.py b/tests/core/cmds/test_beta.py index 15d6158c75..981a9e35ed 100644 --- a/tests/core/cmds/test_beta.py +++ b/tests/core/cmds/test_beta.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import zipfile from pathlib import Path from typing import Callable, Optional diff --git a/tests/core/cmds/test_wallet.py b/tests/core/cmds/test_wallet.py index f211c5b50a..e60b774ab3 100644 --- a/tests/core/cmds/test_wallet.py +++ b/tests/core/cmds/test_wallet.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any, Dict, Optional, Tuple import pytest diff --git a/tests/core/config.py b/tests/core/config.py index 235efb181c..9d6e160fe6 100644 --- a/tests/core/config.py +++ b/tests/core/config.py @@ -1,2 +1,4 @@ +from __future__ import annotations + parallel = True checkout_blocks_and_plots = True diff --git a/tests/core/consensus/config.py b/tests/core/consensus/config.py index 7f9e1e1a76..562db3171a 100644 --- a/tests/core/consensus/config.py +++ b/tests/core/consensus/config.py @@ -1 +1,3 @@ +from __future__ import annotations + parallel = True diff --git a/tests/core/consensus/test_pot_iterations.py b/tests/core/consensus/test_pot_iterations.py index b3283fe3fd..910538a678 100644 --- a/tests/core/consensus/test_pot_iterations.py +++ b/tests/core/consensus/test_pot_iterations.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pytest import raises from chia.consensus.default_constants import DEFAULT_CONSTANTS diff --git a/tests/core/custom_types/config.py b/tests/core/custom_types/config.py index 7f9e1e1a76..562db3171a 100644 --- a/tests/core/custom_types/config.py +++ b/tests/core/custom_types/config.py @@ -1 +1,3 @@ +from __future__ import annotations + parallel = True diff --git a/tests/core/custom_types/test_proof_of_space.py b/tests/core/custom_types/test_proof_of_space.py index 1f6edd9601..c201c77fec 100644 --- a/tests/core/custom_types/test_proof_of_space.py +++ b/tests/core/custom_types/test_proof_of_space.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from secrets import token_bytes from chia.consensus.default_constants import DEFAULT_CONSTANTS diff --git a/tests/core/daemon/config.py b/tests/core/daemon/config.py index 0fbdc68914..a71e4348d3 100644 --- a/tests/core/daemon/config.py +++ b/tests/core/daemon/config.py @@ -1,2 +1,4 @@ +from __future__ import annotations + install_timelord = True checkout_blocks_and_plots = True diff --git a/tests/core/data_layer/config.py b/tests/core/data_layer/config.py index dac80dd6a4..f5f39e2c56 100644 --- a/tests/core/data_layer/config.py +++ b/tests/core/data_layer/config.py @@ -1,3 +1,5 @@ +from __future__ import annotations + parallel = 4 job_timeout = 40 checkout_blocks_and_plots = True diff --git a/tests/core/data_layer/conftest.py b/tests/core/data_layer/conftest.py index e1c41da1ac..cc466b885e 100644 --- a/tests/core/data_layer/conftest.py +++ b/tests/core/data_layer/conftest.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import contextlib import os import pathlib diff --git a/tests/core/data_layer/test_data_cli.py b/tests/core/data_layer/test_data_cli.py index 815f3cf092..28e58fe4a3 100644 --- a/tests/core/data_layer/test_data_cli.py +++ b/tests/core/data_layer/test_data_cli.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import json from typing import Dict, List diff --git a/tests/core/data_layer/test_data_layer_util.py b/tests/core/data_layer/test_data_layer_util.py index 2632f1e966..8689d4a273 100644 --- a/tests/core/data_layer/test_data_layer_util.py +++ b/tests/core/data_layer/test_data_layer_util.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses from typing import List diff --git a/tests/core/data_layer/test_data_store.py b/tests/core/data_layer/test_data_store.py index 19d5220522..c08ed1254e 100644 --- a/tests/core/data_layer/test_data_store.py +++ b/tests/core/data_layer/test_data_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import itertools import logging import statistics diff --git a/tests/core/data_layer/test_data_store_schema.py b/tests/core/data_layer/test_data_store_schema.py index bbc22d9b2d..7e37aacd1f 100644 --- a/tests/core/data_layer/test_data_store_schema.py +++ b/tests/core/data_layer/test_data_store_schema.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import sqlite3 from typing import Any, Dict diff --git a/tests/core/data_layer/util.py b/tests/core/data_layer/util.py index 9807e45f90..62543e2324 100644 --- a/tests/core/data_layer/util.py +++ b/tests/core/data_layer/util.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import contextlib import functools import os diff --git a/tests/core/full_node/config.py b/tests/core/full_node/config.py index e5b3ae6b5c..03ae3aa5ac 100644 --- a/tests/core/full_node/config.py +++ b/tests/core/full_node/config.py @@ -1,4 +1,6 @@ # flake8: noqa: E501 +from __future__ import annotations + parallel = True job_timeout = 50 check_resource_usage = True diff --git a/tests/core/full_node/conftest.py b/tests/core/full_node/conftest.py index d2ed3b296d..26a5b4103d 100644 --- a/tests/core/full_node/conftest.py +++ b/tests/core/full_node/conftest.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio from typing import Iterator diff --git a/tests/core/full_node/dos/config.py b/tests/core/full_node/dos/config.py index 93f77cd99a..2a99285c7c 100644 --- a/tests/core/full_node/dos/config.py +++ b/tests/core/full_node/dos/config.py @@ -1,2 +1,4 @@ +from __future__ import annotations + parallel = True job_timeout = 60 diff --git a/tests/core/full_node/full_sync/config.py b/tests/core/full_node/full_sync/config.py index 49234ca992..e774efbb7d 100644 --- a/tests/core/full_node/full_sync/config.py +++ b/tests/core/full_node/full_sync/config.py @@ -1,3 +1,5 @@ +from __future__ import annotations + job_timeout = 60 parallel = True checkout_blocks_and_plots = True diff --git a/tests/core/full_node/stores/config.py b/tests/core/full_node/stores/config.py index 97cd63fb80..7247000e4f 100644 --- a/tests/core/full_node/stores/config.py +++ b/tests/core/full_node/stores/config.py @@ -1,4 +1,6 @@ # flake8: noqa: E501 +from __future__ import annotations + parallel = True job_timeout = 40 check_resource_usage = True diff --git a/tests/core/full_node/stores/test_sync_store.py b/tests/core/full_node/stores/test_sync_store.py index e219ebbb70..d0b04ffa36 100644 --- a/tests/core/full_node/stores/test_sync_store.py +++ b/tests/core/full_node/stores/test_sync_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pytest from chia.full_node.sync_store import SyncStore diff --git a/tests/core/full_node/test_address_manager.py b/tests/core/full_node/test_address_manager.py index 1d25fa6e8a..3dd311ce49 100644 --- a/tests/core/full_node/test_address_manager.py +++ b/tests/core/full_node/test_address_manager.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import math import time from pathlib import Path diff --git a/tests/core/full_node/test_generator_tools.py b/tests/core/full_node/test_generator_tools.py index 02cadd1e48..00acd867b6 100644 --- a/tests/core/full_node/test_generator_tools.py +++ b/tests/core/full_node/test_generator_tools.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import List from chia.types.blockchain_format.coin import Coin diff --git a/tests/core/full_node/test_hint_management.py b/tests/core/full_node/test_hint_management.py index b7b1202b85..1be25e0542 100644 --- a/tests/core/full_node/test_hint_management.py +++ b/tests/core/full_node/test_hint_management.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import List, Optional import pytest diff --git a/tests/core/full_node/test_node_load.py b/tests/core/full_node/test_node_load.py index 613b9aef4b..dc385507ef 100644 --- a/tests/core/full_node/test_node_load.py +++ b/tests/core/full_node/test_node_load.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pytest from chia.protocols import full_node_protocol diff --git a/tests/core/full_node/test_peer_store_resolver.py b/tests/core/full_node/test_peer_store_resolver.py index b01c97721f..5be8c3fe94 100644 --- a/tests/core/full_node/test_peer_store_resolver.py +++ b/tests/core/full_node/test_peer_store_resolver.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import os from pathlib import Path from typing import Dict diff --git a/tests/core/full_node/test_transactions.py b/tests/core/full_node/test_transactions.py index cd37f4c540..464efab1ba 100644 --- a/tests/core/full_node/test_transactions.py +++ b/tests/core/full_node/test_transactions.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio from secrets import token_bytes from typing import Optional diff --git a/tests/core/large_block.py b/tests/core/large_block.py index 31f4e257ee..afa8e90b4b 100644 --- a/tests/core/large_block.py +++ b/tests/core/large_block.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import zstd from chia.types.full_block import FullBlock diff --git a/tests/core/make_block_generator.py b/tests/core/make_block_generator.py index 274b623843..1ccc9be1c2 100644 --- a/tests/core/make_block_generator.py +++ b/tests/core/make_block_generator.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict import blspy diff --git a/tests/core/node_height.py b/tests/core/node_height.py index 68d543770a..76c756e73e 100644 --- a/tests/core/node_height.py +++ b/tests/core/node_height.py @@ -1,3 +1,6 @@ +from __future__ import annotations + + def node_height_at_least(node, h): if node.full_node.blockchain.get_peak() is not None: return node.full_node.blockchain.get_peak().height >= h diff --git a/tests/core/server/config.py b/tests/core/server/config.py index 0257db4372..0bc8434702 100644 --- a/tests/core/server/config.py +++ b/tests/core/server/config.py @@ -1 +1,3 @@ +from __future__ import annotations + checkout_blocks_and_plots = True diff --git a/tests/core/ssl/config.py b/tests/core/ssl/config.py index 235efb181c..9d6e160fe6 100644 --- a/tests/core/ssl/config.py +++ b/tests/core/ssl/config.py @@ -1,2 +1,4 @@ +from __future__ import annotations + parallel = True checkout_blocks_and_plots = True diff --git a/tests/core/test_coins.py b/tests/core/test_coins.py index f08097c5cc..b415498515 100644 --- a/tests/core/test_coins.py +++ b/tests/core/test_coins.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from itertools import permutations from benchmarks.utils import rand_hash diff --git a/tests/core/test_cost_calculation.py b/tests/core/test_cost_calculation.py index c589d8e0fa..a7088ab26d 100644 --- a/tests/core/test_cost_calculation.py +++ b/tests/core/test_cost_calculation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import pathlib from typing import List diff --git a/tests/core/test_crawler_rpc.py b/tests/core/test_crawler_rpc.py index 285a8b84fe..701d9e547c 100644 --- a/tests/core/test_crawler_rpc.py +++ b/tests/core/test_crawler_rpc.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pytest from chia.rpc.crawler_rpc_api import CrawlerRpcApi diff --git a/tests/core/test_db_validation.py b/tests/core/test_db_validation.py index d3fec8b4d8..7665cff990 100644 --- a/tests/core/test_db_validation.py +++ b/tests/core/test_db_validation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import random import sqlite3 from contextlib import closing diff --git a/tests/core/test_farmer_harvester_rpc.py b/tests/core/test_farmer_harvester_rpc.py index d11c8e3e3a..55df4897d0 100644 --- a/tests/core/test_farmer_harvester_rpc.py +++ b/tests/core/test_farmer_harvester_rpc.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses import logging import operator diff --git a/tests/core/test_merkle_set.py b/tests/core/test_merkle_set.py index 0c6fd78f5a..85965a0e36 100644 --- a/tests/core/test_merkle_set.py +++ b/tests/core/test_merkle_set.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import itertools import random from hashlib import sha256 diff --git a/tests/core/test_setproctitle.py b/tests/core/test_setproctitle.py index de3bdcc378..8ab74a0d9b 100644 --- a/tests/core/test_setproctitle.py +++ b/tests/core/test_setproctitle.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pytest from chia.util.setproctitle import setproctitle diff --git a/tests/core/util/config.py b/tests/core/util/config.py index 235efb181c..9d6e160fe6 100644 --- a/tests/core/util/config.py +++ b/tests/core/util/config.py @@ -1,2 +1,4 @@ +from __future__ import annotations + parallel = True checkout_blocks_and_plots = True diff --git a/tests/core/util/test_jsonify.py b/tests/core/util/test_jsonify.py index a61532e2d5..291dce7eb7 100644 --- a/tests/core/util/test_jsonify.py +++ b/tests/core/util/test_jsonify.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Any, Dict, List, Optional, Tuple diff --git a/tests/core/util/test_lockfile.py b/tests/core/util/test_lockfile.py index 6c9684396f..92f093521e 100644 --- a/tests/core/util/test_lockfile.py +++ b/tests/core/util/test_lockfile.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import os from multiprocessing import Pool, TimeoutError diff --git a/tests/core/util/test_lru_cache.py b/tests/core/util/test_lru_cache.py index eec3710d52..905529cc23 100644 --- a/tests/core/util/test_lru_cache.py +++ b/tests/core/util/test_lru_cache.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import unittest from chia.util.lru_cache import LRUCache diff --git a/tests/core/util/test_significant_bits.py b/tests/core/util/test_significant_bits.py index 610173bac9..96c0e03f3a 100644 --- a/tests/core/util/test_significant_bits.py +++ b/tests/core/util/test_significant_bits.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import unittest from chia.util.significant_bits import count_significant_bits, truncate_to_significant_bits diff --git a/tests/db/test_db_wrapper.py b/tests/db/test_db_wrapper.py index a174292a9d..72e569a7a7 100644 --- a/tests/db/test_db_wrapper.py +++ b/tests/db/test_db_wrapper.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import contextlib from typing import List diff --git a/tests/farmer_harvester/config.py b/tests/farmer_harvester/config.py index 0257db4372..0bc8434702 100644 --- a/tests/farmer_harvester/config.py +++ b/tests/farmer_harvester/config.py @@ -1 +1,3 @@ +from __future__ import annotations + checkout_blocks_and_plots = True diff --git a/tests/farmer_harvester/test_farmer_harvester.py b/tests/farmer_harvester/test_farmer_harvester.py index 3587339809..43fba5c797 100644 --- a/tests/farmer_harvester/test_farmer_harvester.py +++ b/tests/farmer_harvester/test_farmer_harvester.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import pytest diff --git a/tests/generator/config.py b/tests/generator/config.py index 7f9e1e1a76..562db3171a 100644 --- a/tests/generator/config.py +++ b/tests/generator/config.py @@ -1 +1,3 @@ +from __future__ import annotations + parallel = True diff --git a/tests/plot_sync/config.py b/tests/plot_sync/config.py index 235efb181c..9d6e160fe6 100644 --- a/tests/plot_sync/config.py +++ b/tests/plot_sync/config.py @@ -1,2 +1,4 @@ +from __future__ import annotations + parallel = True checkout_blocks_and_plots = True diff --git a/tests/plot_sync/test_delta.py b/tests/plot_sync/test_delta.py index 057e449bda..8f7779abb2 100644 --- a/tests/plot_sync/test_delta.py +++ b/tests/plot_sync/test_delta.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from typing import List diff --git a/tests/plot_sync/test_plot_sync.py b/tests/plot_sync/test_plot_sync.py index 1a6d5faa66..05e8c755e3 100644 --- a/tests/plot_sync/test_plot_sync.py +++ b/tests/plot_sync/test_plot_sync.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import functools from dataclasses import dataclass, field, replace diff --git a/tests/plot_sync/test_receiver.py b/tests/plot_sync/test_receiver.py index 1234e68dde..b29114652a 100644 --- a/tests/plot_sync/test_receiver.py +++ b/tests/plot_sync/test_receiver.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses import logging import random diff --git a/tests/plot_sync/test_sender.py b/tests/plot_sync/test_sender.py index dc7f867b01..a8c1fb3468 100644 --- a/tests/plot_sync/test_sender.py +++ b/tests/plot_sync/test_sender.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pytest from chia.plot_sync.exceptions import AlreadyStartedError, InvalidConnectionTypeError diff --git a/tests/plot_sync/test_sync_simulated.py b/tests/plot_sync/test_sync_simulated.py index 9cc91d019e..581d3ea625 100644 --- a/tests/plot_sync/test_sync_simulated.py +++ b/tests/plot_sync/test_sync_simulated.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import functools import logging diff --git a/tests/plot_sync/util.py b/tests/plot_sync/util.py index 2c63c40308..c56de2b5c1 100644 --- a/tests/plot_sync/util.py +++ b/tests/plot_sync/util.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import time from dataclasses import dataclass from secrets import token_bytes diff --git a/tests/plotting/config.py b/tests/plotting/config.py index b0a0afced8..afc9441517 100644 --- a/tests/plotting/config.py +++ b/tests/plotting/config.py @@ -1,3 +1,5 @@ +from __future__ import annotations + parallel = True install_timelord = False checkout_blocks_and_plots = True diff --git a/tests/plotting/test_plot_manager.py b/tests/plotting/test_plot_manager.py index 4fa4111f63..27adea53c7 100644 --- a/tests/plotting/test_plot_manager.py +++ b/tests/plotting/test_plot_manager.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import sys import time diff --git a/tests/plotting/util.py b/tests/plotting/util.py index f7fae513c3..ba32d24f1f 100644 --- a/tests/plotting/util.py +++ b/tests/plotting/util.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path from typing import List diff --git a/tests/pools/config.py b/tests/pools/config.py index 244e435f0e..e74790b71f 100644 --- a/tests/pools/config.py +++ b/tests/pools/config.py @@ -1,3 +1,5 @@ +from __future__ import annotations + parallel = 2 job_timeout = 60 checkout_blocks_and_plots = True diff --git a/tests/pools/test_pool_wallet.py b/tests/pools/test_pool_wallet.py index 8f103bc853..3d57d9ae5f 100644 --- a/tests/pools/test_pool_wallet.py +++ b/tests/pools/test_pool_wallet.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from pathlib import Path from typing import Any, List, Optional, cast diff --git a/tests/setup_services.py b/tests/setup_services.py index fefc9bdc30..06f1c3f48b 100644 --- a/tests/setup_services.py +++ b/tests/setup_services.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import logging import signal diff --git a/tests/simulation/config.py b/tests/simulation/config.py index c983484401..9c4461adbf 100644 --- a/tests/simulation/config.py +++ b/tests/simulation/config.py @@ -1,3 +1,5 @@ +from __future__ import annotations + job_timeout = 60 install_timelord = True checkout_blocks_and_plots = True diff --git a/tests/simulation/test_start_simulator.py b/tests/simulation/test_start_simulator.py index b001cbcccc..e5492c243b 100644 --- a/tests/simulation/test_start_simulator.py +++ b/tests/simulation/test_start_simulator.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio from pathlib import Path from typing import Any, AsyncGenerator, Dict, Optional, Tuple diff --git a/tests/tools/config.py b/tests/tools/config.py index 7f9e1e1a76..562db3171a 100644 --- a/tests/tools/config.py +++ b/tests/tools/config.py @@ -1 +1,3 @@ +from __future__ import annotations + parallel = True diff --git a/tests/tools/test_full_sync.py b/tests/tools/test_full_sync.py index b4f8c097b9..06e19750c7 100644 --- a/tests/tools/test_full_sync.py +++ b/tests/tools/test_full_sync.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +from __future__ import annotations + import asyncio import os from pathlib import Path diff --git a/tests/tools/test_run_block.py b/tests/tools/test_run_block.py index 48c1548783..37b684cf11 100644 --- a/tests/tools/test_run_block.py +++ b/tests/tools/test_run_block.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import json from pathlib import Path from typing import List diff --git a/tests/util/alert_server.py b/tests/util/alert_server.py index 4f0f2d7ad7..74e326ac35 100644 --- a/tests/util/alert_server.py +++ b/tests/util/alert_server.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import argparse import asyncio import logging diff --git a/tests/util/config.py b/tests/util/config.py index 93f77cd99a..2a99285c7c 100644 --- a/tests/util/config.py +++ b/tests/util/config.py @@ -1,2 +1,4 @@ +from __future__ import annotations + parallel = True job_timeout = 60 diff --git a/tests/util/gen_ssl_certs.py b/tests/util/gen_ssl_certs.py index 753114414c..7c3b8576a3 100644 --- a/tests/util/gen_ssl_certs.py +++ b/tests/util/gen_ssl_certs.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path from typing import Optional diff --git a/tests/util/generator_tools_testing.py b/tests/util/generator_tools_testing.py index 3f7b95e7ea..9fecf6969a 100644 --- a/tests/util/generator_tools_testing.py +++ b/tests/util/generator_tools_testing.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import List, Tuple from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions diff --git a/tests/util/protocol_messages_json.py b/tests/util/protocol_messages_json.py index 8febe459fa..8aa3bea604 100644 --- a/tests/util/protocol_messages_json.py +++ b/tests/util/protocol_messages_json.py @@ -1,4 +1,6 @@ # this file is generated by build_network_protocol_files.py +from __future__ import annotations + from typing import Any, Dict new_signage_point_json: Dict[str, Any] = { diff --git a/tests/util/rpc.py b/tests/util/rpc.py index 0164a4f3ee..16a0525fed 100644 --- a/tests/util/rpc.py +++ b/tests/util/rpc.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.rpc.rpc_client import RpcClient from chia.rpc.rpc_server import RpcApiProtocol diff --git a/tests/util/temp_file.py b/tests/util/temp_file.py index e38906fa71..cc28d04370 100644 --- a/tests/util/temp_file.py +++ b/tests/util/temp_file.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import contextlib import tempfile from pathlib import Path diff --git a/tests/util/test_chunks.py b/tests/util/test_chunks.py index 2c4383ab3a..0ee081fd11 100644 --- a/tests/util/test_chunks.py +++ b/tests/util/test_chunks.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.util.chunks import chunks diff --git a/tests/util/test_full_block_utils.py b/tests/util/test_full_block_utils.py index 4849cb4f06..05c5f15ef9 100644 --- a/tests/util/test_full_block_utils.py +++ b/tests/util/test_full_block_utils.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import random from typing import Generator, Iterator, List, Optional diff --git a/tests/util/test_network_protocol_json.py b/tests/util/test_network_protocol_json.py index 72dee0140c..c51d9d259f 100644 --- a/tests/util/test_network_protocol_json.py +++ b/tests/util/test_network_protocol_json.py @@ -1,5 +1,7 @@ # this file is generated by build_network_protocol_files.py +from __future__ import annotations + from tests.util.network_protocol_data import * # noqa: F403 from tests.util.protocol_messages_json import * # noqa: F403 diff --git a/tests/util/test_network_protocol_test.py b/tests/util/test_network_protocol_test.py index ce6ac51dc8..8263f8346a 100644 --- a/tests/util/test_network_protocol_test.py +++ b/tests/util/test_network_protocol_test.py @@ -1,4 +1,6 @@ # flake8: noqa +from __future__ import annotations + from typing import Any, List, Set from chia.protocols import ( diff --git a/tests/util/test_paginator.py b/tests/util/test_paginator.py index 9ffb4814e6..1277d41d29 100644 --- a/tests/util/test_paginator.py +++ b/tests/util/test_paginator.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from math import ceil from typing import List, Type diff --git a/tests/util/wallet_is_synced.py b/tests/util/wallet_is_synced.py index 91e32f4dd7..535fe73f98 100644 --- a/tests/util/wallet_is_synced.py +++ b/tests/util/wallet_is_synced.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import List from chia.full_node.full_node_api import FullNodeAPI diff --git a/tests/wallet/cat_wallet/config.py b/tests/wallet/cat_wallet/config.py index 671807f010..1dd2548084 100644 --- a/tests/wallet/cat_wallet/config.py +++ b/tests/wallet/cat_wallet/config.py @@ -1,3 +1,5 @@ # flake8: noqa: E501 +from __future__ import annotations + job_timeout = 50 checkout_blocks_and_plots = True diff --git a/tests/wallet/cat_wallet/test_cat_outer_puzzle.py b/tests/wallet/cat_wallet/test_cat_outer_puzzle.py index 115c2c3dea..4e67300d54 100644 --- a/tests/wallet/cat_wallet/test_cat_outer_puzzle.py +++ b/tests/wallet/cat_wallet/test_cat_outer_puzzle.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Optional import pytest diff --git a/tests/wallet/cat_wallet/test_trades.py b/tests/wallet/cat_wallet/test_trades.py index 55a0d167cf..9a66b30945 100644 --- a/tests/wallet/cat_wallet/test_trades.py +++ b/tests/wallet/cat_wallet/test_trades.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio from secrets import token_bytes from typing import Any, Dict, List diff --git a/tests/wallet/config.py b/tests/wallet/config.py index dd660d39ef..75072b3c73 100644 --- a/tests/wallet/config.py +++ b/tests/wallet/config.py @@ -1,4 +1,6 @@ # flake8: noqa: E501 +from __future__ import annotations + job_timeout = 40 parallel = True checkout_blocks_and_plots = True diff --git a/tests/wallet/db_wallet/config.py b/tests/wallet/db_wallet/config.py index 0257db4372..0bc8434702 100644 --- a/tests/wallet/db_wallet/config.py +++ b/tests/wallet/db_wallet/config.py @@ -1 +1,3 @@ +from __future__ import annotations + checkout_blocks_and_plots = True diff --git a/tests/wallet/db_wallet/test_db_graftroot.py b/tests/wallet/db_wallet/test_db_graftroot.py index f4d873e5dc..82b2867ccb 100644 --- a/tests/wallet/db_wallet/test_db_graftroot.py +++ b/tests/wallet/db_wallet/test_db_graftroot.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Dict, List, Tuple import pytest diff --git a/tests/wallet/db_wallet/test_dl_offers.py b/tests/wallet/db_wallet/test_dl_offers.py index ad6abb7c6b..00c0697e93 100644 --- a/tests/wallet/db_wallet/test_dl_offers.py +++ b/tests/wallet/db_wallet/test_dl_offers.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses from typing import Any, List, Tuple diff --git a/tests/wallet/db_wallet/test_dl_wallet.py b/tests/wallet/db_wallet/test_dl_wallet.py index 23c75f85a0..2b4e72cfcc 100644 --- a/tests/wallet/db_wallet/test_dl_wallet.py +++ b/tests/wallet/db_wallet/test_dl_wallet.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import dataclasses from typing import Any, AsyncIterator, Iterator, List diff --git a/tests/wallet/did_wallet/config.py b/tests/wallet/did_wallet/config.py index 671807f010..1dd2548084 100644 --- a/tests/wallet/did_wallet/config.py +++ b/tests/wallet/did_wallet/config.py @@ -1,3 +1,5 @@ # flake8: noqa: E501 +from __future__ import annotations + job_timeout = 50 checkout_blocks_and_plots = True diff --git a/tests/wallet/nft_wallet/config.py b/tests/wallet/nft_wallet/config.py index 0257db4372..0bc8434702 100644 --- a/tests/wallet/nft_wallet/config.py +++ b/tests/wallet/nft_wallet/config.py @@ -1 +1,3 @@ +from __future__ import annotations + checkout_blocks_and_plots = True diff --git a/tests/wallet/nft_wallet/test_nft_1_offers.py b/tests/wallet/nft_wallet/test_nft_1_offers.py index 5ac8939d17..59509ad0e7 100644 --- a/tests/wallet/nft_wallet/test_nft_1_offers.py +++ b/tests/wallet/nft_wallet/test_nft_1_offers.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import logging from secrets import token_bytes diff --git a/tests/wallet/nft_wallet/test_nft_bulk_mint.py b/tests/wallet/nft_wallet/test_nft_bulk_mint.py index 6183540a33..3c1abf4466 100644 --- a/tests/wallet/nft_wallet/test_nft_bulk_mint.py +++ b/tests/wallet/nft_wallet/test_nft_bulk_mint.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio from secrets import token_bytes from typing import Any, Dict diff --git a/tests/wallet/nft_wallet/test_nft_lifecycle.py b/tests/wallet/nft_wallet/test_nft_lifecycle.py index 556ff4f698..5056f62761 100644 --- a/tests/wallet/nft_wallet/test_nft_lifecycle.py +++ b/tests/wallet/nft_wallet/test_nft_lifecycle.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import itertools from typing import List, Tuple diff --git a/tests/wallet/nft_wallet/test_nft_off_chain.py b/tests/wallet/nft_wallet/test_nft_off_chain.py index f5149d4dcb..0eec612251 100644 --- a/tests/wallet/nft_wallet/test_nft_off_chain.py +++ b/tests/wallet/nft_wallet/test_nft_off_chain.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Tuple import pytest diff --git a/tests/wallet/nft_wallet/test_nft_offers.py b/tests/wallet/nft_wallet/test_nft_offers.py index ea7bb83cf3..4372be9d0b 100644 --- a/tests/wallet/nft_wallet/test_nft_offers.py +++ b/tests/wallet/nft_wallet/test_nft_offers.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from secrets import token_bytes from typing import Any, Dict, Optional diff --git a/tests/wallet/nft_wallet/test_nft_puzzles.py b/tests/wallet/nft_wallet/test_nft_puzzles.py index dafc84c373..f750ef8fd4 100644 --- a/tests/wallet/nft_wallet/test_nft_puzzles.py +++ b/tests/wallet/nft_wallet/test_nft_puzzles.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from secrets import token_bytes from typing import Tuple diff --git a/tests/wallet/nft_wallet/test_nft_wallet.py b/tests/wallet/nft_wallet/test_nft_wallet.py index 677bb65f68..d26f170161 100644 --- a/tests/wallet/nft_wallet/test_nft_wallet.py +++ b/tests/wallet/nft_wallet/test_nft_wallet.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import time from typing import Any, Awaitable, Callable, Dict, List diff --git a/tests/wallet/nft_wallet/test_ownership_outer_puzzle.py b/tests/wallet/nft_wallet/test_ownership_outer_puzzle.py index bfe6d200aa..0a5a3ff4bb 100644 --- a/tests/wallet/nft_wallet/test_ownership_outer_puzzle.py +++ b/tests/wallet/nft_wallet/test_ownership_outer_puzzle.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Optional from clvm_tools.binutils import assemble diff --git a/tests/wallet/rpc/config.py b/tests/wallet/rpc/config.py index 0257db4372..0bc8434702 100644 --- a/tests/wallet/rpc/config.py +++ b/tests/wallet/rpc/config.py @@ -1 +1,3 @@ +from __future__ import annotations + checkout_blocks_and_plots = True diff --git a/tests/wallet/rpc/test_dl_wallet_rpc.py b/tests/wallet/rpc/test_dl_wallet_rpc.py index 28a7c08ddf..eb0e7fbf76 100644 --- a/tests/wallet/rpc/test_dl_wallet_rpc.py +++ b/tests/wallet/rpc/test_dl_wallet_rpc.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio import logging diff --git a/tests/wallet/rpc/test_wallet_rpc.py b/tests/wallet/rpc/test_wallet_rpc.py index 38040a95a6..68ada94bdc 100644 --- a/tests/wallet/rpc/test_wallet_rpc.py +++ b/tests/wallet/rpc/test_wallet_rpc.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses import json import logging diff --git a/tests/wallet/simple_sync/config.py b/tests/wallet/simple_sync/config.py index 0257db4372..0bc8434702 100644 --- a/tests/wallet/simple_sync/config.py +++ b/tests/wallet/simple_sync/config.py @@ -1 +1,3 @@ +from __future__ import annotations + checkout_blocks_and_plots = True diff --git a/tests/wallet/sync/config.py b/tests/wallet/sync/config.py index c478c63e00..3fbb3269e6 100644 --- a/tests/wallet/sync/config.py +++ b/tests/wallet/sync/config.py @@ -1,2 +1,4 @@ +from __future__ import annotations + job_timeout = 60 checkout_blocks_and_plots = True diff --git a/tests/wallet/sync/test_wallet_sync.py b/tests/wallet/sync/test_wallet_sync.py index c5b1a5285a..3616672401 100644 --- a/tests/wallet/sync/test_wallet_sync.py +++ b/tests/wallet/sync/test_wallet_sync.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import List, Optional, Set import pytest diff --git a/tests/wallet/test_address_type.py b/tests/wallet/test_address_type.py index 370bc555e7..1cf9529f7f 100644 --- a/tests/wallet/test_address_type.py +++ b/tests/wallet/test_address_type.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any, Dict import pytest diff --git a/tests/wallet/test_bech32m.py b/tests/wallet/test_bech32m.py index 7b1ef6ae84..858b976c3e 100644 --- a/tests/wallet/test_bech32m.py +++ b/tests/wallet/test_bech32m.py @@ -1,6 +1,8 @@ # Based on this specification from Pieter Wuille: # https://github.com/sipa/bips/blob/bip-bech32m/bip-bech32m.mediawiki +from __future__ import annotations + from chia.util.bech32m import bech32_decode diff --git a/tests/wallet/test_chialisp.py b/tests/wallet/test_chialisp.py index f3822cf466..8629e689d0 100644 --- a/tests/wallet/test_chialisp.py +++ b/tests/wallet/test_chialisp.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pytest from chia.wallet.chialisp import ( diff --git a/tests/wallet/test_coin_selection.py b/tests/wallet/test_coin_selection.py index 6d4ffcceef..754197713b 100644 --- a/tests/wallet/test_coin_selection.py +++ b/tests/wallet/test_coin_selection.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import time from random import randrange diff --git a/tests/wallet/test_nft_store.py b/tests/wallet/test_nft_store.py index 7504ca211d..bc61490fcb 100644 --- a/tests/wallet/test_nft_store.py +++ b/tests/wallet/test_nft_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pytest from chia.types.blockchain_format.coin import Coin diff --git a/tests/wallet/test_notifications.py b/tests/wallet/test_notifications.py index 5800181c0c..d76c423311 100644 --- a/tests/wallet/test_notifications.py +++ b/tests/wallet/test_notifications.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from secrets import token_bytes from typing import Any diff --git a/tests/wallet/test_offer_parsing_performance.py b/tests/wallet/test_offer_parsing_performance.py index 2f0bd7136e..3a5f735b0c 100644 --- a/tests/wallet/test_offer_parsing_performance.py +++ b/tests/wallet/test_offer_parsing_performance.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import cProfile from contextlib import contextmanager from typing import Iterator diff --git a/tests/wallet/test_puzzle_store.py b/tests/wallet/test_puzzle_store.py index bb5a565579..561a8aa112 100644 --- a/tests/wallet/test_puzzle_store.py +++ b/tests/wallet/test_puzzle_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from secrets import token_bytes import pytest diff --git a/tests/wallet/test_taproot.py b/tests/wallet/test_taproot.py index 318db153e1..c8fd413634 100644 --- a/tests/wallet/test_taproot.py +++ b/tests/wallet/test_taproot.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( DEFAULT_HIDDEN_PUZZLE, calculate_synthetic_offset, diff --git a/tests/wallet/test_transaction_store.py b/tests/wallet/test_transaction_store.py index 318ef2daeb..bc0a3cef04 100644 --- a/tests/wallet/test_transaction_store.py +++ b/tests/wallet/test_transaction_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses from secrets import token_bytes from typing import Any, List diff --git a/tests/wallet/test_wallet_coin_store.py b/tests/wallet/test_wallet_coin_store.py index 04c6cc9b5f..f2bbf03136 100644 --- a/tests/wallet/test_wallet_coin_store.py +++ b/tests/wallet/test_wallet_coin_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from secrets import token_bytes import pytest diff --git a/tests/wallet/test_wallet_node.py b/tests/wallet/test_wallet_node.py index 5ad6860b11..3f82ebdae1 100644 --- a/tests/wallet/test_wallet_node.py +++ b/tests/wallet/test_wallet_node.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import sys from pathlib import Path from typing import Any, Dict, Optional diff --git a/tests/wallet/test_wallet_retry.py b/tests/wallet/test_wallet_retry.py index 6768cfc03a..7ce0762e76 100644 --- a/tests/wallet/test_wallet_retry.py +++ b/tests/wallet/test_wallet_retry.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import asyncio from typing import Any, List, Optional, Tuple diff --git a/tests/wallet/test_wallet_trade_store.py b/tests/wallet/test_wallet_trade_store.py index d3f093a539..f64e8d0a7b 100644 --- a/tests/wallet/test_wallet_trade_store.py +++ b/tests/wallet/test_wallet_trade_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import time from secrets import token_bytes diff --git a/tests/wallet/test_wallet_user_store.py b/tests/wallet/test_wallet_user_store.py index 94590c2af7..ff938f63a9 100644 --- a/tests/wallet/test_wallet_user_store.py +++ b/tests/wallet/test_wallet_user_store.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pytest from chia.wallet.util.wallet_types import WalletType diff --git a/tests/weight_proof/config.py b/tests/weight_proof/config.py index 235efb181c..9d6e160fe6 100644 --- a/tests/weight_proof/config.py +++ b/tests/weight_proof/config.py @@ -1,2 +1,4 @@ +from __future__ import annotations + parallel = True checkout_blocks_and_plots = True diff --git a/tools/cpu_utilization.py b/tools/cpu_utilization.py index 6b11d82dfd..168cbc5f59 100644 --- a/tools/cpu_utilization.py +++ b/tools/cpu_utilization.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import time from dataclasses import dataclass from subprocess import check_call diff --git a/tools/generate_chain.py b/tools/generate_chain.py index 1a3ac3450d..34e2d75158 100644 --- a/tools/generate_chain.py +++ b/tools/generate_chain.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import cProfile import random import sqlite3 diff --git a/tools/run_block.py b/tools/run_block.py index adec1af5c7..776c6ff554 100644 --- a/tools/run_block.py +++ b/tools/run_block.py @@ -35,6 +35,8 @@ associated with the coin being spent. Condition Opcodes are verified by every cl and in this way they control whether a spend is valid or not. """ +from __future__ import annotations + import json from dataclasses import dataclass from pathlib import Path diff --git a/tools/test_constants.py b/tools/test_constants.py index f5225d65ac..397155eafe 100644 --- a/tools/test_constants.py +++ b/tools/test_constants.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from chia.consensus.default_constants import DEFAULT_CONSTANTS test_constants = DEFAULT_CONSTANTS.replace( diff --git a/tools/test_full_sync.py b/tools/test_full_sync.py index 17e5d2cdd0..0ef1da740b 100755 --- a/tools/test_full_sync.py +++ b/tools/test_full_sync.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +from __future__ import annotations + import asyncio import cProfile import logging