Releases: a76yyyy/ping-rs
Releases · a76yyyy/ping-rs
2.1.1
2.1.0
English
Added
- DNS pre-resolution support with ability to disable DNS resolution
- Custom DNS resolution timeout configuration
- Extended sync and async ping interfaces with DNS configuration options
- Extended streaming interfaces with DNS configuration support
- Comprehensive documentation for ping module and related error types
- Documentation for Python bindings ping functionality and streaming interfaces
- Rust code quality and style checking configuration (Clippy and Rust lints)
Changed
- Refactored positive integer conversion logic for improved parameter validation
- Optimized parameter validation with extracted conversion functions
- Enhanced build.rs with improved robustness for build environment variables
- Unified documentation comment formatting with consistent backtick usage for code identifiers
- Standardized string formatting to Rust 1.58+ inline variable syntax
- Improved code comments with consistent punctuation and spacing
- Introduced
DnsPreResolveOptionsin dedicatedsrc/types/options.rsmodule for DNS configuration - Reorganized ping execution logic: moved
execute_pingandexecute_ping_asyncfromplatformmodule to mainicmpmodule - Deprecated
platformmodule; usecrate::protocols::icmp::{execute_ping, execute_ping_async}instead
Fixed
- Fixed max_count conversion overflow error handling to prevent unwrap panics
- Improved error handling robustness in build configuration
简体中文
Added
- DNS 预解析支持,支持禁用 DNS 预解析功能
- 自定义 DNS 解析超时时间配置
- 扩展同步和异步 ping 接口,支持 DNS 配置选项
- 扩展流式接口,支持 DNS 配置
- 补充 ping 模块及相关错误类型的完整文档
- 添加 Python 绑定的 ping 功能及流式接口文档
- 新增 Rust 代码质量和风格检查配置(Clippy 和 Rust lints)
Changed
- 重构正整数转换逻辑,改进参数验证
- 优化参数验证,提取转换函数
- 增强 build.rs,提升构建环境变量的健壮性
- 统一文档注释格式,规范代码标识的反引号使用
- 统一字符串格式化为 Rust 1.58+ 的内嵌变量语法
- 优化代码注释的标点和空格规范
- 在独立的
src/types/options.rs模块中引入DnsPreResolveOptions用于 DNS 配置 - 重新组织 ping 执行逻辑:将
execute_ping和execute_ping_async从platform模块移至主icmp模块 - 标记
platform模块为废弃;改用crate::protocols::icmp::{execute_ping, execute_ping_async}
Fixed
- 修正 max_count 转换溢出时的错误处理,避免 unwrap 导致崩溃
- 改进构建配置中的错误处理健壮性
2.0.1
English
Fixed
- Ensure typing override compatibility on Python < 3.12 by importing
overridefromtyping_extensionsin stubs - Align
PingStreamiterator protocol in stubs: make__next__synchronous and add constructor parameters to match Rust implementation - Remove duplicate top-level stub to avoid drift; keep authoritative stub at
ping_rs/_ping_rs.pyi - Correct
PingResultstubs: convert nested variant constructors to__new__and annotate base with@disjoint_baseto improve typing and pattern matching
Changed
- Updated development/lint dependencies; add
typing_extensionsand refresh dependency set - CI: enable workflow concurrency cancellation to avoid duplicate runs on rapid pushes
- Release: derive changelog version by stripping leading
vfrom tag for changelog reader action - GitHub Release: treat tags containing
rcas prereleases (in addition toalpha/beta) - CI: unify continue-on-error settings to
falsefor stability - CI: simplify test/build matrices; temporarily drop free-threaded 3.13t and CPython 3.14 from testing
简体中文
Fixed(修复)
- 在 Python < 3.12 环境下,通过在存根中从
typing_extensions引入override以确保类型提示兼容性 - 对齐
PingStream的迭代协议存根:将__next__改为同步方法,并补全构造参数以匹配 Rust 实现 - 移除顶层重复的存根文件,保留
ping_rs/_ping_rs.pyi作为唯一权威存根,避免漂移 - 修正
PingResult存根:将嵌套变体的构造从__init__调整为__new__,并为基类添加@disjoint_base注解,改进类型检查与模式匹配
Changed(变更)
- 更新开发/校验相关依赖,新增
typing_extensions,并同步刷新依赖集合 - CI:新增并发控制(快速连续 push 时自动取消旧运行)以避免重复任务
- 发布:读取变更日志时从 tag 中去掉前缀
v以解析版本号 - GitHub Release:将包含
rc的 tag 视为预发布(补充alpha/beta) - CI:统一 continue-on-error 设置为
false,提升稳定性 - CI:简化测试/构建矩阵;暂时移除对 3.13t 与 CPython 3.14 的测试覆盖
v2.0.0
English
Added
- Enhanced comprehensive test coverage with async ping error handling and performance tests
- Added stress testing, memory usage, backpressure, and performance benchmark tests
- Enabled pytest parallel execution with
-n logicaloption - Added comprehensive async ping test coverage
- Added cross-platform architecture explanation
- Improved README with platform support details
Changed
- Unified timeout control across all ping operations
- Optimized async ping receiving logic, removed redundant blocking operations
- Refactored ICMP ping timeout calculation logic and result validation
- Migrated async ping result channels from blocking standard channels to Tokio async channels
- Simplified platform adaptation by using
pingerlibrary for all platforms - Adjusted test assertions to be more resilient
- Upgraded
pyo3and related libraries to version 0.27 - Upgraded
pyo3-logto version 0.13 - Upgraded
pingerto version 2.1.1 - Upgraded pre-commit-hooks version
- Adjusted Makefile pre-commit startup command
- Optimized pyproject.toml dependency configuration and classification information
Fixed
- Adjusted async multiple ping test timeout parameters and result assertions to avoid flaky tests
- Fixed Windows platform ping timeout packet count calculation
- Fixed async ping timeout handling - now attempts to receive remaining results before stopping
- Fixed ping timeout logic and cross-platform timeout calculation
- Adjusted ping default timeout to 1000ms
Removed
- Removed Windows-specific ping implementation and related utility code
- Removed IP resolution and timing-related Windows utility code
简体中文
Added
- 增强异步 ping 错误处理和性能测试的全面测试覆盖
- 新增压力测试、内存使用、背压和性能基准测试
- 启用 pytest 并行执行测试,使用
-n logical选项 - 新增全面的异步 ping 测试覆盖
- 新增跨平台架构说明
- 完善 README 中的平台支持详情
Changed
- 统一所有 ping 操作的超时控制机制
- 优化异步 ping 接收逻辑,移除多余的阻塞操作
- 重构 ICMP ping 超时计算逻辑和结果判断
- 将异步 ping 结果通道从阻塞标准通道迁移到 Tokio 异步通道
- 简化平台适配逻辑,统一使用
pinger库处理所有平台 - 调整测试断言,提高稳健性
- 升级
pyo3及相关库至 0.27 版本 - 升级
pyo3-log至 0.13 版本 - 升级
pinger至 2.1.1 版本 - 升级 pre-commit-hooks 版本
- 调整 Makefile 中 pre-commit 启动命令
- 优化 pyproject.toml 依赖配置和分类信息
Fixed
- 调整异步多次 ping 测试的超时参数和结果断言,避免测试偶发失败
- 修正 Windows 平台 ping 超时包数计算逻辑
- 修正异步 ping 超时处理 - 超时后先尝试接收剩余结果再停止
- 修正 ping 超时逻辑及跨平台超时计算
- 调整 ping 默认超时时间为 1000 毫秒
Removed
- 移除 Windows 平台专用 ping 实现及相关工具代码
- 移除 IP 解析和定时相关的 Windows 工具代码
v1.1.0
English
Added
- AsyncPinger class for executing asynchronous ping operations
- AsyncPingStream for native async/await support with async iteration
- Added
countparameter tocreate_ping_streamfunction - Added validation functions for count and timeout parameters
- Usage examples for PingStream and AsyncPingStream
- Basic usage examples demonstrating synchronous and asynchronous ping operations
- Added comprehensive usage examples for PingStream as iterator
- Added examples for AsyncPingStream async iteration
- Enhanced documentation for asynchronous ping operations
Changed
- Improved async ping capabilities and refined interfaces
- Refactored non-blocking receiver logic in PingStream
- Refactored sync_stream_example to remove async elements
- Updated CI configuration to run tests in parallel using
pytest-xdist - Conditionally compiled IP functions for Windows only
- Refactored Windows ping implementation for better clarity and maintainability
- Removed
psutildependency from pytest-xdist configuration - Updated version to 1.1.0
Fixed
- Added AsyncPinger to the export list in
__all__ - Improved error handling and input validation
- Removed redundant timeout assertion conditions
简体中文
Added
- AsyncPinger 类:用于执行异步 ping 操作
- AsyncPingStream:支持原生 async/await 的异步迭代
- 为
create_ping_stream函数添加count参数 - 新增 count 和 timeout 参数的验证函数
- 新增 PingStream 和 AsyncPingStream 的使用示例
- 新增基础使用示例,演示同步和异步 ping 操作
- 新增 PingStream 作为迭代器的全面使用示例
- 新增 AsyncPingStream 异步迭代示例
- 增强异步 ping 操作文档
Changed
- 改进异步 ping 功能并优化接口
- 重构 PingStream 中的非阻塞接收逻辑
- 重构 sync_stream_example,移除异步元素
- 更新 CI 配置,使用
pytest-xdist并行运行测试 - Windows 平台 IP 函数条件编译优化
- 重构 Windows ping 实现,提高代码清晰度和可维护性
- 移除 pytest-xdist 配置中的
psutil依赖 - 版本更新至 1.1.0
Fixed
- 将 AsyncPinger 添加到
__all__导出列表 - 改进错误处理和输入验证
- 移除冗余的超时断言条件
v1.0.0
English
Added
- Initial release of ping-rs
- Core ping functionality with Rust backend and Python bindings
- Synchronous ping operations (
ping_once,ping_multiple) - Non-blocking ping stream (
create_ping_stream,PingStream) - Windows-specific ping implementation using native ICMP
- Cross-platform support (Linux, macOS, Windows, BSD)
- Comprehensive test suite with pytest
- MIT License
- CI/CD pipeline with GitHub Actions
- Code coverage integration with Codecov
- PingResult types: Pong, Timeout, Unknown, PingExited
- Flexible API: Support for custom timeout, interval, and interface selection
- IPv4/IPv6 support: Optional protocol selection
- Type hints: Full type annotation support with
.pyistub files - Performance: Built with Rust for high performance
- Comprehensive README in English and Chinese
- API reference documentation
- Usage examples
- Architecture documentation
- PyO3 for Python-Rust bindings
- pinger library for cross-platform ping functionality
- tokio for async runtime
- serde for serialization
简体中文
Added
- ping-rs 首次正式发布
- 核心 ping 功能,采用 Rust 后端和 Python 绑定
- 同步 ping 操作(
ping_once、ping_multiple) - 非阻塞 ping 流(
create_ping_stream、PingStream) - Windows 平台专用 ping 实现,使用原生 ICMP
- 跨平台支持(Linux、macOS、Windows、BSD)
- 完整的 pytest 测试套件
- MIT 许可证
- GitHub Actions CI/CD 流水线
- Codecov 代码覆盖率集成
- PingResult 类型:Pong、Timeout、Unknown、PingExited
- 灵活的 API:支持自定义超时、间隔和网络接口选择
- IPv4/IPv6 支持:可选协议选择
- 类型提示:完整的类型注解支持,包含
.pyi存根文件 - 高性能:采用 Rust 构建,性能卓越
- 中英文全面的 README 文档
- API 参考文档
- 使用示例
- 架构文档
- PyO3:提供 Python-Rust 绑定
- pinger 库:跨平台 ping 功能
- tokio:异步运行时
- serde:序列化支持