mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-10 23:20:55 +00:00
Merge branch 'main' into main
This commit is contained in:
2
Makefile
2
Makefile
@ -90,7 +90,7 @@ validate-newsfragments:
|
|||||||
check-docs: build-docs validate-newsfragments
|
check-docs: build-docs validate-newsfragments
|
||||||
|
|
||||||
build-docs:
|
build-docs:
|
||||||
sphinx-apidoc -o docs/ . setup.py "*conftest*" tests/
|
sphinx-apidoc -o docs/ . "*conftest*" tests/
|
||||||
$(MAKE) -C docs clean
|
$(MAKE) -C docs clean
|
||||||
$(MAKE) -C docs html
|
$(MAKE) -C docs html
|
||||||
$(MAKE) -C docs doctest
|
$(MAKE) -C docs doctest
|
||||||
|
|||||||
@ -3,6 +3,51 @@ Release Notes
|
|||||||
|
|
||||||
.. towncrier release notes start
|
.. towncrier release notes start
|
||||||
|
|
||||||
|
py-libp2p v0.2.8 (2025-06-10)
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
Breaking Changes
|
||||||
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
- The `NetStream.state` property is now async and requires `await`. Update any direct state access to use `await stream.state`. (`#300 <https://github.com/libp2p/py-libp2p/issues/300>`__)
|
||||||
|
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
~~~~~~~~
|
||||||
|
|
||||||
|
- Added proper state management and resource cleanup to `NetStream`, fixing memory leaks and improved error handling. (`#300 <https://github.com/libp2p/py-libp2p/issues/300>`__)
|
||||||
|
|
||||||
|
|
||||||
|
Improved Documentation
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
- Updated examples to automatically use random port, when `-p` flag is not given (`#661 <https://github.com/libp2p/py-libp2p/issues/661>`__)
|
||||||
|
|
||||||
|
|
||||||
|
Features
|
||||||
|
~~~~~~~~
|
||||||
|
|
||||||
|
- Allow passing `listen_addrs` to `new_swarm` to customize swarm listening behavior. (`#616 <https://github.com/libp2p/py-libp2p/issues/616>`__)
|
||||||
|
- Feature: Support for sending `ls` command over `multistream-select` to list supported protocols from remote peer.
|
||||||
|
This allows inspecting which protocol handlers a peer supports at runtime. (`#622 <https://github.com/libp2p/py-libp2p/issues/622>`__)
|
||||||
|
- implement AsyncContextManager for IMuxedStream to support async with (`#629 <https://github.com/libp2p/py-libp2p/issues/629>`__)
|
||||||
|
- feat: add method to compute time since last message published by a peer and remove fanout peers based on ttl. (`#636 <https://github.com/libp2p/py-libp2p/issues/636>`__)
|
||||||
|
- implement blacklist management for `pubsub.Pubsub` with methods to get, add, remove, check, and clear blacklisted peer IDs. (`#641 <https://github.com/libp2p/py-libp2p/issues/641>`__)
|
||||||
|
- fix: remove expired peers from peerstore based on TTL (`#650 <https://github.com/libp2p/py-libp2p/issues/650>`__)
|
||||||
|
|
||||||
|
|
||||||
|
Internal Changes - for py-libp2p Contributors
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
- Modernizes several aspects of the project, notably using ``pyproject.toml`` for project info instead of ``setup.py``, using ``ruff`` to replace several separate linting tools, and ``pyrefly`` in addition to ``mypy`` for typing. Also includes changes across the codebase to conform to new linting and typing rules. (`#618 <https://github.com/libp2p/py-libp2p/issues/618>`__)
|
||||||
|
|
||||||
|
|
||||||
|
Removals
|
||||||
|
~~~~~~~~
|
||||||
|
|
||||||
|
- Removes support for python 3.9 and updates some code conventions, notably using ``|`` operator in typing instead of ``Optional`` or ``Union`` (`#618 <https://github.com/libp2p/py-libp2p/issues/618>`__)
|
||||||
|
|
||||||
|
|
||||||
py-libp2p v0.2.7 (2025-05-22)
|
py-libp2p v0.2.7 (2025-05-22)
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,12 @@ from libp2p.peer.peerinfo import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
PROTOCOL_ID = TProtocol("/echo/1.0.0")
|
PROTOCOL_ID = TProtocol("/echo/1.0.0")
|
||||||
|
MAX_READ_LEN = 2**32 - 1
|
||||||
|
|
||||||
|
|
||||||
async def _echo_stream_handler(stream: INetStream) -> None:
|
async def _echo_stream_handler(stream: INetStream) -> None:
|
||||||
# Wait until EOF
|
# Wait until EOF
|
||||||
msg = await stream.read()
|
msg = await stream.read(MAX_READ_LEN)
|
||||||
await stream.write(msg)
|
await stream.write(msg)
|
||||||
await stream.close()
|
await stream.close()
|
||||||
|
|
||||||
@ -72,10 +73,8 @@ async def run(port: int, destination: str, seed: int | None = None) -> None:
|
|||||||
msg = b"hi, there!\n"
|
msg = b"hi, there!\n"
|
||||||
|
|
||||||
await stream.write(msg)
|
await stream.write(msg)
|
||||||
# TODO: check why the stream is closed after the first write ???
|
|
||||||
# Notify the other side about EOF
|
|
||||||
await stream.close()
|
|
||||||
response = await stream.read()
|
response = await stream.read()
|
||||||
|
await stream.close()
|
||||||
|
|
||||||
print(f"Sent: {msg.decode('utf-8')}")
|
print(f"Sent: {msg.decode('utf-8')}")
|
||||||
print(f"Got: {response.decode('utf-8')}")
|
print(f"Got: {response.decode('utf-8')}")
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
The `NetStream.state` property is now async and requires `await`. Update any direct state access to use `await stream.state`.
|
|
||||||
@ -1 +0,0 @@
|
|||||||
Added proper state management and resource cleanup to `NetStream`, fixing memory leaks and improved error handling.
|
|
||||||
@ -1 +0,0 @@
|
|||||||
Allow passing `listen_addrs` to `new_swarm` to customize swarm listening behavior.
|
|
||||||
@ -1 +0,0 @@
|
|||||||
Modernizes several aspects of the project, notably using ``pyproject.toml`` for project info instead of ``setup.py``, using ``ruff`` to replace several separate linting tools, and ``pyrefly`` in addition to ``mypy`` for typing. Also includes changes across the codebase to conform to new linting and typing rules.
|
|
||||||
@ -1 +0,0 @@
|
|||||||
Removes support for python 3.9 and updates some code conventions, notably using ``|`` operator in typing instead of ``Optional`` or ``Union``
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
Feature: Support for sending `ls` command over `multistream-select` to list supported protocols from remote peer.
|
|
||||||
This allows inspecting which protocol handlers a peer supports at runtime.
|
|
||||||
@ -1 +0,0 @@
|
|||||||
implement AsyncContextManager for IMuxedStream to support async with
|
|
||||||
@ -1 +0,0 @@
|
|||||||
feat: add method to compute time since last message published by a peer and remove fanout peers based on ttl.
|
|
||||||
@ -1 +0,0 @@
|
|||||||
implement blacklist management for `pubsub.Pubsub` with methods to get, add, remove, check, and clear blacklisted peer IDs.
|
|
||||||
@ -1 +0,0 @@
|
|||||||
fix: remove expired peers from peerstore based on TTL
|
|
||||||
@ -1 +0,0 @@
|
|||||||
Updated examples to automatically use random port, when `-p` flag is not given
|
|
||||||
@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "libp2p"
|
name = "libp2p"
|
||||||
version = "0.2.7"
|
version = "0.2.8"
|
||||||
description = "libp2p: The Python implementation of the libp2p networking stack"
|
description = "libp2p: The Python implementation of the libp2p networking stack"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10, <4.0"
|
requires-python = ">=3.10, <4.0"
|
||||||
@ -187,7 +187,7 @@ name = "Removals"
|
|||||||
showcontent = true
|
showcontent = true
|
||||||
|
|
||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "0.2.7"
|
current_version = "0.2.8"
|
||||||
parse = """
|
parse = """
|
||||||
(?P<major>\\d+)
|
(?P<major>\\d+)
|
||||||
\\.(?P<minor>\\d+)
|
\\.(?P<minor>\\d+)
|
||||||
@ -221,12 +221,7 @@ values = ["alpha", "beta", "stable"]
|
|||||||
[tool.bumpversion.part.devnum]
|
[tool.bumpversion.part.devnum]
|
||||||
|
|
||||||
[[tool.bumpversion.files]]
|
[[tool.bumpversion.files]]
|
||||||
filename = "setup.py"
|
filename = "pyproject.toml"
|
||||||
search = "version=\"{current_version}\""
|
|
||||||
replace = "version=\"{new_version}\""
|
|
||||||
|
|
||||||
[[tool.bumpversion.files]]
|
|
||||||
filename = "pyproject.toml" # Keep pyproject.toml version in sync
|
|
||||||
search = 'version = "{current_version}"'
|
search = 'version = "{current_version}"'
|
||||||
replace = 'version = "{new_version}"'
|
replace = 'version = "{new_version}"'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user