Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
107 changes: 107 additions & 0 deletions .github/workflows/publish-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Publish Python package

on:
workflow_dispatch:
inputs:
version:
type: string
required: true
description: >
PEP 440 version to publish (e.g. 0.1.0, 1.0.0a1, 1.0.0rc1). See
https://packaging.python.org/en/latest/specifications/version-specifiers/

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASE_COMMIT_WRITE_TOKEN }}

- name: Install uv
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1

- name: Validate version
env:
VERSION: ${{ inputs.version }}
run: |
uv run --with packaging --no-project -- python - <<'PY'
import os
import sys
from packaging.version import Version, InvalidVersion

version = os.environ["VERSION"]

try:
parsed = Version(version)
except InvalidVersion:
print(f"::error::'{version}' is not a valid PEP 440 version. "
"Examples: 0.1.0, 1.0.0a1, 1.0.0b2, 1.0.0rc1, 1.0.0.post1, 1.0.0.dev1")
raise SystemExit(1)

if str(parsed) != version:
print(f"::error::Version must be in canonical form. "
f"Got '{version}', expected '{parsed}'.")
raise SystemExit(1)

if len(parsed.release) != 3:
print("::error::Version must use exactly three release components: X.Y.Z "
"(examples: 0.1.0, 1.0.0rc1, 1.0.0.post1, 1.0.0.dev1).")
raise SystemExit(1)

if parsed.epoch != 0:
print("::error::Epochs are not allowed for releases.")
raise SystemExit(1)

if parsed.local is not None:
print("::error::Local versions (+...) are not allowed for releases.")
raise SystemExit(1)

print(f"Validated version: {version}")
PY

- name: Setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"

- name: Set version in pyproject.toml
working-directory: packages/liveblocks-python
env:
VERSION: ${{ inputs.version }}
run: |
sed -i "s/^version = .*/version = \"$VERSION\"/" pyproject.toml

- name: Set version in codegen config
working-directory: packages/liveblocks-python-codegen
env:
VERSION: ${{ inputs.version }}
run: |
sed -i "s/^package_version_override: .*/package_version_override: $VERSION/" config.yaml

- name: Commit and push version bump
env:
VERSION: ${{ inputs.version }}
run: |
git add packages/liveblocks-python/pyproject.toml packages/liveblocks-python-codegen/config.yaml
git commit -m "Bump liveblocks-python to $VERSION"
git push origin HEAD

- name: Build and publish
working-directory: packages/liveblocks-python
run: |
uv build
uv publish --trusted-publishing always

- name: Create release tag
env:
VERSION: ${{ inputs.version }}
GIT_TAG: python-v${{ inputs.version }}
run: |
git tag "$GIT_TAG" -m "Release liveblocks-python $VERSION"
git push origin "$GIT_TAG"
91 changes: 91 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,94 @@ jobs:
if: needs.check_for_code_changes.outputs.changes == 'true'
run: npm run test:e2e
working-directory: packages/liveblocks-core

# Check that the generated Python SDK is up to date with the OpenAPI spec
python-sdk-sync:
runs-on: ubuntu-latest

permissions:
pull-requests: read

steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
python_sdk:
- 'docs/references/v2.openapi.json'
- 'packages/liveblocks-python-codegen/templates/**'
- 'packages/liveblocks-python-codegen/config.yaml'
- 'packages/liveblocks-python-codegen/generate.py'

- name: Checkout
if: steps.filter.outputs.python_sdk == 'true'
uses: actions/checkout@v4

- name: Install uv
if: steps.filter.outputs.python_sdk == 'true'
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1

- name: Regenerate Python SDK
if: steps.filter.outputs.python_sdk == 'true'
run: uv run python generate.py
working-directory: packages/liveblocks-python-codegen

