Skip to content

Commit 3981fd3

Browse files
authored
Update README with AsyncOption documentation (#248)
* Update README with AsyncOption documentation * Fix README sync workflow
1 parent 3cbee91 commit 3981fd3

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

.github/workflows/readme-sync.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,18 @@ jobs:
2525
pipx install poetry
2626
poetry install --all-extras
2727
28-
- name: Create branch and update README
28+
- name: Generate README.md
2929
run: |
30-
# Create new branch
31-
git checkout -b readme-sync-${{ github.sha }}
32-
3330
# Generate new README.md
3431
poetry run ./make_readme.sh
3532
36-
# Setup git
37-
git config --local user.email "github-actions[bot]@users.noreply.github.com"
38-
git config --local user.name "github-actions[bot]"
39-
40-
# Commit changes if README.md was modified
41-
if ! git diff --quiet README.md; then
42-
git add README.md
43-
git commit -m "[auto] Sync README.md"
44-
git push origin readme-sync-${{ github.sha }}
45-
fi
46-
4733
- name: Create Pull Request
4834
uses: peter-evans/create-pull-request@v7
4935
with:
36+
commit-message: "[auto] Sync README.md from README.py"
5037
title: '[auto] Sync README.md from README.py'
5138
body: 'Auto-generated PR to sync README.md with changes from README.py'
52-
branch: readme-sync-${{ github.sha }}
39+
branch: "update-readme"
40+
delete-branch: true
5341
base: ${{ github.ref }}
5442
labels: automated,documentation

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,8 @@ The `AsyncOption[T]` type is the asynchronous version of `Option`. It allows you
496496
compose asynchronous operations that may return an optional value, using the Option type.
497497
This is particularly useful for handling optional values in asynchronous code, such as
498498
API calls that might not return a value, database queries that might not find a record,
499-
or any other I/O-bound tasks that might not produce a meaningful result.
499+
or any other I/O-bound tasks that might not produce a meaningful result. The AsyncOption
500+
builder was added in version 0.25.0.
500501

501502
Similar to the `Option` effect, AsyncOption enables short-circuiting but for asynchronous
502503
operations. If any part of the function yields `Nothing`, the function is short-circuited

README.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,8 @@ async def outer() -> AsyncGenerator[int, int]:
546546
compose asynchronous operations that may return an optional value, using the Option type.
547547
This is particularly useful for handling optional values in asynchronous code, such as
548548
API calls that might not return a value, database queries that might not find a record,
549-
or any other I/O-bound tasks that might not produce a meaningful result.
549+
or any other I/O-bound tasks that might not produce a meaningful result. The AsyncOption
550+
builder was added in version 0.25.0.
550551
551552
Similar to the `Option` effect, AsyncOption enables short-circuiting but for asynchronous
552553
operations. If any part of the function yields `Nothing`, the function is short-circuited

0 commit comments

Comments
 (0)