refactor: update the repo to support the 1.0 specification#41
Open
arminhammer wants to merge 3 commits intoserverlessworkflow:mainfrom
Open
refactor: update the repo to support the 1.0 specification#41arminhammer wants to merge 3 commits intoserverlessworkflow:mainfrom
arminhammer wants to merge 3 commits intoserverlessworkflow:mainfrom
Conversation
Complete rewrite of the Python SDK to conform to the Serverless Workflow specification v1.0, replacing the previous v0.8 implementation. - Replace WorkflowValidator with automatic parsing validation - `base.py`: New base types (Duration, Error, Timeout, Input/Output, etc.) - `authentication.py`: OAuth2, OIDC, Bearer, Basic, Digest auth policies - `call_tasks.py`: HTTP, gRPC, OpenAPI, AsyncAPI, MCP function calls - `tasks.py`: Core task types (Do, Fork, For, Listen, Emit, Set, Switch, Try, Wait, Run, Raise) - `events.py`: Event consumption strategies and correlation - `retry.py`: Retry policies with backoff strategies - `endpoint.py`: Endpoint and catalog definitions - `draw.py`: Workflow visualization using Graphviz (930 lines) - `workflow.py`: Rewritten Workflow class with Document, Schedule, Use components - Replace Pipfile/pipenv with pyproject.toml/uv - Add pre-commit hooks configuration - Add specification submodule for validation testing - Update to Python 3.10+ - Configure ruff for linting/formatting, mypy for type checking - Modernize GitHub Actions workflow - Split into separate lint, test, build jobs - Add ruff linting and formatting checks - Add mypy type checking - Test matrix: Python 3.10, 3.11, 3.12 - Use uv for faster dependency management - Remove old v0.8 test examples (13 JSON files) - Add comprehensive v1.0 spec validation tests (1,748 lines) - Add visualization tests with 74 DOT fixtures - Test against official specification examples via submodule - Update README for v1.0 API with modern examples - Replace state-based examples with task-based patterns - Update installation instructions for uv - Document workflow visualization capabilities - Reference new test locations ## Breaking Changes - Complete API rewrite - no backwards compatibility with v0.8 - All state classes removed - WorkflowValidator removed (validation now automatic) - StateMachineHelper replaced with workflow.render_graph() Signed-off-by: Armin Graf <arminhammer@gmail.com>
6c766d6 to
738b6ad
Compare
Signed-off-by: Armin Graf <arminhammer@gmail.com>
Signed-off-by: Armin Graf <arminhammer@gmail.com>
1531f83 to
db70bc6
Compare
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.
Many thanks for submitting your Pull Request ❤️!
What this PR does / why we need it:
This PR addresses #26 . This repo has not been updated in quite some time, and the python SDK is not terribly useful at the moment because it is still pointing to 0.8. This PR updates the SDK to the 1.0 spec, and also updates the repo to use more modern python tooling and standards, like
pyproject.tomlanduv.This PR makes the following changes:
uvandpyproject.tomlruffandmypylinterpygraphvizwithpydotto remove a C++ compilation dependencyspecificationrepo as a git submodule-- add unit tests to validate parsing all examples
-- add unit tests to create all examples in python, and serialize correctly to the yaml examples
-- add unit tests to validate creating dot files for all examples
.pre-commit-hook.yamlfileSpecial notes for reviewers:
Apologies in advance for such a large PR! Given the nature of the move from 0.8 and 1.0, it was hard to rework the repo without reworking the entire codebase. I also acknowledge making some opinionated changes, so I welcome feedback if there are things that should be changed or addressed to more closely align to project goals.
Additional information (if needed):