Commit Graph

37 Commits

Author SHA1 Message Date
23622ea1a0 style: enforce consistent import block 2025-07-15 15:28:03 -04:00
6aeb217349 replace: attributes with cache cached_property 2025-07-15 14:59:34 -04:00
bdadec7519 ft. modernise py-libp2p (#618)
* fix pyproject.toml , add ruff

* rm lock

* make progress

* add poetry lock ignore

* fix type issues

* fix tcp type errors

* fix text example - type error - wrong args

* add setuptools to dev

* test ci

* fix docs build

* fix type issues for new_swarm & new_host

* fix types in gossipsub

* fix type issues in noise

* wip: factories

* revert factories

* fix more type issues

* more type fixes

* fix: add null checks for noise protocol initialization and key handling

* corrected argument-errors in peerId and Multiaddr in peer tests

* fix: Noice - remove redundant type casts in BaseNoiseMsgReadWriter

* fix: update test_notify.py to use SwarmFactory.create_batch_and_listen, fix type hints, and comment out ClosedStream assertions

* Fix type checks for pubsub module

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>

* Fix type checks for pubsub module-tests

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>

* noise: add checks for uninitialized protocol and key states in PatternXX

Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>

* pubsub: add None checks for optional fields in FloodSub and Pubsub

Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>

* Fix type hints and improve testing

Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>

* remove redundant checks

Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>

* fix build issues

* add optional to trio service

* fix types

* fix type errors

* Fix type errors

Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>

* fixed more-type checks in crypto and peer_data files

* wip: factories

* replaced union with optional

* fix: type-error in interp-utils and peerinfo

* replace pyright with pyrefly

* add pyrefly.toml

* wip: fix multiselect issues

* try typecheck

* base check

* mcache test fixes , typecheck ci update

* fix ci

* will this work

* minor fix

* use poetry

* fix wokflow

* use cache,fix err

* fix pyrefly.toml

* fix pyrefly.toml

* fix cache in ci

* deploy commit

* add main baseline

* update to v5

* improve typecheck ci (#14)

* fix typo

* remove holepunching code (#16)

* fix gossipsub typeerrors (#17)

* fix: ensure initiator user includes remote peer id in handshake (#15)

* fix ci (#19)

* typefix: custom_types | core/peerinfo/test_peer_info | io/abc | pubsub/floodsub | protocol_muxer/multiselect (#18)

* fix: Typefixes in PeerInfo  (#21)

* fix minor type issue (#22)

* fix type errors in pubsub (#24)

* fix: Minor typefixes in tests (#23)

* Fix failing tests for type-fixed test/pubsub (#8)

* move pyrefly & ruff to pyproject.toml & rm .project-template (#28)

* move the async_context file to tests/core

* move crypto test to crypto folder

* fix: some typefixes (#25)

* fix type errors

* fix type issues

* fix: update gRPC API usage in autonat_pb2_grpc.py (#31)

* md: typecheck ci

* rm comments

* clean up : from review suggestions

* use | None over Optional as per new python standards

* drop supporto for py3.9

* newsfragments

---------

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>
Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>
Co-authored-by: acul71 <luca.pisani@birdo.net>
Co-authored-by: kaneki003 <sakshamchauhan707@gmail.com>
Co-authored-by: sukhman <sukhmansinghsaluja@gmail.com>
Co-authored-by: varun-r-mallya <varunrmallya@gmail.com>
Co-authored-by: varunrmallya <100590632+varun-r-mallya@users.noreply.github.com>
Co-authored-by: lla-dane <abhinavagarwalla6@gmail.com>
Co-authored-by: Collins <ArtemisfowlX@protonmail.com>
Co-authored-by: Abhinav Agarwalla <120122716+lla-dane@users.noreply.github.com>
Co-authored-by: guha-rahul <52607971+guha-rahul@users.noreply.github.com>
Co-authored-by: Sukhman Singh <63765293+sukhman-sukh@users.noreply.github.com>
Co-authored-by: acul71 <34693171+acul71@users.noreply.github.com>
Co-authored-by: pacrob <5199899+pacrob@users.noreply.github.com>
2025-06-09 11:39:59 -06:00
94483714a3 run lint and fix errors, except mypy 2024-02-19 16:05:58 -07:00
0827d0d9ef add 2 more instances of formatting violations 2019-12-19 18:09:47 +01:00
794d2101e9 fixes #197 2019-12-17 11:00:45 +01:00
50ae439d20 remove friendly IDs 2019-09-07 11:04:20 -04:00
345e696a7d Add option to inline "short" public keys for peer IDs
Added to remain interoperable w/ the Go implementation
2019-09-03 13:14:04 -07:00
d35b8ffc64 Conform stream_id to go-mplex 2019-08-28 21:43:34 +08:00
44e5de636f Add "friendly" peer ID string representation for debugging 2019-08-24 22:38:26 +02:00
87d943aa39 Internalize the protobuf serialization to the concept of a Key
Given its use across various components of `libp2p` (not just peer IDs),
it makes the abstraction cleaner to pull the serialization into the
key class and expose the canonical serialization to bytes.
2019-08-20 19:01:36 +02:00
ab7653526f Code cleanup / formatting 2019-08-15 16:33:33 -07:00
6506079a36 Generate peer IDs according to the spec 2019-08-14 09:00:39 -07:00
f9e859a8e9 Clean up peer.ID 2019-08-14 09:00:39 -07:00
c8005c8113 Run isort in repo 2019-08-03 17:50:14 +08:00
bd8d45fbc1 Refactor ID to not use third-party type for cryptographic keys
Remove `ID.from_privkey` which would require specific knowledge per cryptosystem
2019-08-02 21:51:16 -07:00
2e94fcf56c Remove pylint:disable 2019-08-02 23:26:06 +08:00
ee290b2ac2 Fix missing asterisk 2019-08-02 16:48:32 +08:00
0173b5e0d9 Add ID.to_base58() and comparison against str type 2019-08-02 14:46:01 +08:00
924e965537 Change argument name of Network.listen and blakc format 2019-08-02 14:45:59 +08:00
f00e80bc25 Fix wrong peer id type used in KadPeerInfo 2019-08-02 14:42:10 +08:00
b928bdb356 Convert from base58/pubkey/privkey to class method 2019-08-02 14:42:10 +08:00
80481252ca Refactor ID to take in type bytes only 2019-08-02 14:42:10 +08:00
0ae9840928 Run black over repo 2019-07-31 15:00:12 -07:00
5e215901c0 Apply PR feedback 2019-07-30 23:41:28 +08:00
c4105688d1 Fix after rebase 2019-07-30 17:31:08 +08:00
2d4e23cfe2 Fix cyclic import and lint 2019-07-30 16:28:05 +08:00
a4a0d79f6d Improve import layout 2019-07-30 16:27:29 +08:00
f2de986c74 Add type hints to peer folder 2019-07-30 16:24:51 +08:00
93cf5a2c32 A roughly skeleton of floodsub.publish
Still need to ensure when to deliver to ourselves
2019-07-24 22:33:32 +08:00
a4529d827d Modify peer_id str 2019-05-22 11:37:07 -04:00
ae44c062df Remove truncating peerid when converting to string 2019-05-22 11:37:07 -04:00
159301306d Merge branch 'router-refactor' of https://github.com/libp2p/py-libp2p into router-refactor 2019-04-24 22:26:17 -04:00
7962060cc0 refactored routedhost into router passed to swarm 2019-04-24 22:17:35 -04:00
6c5bac53d7 refactored routedhost into router passed to swarm 2019-04-24 22:11:54 -04:00
e7424d3673 added RoutedHost and updated new_node to support it 2019-04-20 17:35:05 -04:00
ce6ddb27a9 Migrate to new project structure. 2019-01-09 21:38:56 +03:00