update black to 23.3.0 (#14537)

* unpin black

* Update setup.py

* Update .pre-commit-config.yaml

* black

* black

* 23.3.0

* cleanup
This commit is contained in:
Kyle Altendorf 2023-04-04 13:50:58 -04:00 committed by GitHub
parent 05af2a7c43
commit b839dfa0c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 3 additions and 12 deletions

View File

@ -15,7 +15,7 @@ repos:
pass_filenames: false
additional_dependencies: [click~=7.1]
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks

View File

@ -81,7 +81,6 @@ def fake_block_record(block_height: uint32, timestamp: uint64) -> BenchBlockReco
async def run_mempool_benchmark() -> None:
coin_records: Dict[bytes32, CoinRecord] = {}
async def get_coin_record(coin_id: bytes32) -> Optional[CoinRecord]:

View File

@ -216,7 +216,6 @@ class Mempool:
removed_items: List[MempoolItemInfo] = []
if reason != MempoolRemoveReason.BLOCK_INCLUSION:
for spend_bundle_ids in chunks(items, SQLITE_MAX_VARIABLE_NUMBER):
args = ",".join(["?"] * len(spend_bundle_ids))
with self._db_conn:

View File

@ -41,7 +41,6 @@ def get_name_puzzle_conditions(
height: uint32,
constants: ConsensusConstants = DEFAULT_CONSTANTS,
) -> NPCResult:
if mempool_mode:
flags = MEMPOOL_MODE
elif height >= constants.SOFT_FORK_HEIGHT:

View File

@ -120,6 +120,7 @@ async def select_coins(
# These algorithms were based off of the algorithms in:
# https://murch.one/wp-content/uploads/2016/11/erhardt2016coinselection.pdf
# we use this to check if one of the coins exactly matches the target.
def check_for_exact_match(coin_list: List[Coin], target: uint64) -> Optional[Coin]:
for coin in coin_list:

View File

@ -58,7 +58,7 @@ dev_dependencies = [
"isort",
"flake8",
"mypy",
"black==22.10.0",
"black==23.3.0",
"aiohttp_cors", # For blackd
"ipython", # For asyncio debugging
"pyinstaller==5.8.0",

View File

@ -1927,7 +1927,6 @@ class TestBodyValidation:
expected = AddBlockResult.NEW_PEAK
async with make_empty_blockchain(constants) as b:
blocks = bt.get_consecutive_blocks(
3,
guarantee_transaction_block=True,
@ -2130,7 +2129,6 @@ class TestBodyValidation:
expected = rbr.NEW_PEAK
async with make_empty_blockchain(constants) as b:
blocks = bt.get_consecutive_blocks(
3,
guarantee_transaction_block=True,

View File

@ -24,7 +24,6 @@ async def test_multiple_register_same(get_daemon: WebSocketServer, bt: BlockTool
ssl_context=bt.get_daemon_ssl_context(),
max_msg_size=100 * 1024 * 1024,
) as ws:
service_name = "test_service"
data = {"service": service_name}
payload = create_payload("register_service", data, service_name, "daemon")
@ -52,7 +51,6 @@ async def test_multiple_register_different(get_daemon: WebSocketServer, bt: Bloc
ssl_context=bt.get_daemon_ssl_context(),
max_msg_size=100 * 1024 * 1024,
) as ws:
test_service_names = ["service1", "service2", "service3"]
for service_name in test_service_names:
@ -89,7 +87,6 @@ async def test_remove_connection(get_daemon: WebSocketServer, bt: BlockTools) ->
ssl_context=bt.get_daemon_ssl_context(),
max_msg_size=100 * 1024 * 1024,
) as ws:
test_service_names = ["service1", "service2", "service3", "service4", "service5"]
for service_name in test_service_names:

View File

@ -775,7 +775,6 @@ coins = make_test_coins()
],
)
def test_can_replace(existing_items: List[MempoolItem], new_item: MempoolItem, expected: bool) -> None:
removals = set(c.name() for c in new_item.spend_bundle.removals())
assert can_replace(set(existing_items), removals, new_item) == expected
@ -827,7 +826,6 @@ async def test_get_items_not_in_filter() -> None:
@pytest.mark.asyncio
async def test_total_mempool_fees() -> None:
coin_records: Dict[bytes32, CoinRecord] = {}
async def get_coin_record(coin_id: bytes32) -> Optional[CoinRecord]: