feat: P0+P1 improvements — bug fix, types, functional methods, async support#2
Open
mr-wuliu wants to merge 6 commits into
Open
feat: P0+P1 improvements — bug fix, types, functional methods, async support#2mr-wuliu wants to merge 6 commits into
mr-wuliu wants to merge 6 commits into
Conversation
…ods, async support P0 fixes: - Fix pipeline.py bug: return value → return attr for non-callable value attrs - Add Generic[T] type annotations across all modules - Add from __future__ import annotations for forward references - Expand test coverage to 83% with direct tests for CommonChain dunders P1 features: - Add functional composition: .map(), .filter(), .flat_map(), .inspect(), .tap() - Add async support: @async_chainable, @async_pipeline with __await__ - Add py.typed marker for PEP 561 compliance - Update __init__.py to export all 4 decorators 34 tests passing, 83% coverage.
- Add [tool.basedpyright] config (strict mode) with justified suppressions for proxy-pattern-inherent Any, override, and unknown lambda warnings - Fix map() return type error with targeted pyright ignore comment - Create tests/test_types.py with TYPE_CHECKING guards for public API type inference verification (chainable, pipeline, async, functional) - Add basedpyright type-check step to CI workflow basedpyright: 0 errors, 0 warnings, 0 notes pytest: 34/34 passed
@chainable and @pipeline now auto-detect coroutines via inspect.iscoroutine() and return AsyncChainableResult/AsyncPipelineResult accordingly. - Add @overload signatures for proper type narrowing (sync vs async) - Remove async_chainable/async_pipeline from __all__ - Update tests to use @chainable/@pipeline on async methods - async_chainable.py/async_pipeline.py kept for internal result classes __all__ = ['chainable', 'pipeline'] basedpyright: 0 diagnostics, pytest: 34/34 passed
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pipeline.pyreturnedvalueinstead ofattrfor non-callable value attributes (inconsistent withChainableResult)Generic[T]toCommonChain,ChainableResult,PipelineResult; full type hints across all modules withfrom __future__ import annotationsCommonChaindunders (arithmetic, comparison, unary, conversion), edge cases.map(),.filter(),.flat_map(),.inspect(),.tap()toCommonChain— accessible through both@chainableand@pipelinechains@async_chainableand@async_pipelinedecorators withAsyncChainableResult/AsyncPipelineResult— coroutine chaining with__await__for final resolutionpy.typedmarker, updated__init__.pyexportsTest plan