- name: Check for uncommitted changes
if: steps.filter.outputs.python_sdk == 'true'
run: |
CHANGED=$(git status --porcelain packages/liveblocks-python)
if [ -n "$CHANGED" ]; then
echo "The generated Python SDK is out of date. Please run 'uv run python generate.py' in packages/liveblocks-python-codegen and commit the changes."
echo ""
echo "Changed files:"
echo "$CHANGED"
echo ""
git diff packages/liveblocks-python
exit 1
fi

# Python lint + tests with coverage
test-python:
runs-on: ubuntu-latest

permissions:
pull-requests: write

steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
python_sdk:
- 'packages/liveblocks-python/**'
- 'packages/liveblocks-python-codegen/**'

- name: Checkout
if: steps.filter.outputs.python_sdk == 'true'
uses: actions/checkout@v4

- name: Install uv
if: steps.filter.outputs.python_sdk == 'true'
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1

- name: Lint
if: steps.filter.outputs.python_sdk == 'true'
run: uvx ruff check .
working-directory: packages/liveblocks-python

- name: Run Python tests with coverage
if: steps.filter.outputs.python_sdk == 'true'
run:
uv run pytest --cov --cov-report=term-missing
--cov-report=xml:coverage.xml
working-directory: packages/liveblocks-python

- name: Post coverage report as PR comment
if:
steps.filter.outputs.python_sdk == 'true' && github.event_name ==
'pull_request'
uses: orgoro/coverage@3f13a558c5af7376496aa4848bf0224aead366ac # v3.2
with:
coverageFile: packages/liveblocks-python/coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
thresholdAll: 0.0
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## vNEXT (not yet released)

## v3.15.3

### `@liveblocks/react-ui`

- Add `showSubscription` prop to `Thread` to control whether to show the
thread’s subscription status.

## v3.15.2

### `@liveblocks/client`
Expand Down
7 changes: 7 additions & 0 deletions docs/pages/api-reference/liveblocks-react-ui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,13 @@ icon next to the item’s label.
>
Whether to show deleted comments.
</PropertiesListItem>
<PropertiesListItem
name="showSubscription"
type="boolean"
defaultValue="true"
>
Whether to show the thread’s subscription status.
</PropertiesListItem>
<PropertiesListItem
name="commentDropdownItems"
type="ReactNode | (props) => ReactNode"
Expand Down
14 changes: 6 additions & 8 deletions docs/pages/tools/dev-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,16 @@ supports other APIs. [Learn more](#Partially-supported-features).
| [Text editors](/docs/ready-made-features/multiplayer/text-editor) (Tiptap, BlockNote, Lexical) | ✅ ¹ |
| [Public key authentication](/docs/api-reference/liveblocks-react#LiveblocksProviderPublicKey) | ✅ |
| [Access token authentication](/docs/authentication/access-token) | ✅ |
| [ID token authentication](/docs/authentication) | |
| [Room Node.js methods](/docs/api-reference/liveblocks-node#Room) | ⚠️ ² |
| [Room REST APIs](/docs/api-reference/rest-api-endpoints#Room) | ⚠️ ² |
| [Comments](/docs/ready-made-features/comments) | ❌ ³ |
| [Notifications](/docs/ready-made-features/notifications) | ❌ ³ |
| [ID token authentication](/docs/authentication) | |
| [Room Node.js methods](/docs/api-reference/liveblocks-node#Room) | |
| [Room REST APIs](/docs/api-reference/rest-api-endpoints#Room) | |
| [Comments](/docs/ready-made-features/comments) | ❌ ² |
| [Notifications](/docs/ready-made-features/notifications) | ❌ ² |
| [AI Agents](/docs/ready-made-features/ai-agents) | ❌ |
| Other APIs | ❌ |

¹ <small>_Excluding features related to Comments and Notifications._</small>
² <small>_Basic room APIs are partially supported, but room permissions and
metadata are not fully implemented yet._</small>
³ <small>_Basic APIs will return dummy data, so you can still use the Liveblocks
² <small>_Basic APIs will return dummy data, so you can still use the Liveblocks
dev server to test other features in your app._</small>

## Set up the dev server
Expand Down
Loading
Loading