Commit Graph

27 Commits

Author SHA1 Message Date
Amine Khaldi 1904baff04
Annotate harvester_rpc_client.py (#15379)
Annotate harvester_rpc_client.py.
2023-06-21 18:13:34 -05:00
Amine Khaldi 290e9ecd3f
Annotate test_full_node_store.py (#15573)
Annotate test_full_node_store.py.
2023-06-21 16:16:53 -05:00
Amine Khaldi 4f2dec820a
Annotate test_coin_store.py (#15571)
Annotate test_coin_store.py.
2023-06-21 12:53:05 -05:00
Amine Khaldi 3a914cea92
Annotate test_block_store.py (#15569)
Annotate test_block_store.py.
2023-06-21 11:45:47 -05:00
Adam Kelly d196247456
Rephrase async contextmanager DBConnection to use asynccontextmanager (#15538)
* Rephrase async contextmanager DBConnection to use asynccontextmanager
https://docs.python.org/3/library/contextlib.html#contextlib.asynccontextmanager

* drop tests.util.db_connection from typecheck exclusions list
2023-06-16 16:42:14 -05:00
dustinface e7f8aa0827
seeder: Hint `crawler_api.py` (#15498) 2023-06-13 11:25:15 -05:00
dustinface a93a85e639
wallet: Hint `wallet.py` (#15362) 2023-06-09 05:11:23 -05:00
Kyle Altendorf 9e8d6ebd71
rework `LockQueue` as `PriorityMutex` (#14920)
* explore a simplification of the blockchain priority lock queue

* add some tests

* correct task tracking

* use time.perf_counter for better resolution on windows

* just count an integer for request order retention

* stop using time in the (new) tests as well

* add tests and a couple no covers

* less existing test refactoring

* use a sync PriorityQueue

* switch to deques

* address bugs and simplify priority to deque mapping

* remove unused attribute ._priority_type

* make LockQueu.create() not async

* explain the active element check on wait cancellation

* drop LockQueue._process()

* import final from typing_extensions

* rename LockQueue to PriorityMutex

* remove test from mypy exclusions

* clean up straggling lock references

* ignore test failure case line coverage

* add a monkeypatch test ;[

* remove queued callback feature

* remove todos
2023-06-07 14:08:45 -05:00
dustinface b2cbea84d9
wallet: Hint `puzzle_utils.py` (#15422) 2023-06-06 12:39:15 -05:00
dustinface ebc5f3c124
util: Improve `list_to_batches` (#15415)
* Make `list_to_batches` work with collections instead of lists only

* Move `to_batches` into `chia.util.misc`

* Only support `set` and `list`

* Drop `tests.generator.test_to_batches` exclusion

* Improve type restrictions and be more coverage friendly in tests
2023-06-06 12:00:07 -05:00
Amine Khaldi 2abc0e44ce
Annotate harvester_rpc_api.py (#15378)
* Annotate harvester_rpc_api.py.

* We no longer need to exclude chia.server.start_harvester.
2023-05-24 16:50:06 -05:00
Amine Khaldi 36bc639ed9
Annotate test_farmer_harvester_rpc.py (#15377)
Annotate test_farmer_harvester_rpc.py.
2023-05-24 16:49:53 -05:00
Adam Kelly e2ed6a4833
Typecheck tests/tools/test_full_sync.py (#14947)
* Typecheck tests/tools/test_full_sync.py

* Merge remote-tracking branch 'origin/main' into ak.typecheck-test_full_sync

* typecheck test_full_sync.py

* Revert "typecheck test_full_sync.py"

This reverts commit e5c0d9d565.

* Revert "Merge remote-tracking branch 'origin/main' into ak.typecheck-test_full_sync"

This reverts commit e5d0e57000.

* typecheck tests.toos.test_full_sync

---------

Co-authored-by: Earle Lowe <e.lowe@chia.net>
2023-05-23 19:53:20 -05:00
Adam Kelly 337cb312e1
Typecheck chia/wallet/secret_key_store.py (#14945)
* Typecheck chia/wallet/secret_key_store.py

* typecheck secret_key_store.py

---------

Co-authored-by: Earle Lowe <e.lowe@chia.net>
2023-05-23 19:53:01 -05:00
Adam Kelly 41e17cdec9
Typecheck node_height.py (#14940)
* Typecheck node_height.py

* typecheck node_height

* return false if peak is none per code review

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
2023-05-23 19:52:49 -05:00
Arvid Norberg ae934ec0a9
update build_network_protocol_files.py (#15345)
* update build_network_protocol_files.py to generate the mypy-compatible files (which were fixed already, but the generator script was not). Specifically, tests/util/test_network_protocol_files.py was changed manually. This makes it possible to rerun the generation without breaking mypy

* run build_network_protocol_files.py in CI to ensure its generated files are up-to-date

* fixup mypy exclusions
2023-05-23 14:30:07 -05:00
Adam Kelly d1e10ea920
Remove test_setproctitle.py from mypy exclusions (#14939)
* Remove test_setproctitle.py from mypy exclusions

* typecheck test_setproctitle.py

---------

Co-authored-by: Earle Lowe <e.lowe@chia.net>
2023-05-23 14:25:08 -05:00
Adam Kelly 30cfca9589
Typecheck log_exceptions.py (#14941)
* Typecheck log_exceptions.py

* typecheck log_exceptions

---------

Co-authored-by: Earle Lowe <e.lowe@chia.net>
2023-05-23 14:24:56 -05:00
Adam Kelly 696eb6c6d6
Typecheck chia/util/safe_cancel_task.py (#14943)
* Typecheck chia/util/safe_cancel_task.py

* typecheck safe_cancel_task.py

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
2023-05-23 14:24:44 -05:00
Amine Khaldi ef613df2f0
Annotate chia/plotters/chiapos.py (#15363)
Annotate chia/plotters/chiapos.py.
2023-05-23 12:01:37 -05:00
Amine Khaldi 5473c94a6b
Annotate chia/simulator/block_tools.py (#15349) 2023-05-23 10:09:45 -05:00
Amine Khaldi 37d87c99c1
Annotate test_farmer_harvester.py (#15350) 2023-05-23 06:08:12 -05:00
Amine Khaldi cf4fffdbea
Annotate farmer/farmer_api.py (#15347)
Annotate farmer/farmer_api.py.
2023-05-23 05:34:53 -05:00
Amine Khaldi e44b60c348
Annotate chia/timelord/iters_from_block.py (#15348) 2023-05-23 04:59:49 -05:00
dustinface 78f90410d1
mypy: Drop redundant exclusions (#15356) 2023-05-22 20:07:36 -05:00
Arvid Norberg b3b53e1657
fix timelord mypy type hints (#15351)
* fix mypy type hints for timelord

* fix mypy type annotation for timelord_state
2023-05-22 18:38:50 -05:00
dustinface ec5f85dfc4
mypy: Build `mypy.ini` config with exclusions dynamically (#15158)
* mypy: Build `mypy.ini` config with exclusions dynamically

* Apply suggestions from code review

* Revert suggested `check=True` because `mypy` is expected to fails here

* Only `read_text` once

* Fix exception message

* Don't `touch`

* More `joinpath`

* Revert `newline="\n"`, its python 3.10 only

See https://bugs.python.org/issue23706

* Apply suggestions

* Fail if new issues get introduced

* Print the newly introduces issues

* Handle error codes

* Add `write_file`

* Use `sys.executable`

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* `mypy_failures[:-1]`

* Add an example comment

* Improve failure check

* Drop exclusions after rebase

* Drop one more exclusion after another rebase

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-05-22 16:50:13 -05:00