Skip to content

Commit

Permalink
fix: ipc output issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Dec 17, 2024
1 parent c9def0b commit 52688ec
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 52 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/publish_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ name: Publish Python Package

on:
push:
branches: [ main, test, develop ]
branches: [ main, develop ]
pull_request:
types:
- opened

env:
PACKAGE_NAME: crawlab-sdk
PYPI_REPOSITORY_URL: https://test.pypi.org/legacy/
PYPI_TEST_REPOSITORY_URL: https://test.pypi.org/legacy/

jobs:
build:
Expand Down Expand Up @@ -38,6 +36,10 @@ jobs:
poetry build
echo "version=$(poetry version -s)" >> $GITHUB_OUTPUT
- name: Run tests
run: |
python -m pytest tests/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -73,15 +75,6 @@ jobs:
id-token: write
if: needs.check_version.outputs.is_new_version == 'true'
steps:
- name: Configure repository URL
id: configure
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "repository_url=${{ env.PYPI_REPOSITORY_URL }}" >> $GITHUB_OUTPUT
else
echo "repository_url=${{ env.PYPI_TEST_REPOSITORY_URL }}" >> $GITHUB_OUTPUT
fi
- name: Download artifact
uses: actions/download-artifact@v4
with:
Expand Down
37 changes: 0 additions & 37 deletions compile_grpc.sh

This file was deleted.

2 changes: 1 addition & 1 deletion crawlab/core/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ def save_items(items: Iterable[dict]):
type="data",
payload=items,
)
sys.stdout.writelines([msg.model_dump_json()])
sys.stdout.write(msg.model_dump_json() + "\n")
sys.stdout.flush()
2 changes: 1 addition & 1 deletion crawlab/entity/ipc_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

class IPCMessage(BaseModel):
type: Optional[Literal["data", "log"]] = Field(description="Message type")
ipc: bool = Field(description="The message is IPC", default=True)
payload: Iterable[dict] | dict = Field(description="Message payload")
ipc: bool = Field(description="The message is IPC", default=True)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "crawlab-sdk"
version = "0.7.0rc4"
version = "0.7.0rc5"
description = "Python SDK for Crawlab"
authors = ["Marvin Zhang <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 52688ec

Please sign in to comment.