From b6dd817ded80678163c755fdd6bd64fcf13901bc Mon Sep 17 00:00:00 2001 From: Fangyin Cheng Date: Mon, 4 Nov 2024 17:20:56 +0800 Subject: [PATCH] ci(build): Release 0.1.3 --- .github/workflows/release-python-task.yml | 14 ++--- Cargo.lock | 10 ++-- Cargo.toml | 12 ++-- README.md | 6 +- bindings/python/Makefile | 59 +++++++++++++++++++ .../python/lyric-js-worker/pyproject.toml | 2 +- .../python/lyric-py-worker/pyproject.toml | 2 +- bindings/python/lyric-task/Makefile | 5 ++ bindings/python/lyric-task/pyproject.toml | 2 +- bindings/python/pyproject.toml | 5 +- bindings/python/requirements-dev.lock | 53 +++++++++++++++++ crates/Makefile | 6 ++ 12 files changed, 150 insertions(+), 26 deletions(-) create mode 100644 bindings/python/Makefile create mode 100644 bindings/python/lyric-task/Makefile diff --git a/.github/workflows/release-python-task.yml b/.github/workflows/release-python-task.yml index ff90da4..2bad208 100644 --- a/.github/workflows/release-python-task.yml +++ b/.github/workflows/release-python-task.yml @@ -1,13 +1,13 @@ name: Release Python Packages on: - release: - types: [published] - push: - branches: - - main - - master - pull_request: +# release: +# types: [published] +# push: +# branches: +# - main +# - master +# pull_request: workflow_dispatch: permissions: diff --git a/Cargo.lock b/Cargo.lock index 4e9ba5a..9a06f10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1478,7 +1478,7 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lyric" -version = "0.1.2" +version = "0.1.3" dependencies = [ "async-trait", "bollard", @@ -1507,7 +1507,7 @@ dependencies = [ [[package]] name = "lyric-py" -version = "0.1.2" +version = "0.1.3" dependencies = [ "anyhow", "async-trait", @@ -1533,7 +1533,7 @@ dependencies = [ [[package]] name = "lyric-rpc" -version = "0.1.2" +version = "0.1.3" dependencies = [ "async-trait", "lyric-utils", @@ -1546,7 +1546,7 @@ dependencies = [ [[package]] name = "lyric-utils" -version = "0.1.2" +version = "0.1.3" dependencies = [ "anyhow", "chrono", @@ -1562,7 +1562,7 @@ dependencies = [ [[package]] name = "lyric-wasm-runtime" -version = "0.1.2" +version = "0.1.3" dependencies = [ "anyhow", "async-stream", diff --git a/Cargo.toml b/Cargo.toml index dc903de..e2c7d16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ default-members = [ ] [workspace.package] -version = "0.1.2" +version = "0.1.3" authors = ["fangyinc "] edition = "2021" homepage = "https://github.com/fangyinc/lyric" @@ -44,8 +44,8 @@ tokio-stream = { version = "0.1.16", features = ["io-util"] } pyo3 = { version = "0.22.5" } python3-dll-a = "0.2.10" -lyric = { version = "0.1.2", path = "crates/lyric", default-features = false } -lyric-utils = { version = "0.1.2", path = "crates/lyric-utils", default-features = false } -lyric-rpc = { version = "0.1.2", path = "crates/lyric-rpc", default-features = false } -lyric-wasm-runtime = { version = "0.1.2", path = "crates/lyric-wasm-runtime", default-features = false } -lyric-py = { version = "0.1.2", path = "bindings/python/lyric-py", default-features = false } \ No newline at end of file +lyric = { version = "0.1.3", path = "crates/lyric", default-features = false } +lyric-utils = { version = "0.1.3", path = "crates/lyric-utils", default-features = false } +lyric-rpc = { version = "0.1.3", path = "crates/lyric-rpc", default-features = false } +lyric-wasm-runtime = { version = "0.1.3", path = "crates/lyric-wasm-runtime", default-features = false } +lyric-py = { version = "0.1.3", path = "bindings/python/lyric-py", default-features = false } \ No newline at end of file diff --git a/README.md b/README.md index 708f667..ba5eba9 100644 --- a/README.md +++ b/README.md @@ -17,19 +17,19 @@ A Rust-powered secure sandbox for multi-language code execution, leveraging WebA **Install Lyric via pip:** ```bash -pip install lyric-py +pip install "lyric-py>=0.1.3" ``` **Install default Python webassembly worker:** ```bash -pip install lyric-py-worker +pip install "lyric-py-worker>=0.1.3" ``` **Install default JavaScript webassembly worker:** ```bash -pip install lyric-js-worker +pip install "lyric-js-worker>=0.1.3" ``` ### Basic Usage diff --git a/bindings/python/Makefile b/bindings/python/Makefile new file mode 100644 index 0000000..1ae861b --- /dev/null +++ b/bindings/python/Makefile @@ -0,0 +1,59 @@ +.DEFAULT_GOAL := help + +# Define subproject paths +PY_WORKER_DIR = lyric-py-worker +JS_WORKER_DIR = lyric-js-worker +TASK_WORKER_DIR = lyric-task + +.PHONY: all +all: build ## Build all subprojects + +.PHONY: build +build: build-task build-py-worker build-js-worker ## Build all subprojects + +.PHONY: build-task +build-task: ## Build the task dependency + @echo "Building task..." + $(MAKE) -C $(TASK_WORKER_DIR) build + +.PHONY: build-py-worker +build-py-worker: ## Build the Python worker + @echo "Building Python worker..." + $(MAKE) -C $(PY_WORKER_DIR) build + + +.PHONY: build-js-worker +build-js-worker: ## Build the JavaScript worker + @echo "Building JavaScript worker..." + $(MAKE) -C $(JS_WORKER_DIR) build + +.PHONY: clean +clean: ## Clean all projects + @echo "Cleaning all projects..." + rm -rf dist + + +.PHONY: publish-pypi +publish-pypi: build ## Publish all packages to PyPI + @echo "Publishing to PyPI..." + @if [ -z "$(TWINE_USERNAME)" ] || [ -z "$(TWINE_PASSWORD)" ]; then \ + echo "Error: TWINE_USERNAME and TWINE_PASSWORD environment variables must be set"; \ + exit 1; \ + fi + @echo "Uploading all distributions from dist/" + twine upload dist/* + +.PHONY: publish-testpypi +publish-testpypi: build ## Publish all packages to TestPyPI + @echo "Publishing to TestPyPI..." + @if [ -z "$(TWINE_USERNAME)" ] || [ -z "$(TWINE_PASSWORD)" ]; then \ + echo "Error: TWINE_USERNAME and TWINE_PASSWORD environment variables must be set"; \ + exit 1; \ + fi + @echo "Uploading all distributions from dist/" + rye run twine upload --repository testpypi dist/* + +.PHONY: help +help: ## Display this help screen + @echo "Available commands:" + @grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort \ No newline at end of file diff --git a/bindings/python/lyric-js-worker/pyproject.toml b/bindings/python/lyric-js-worker/pyproject.toml index e972d85..00661ce 100644 --- a/bindings/python/lyric-js-worker/pyproject.toml +++ b/bindings/python/lyric-js-worker/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lyric-js-worker" -version = "0.1.2-rc1" +version = "0.1.3" description = "Add your description here" authors = [ { name = "Fangyin Cheng", email = "staneyffer@gmail.com" }, diff --git a/bindings/python/lyric-py-worker/pyproject.toml b/bindings/python/lyric-py-worker/pyproject.toml index 033c442..5e030b3 100644 --- a/bindings/python/lyric-py-worker/pyproject.toml +++ b/bindings/python/lyric-py-worker/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lyric-py-worker" -version = "0.1.2-rc1" +version = "0.1.3" description = "Add your description here" authors = [ { name = "Fangyin Cheng", email = "staneyffer@gmail.com" }, diff --git a/bindings/python/lyric-task/Makefile b/bindings/python/lyric-task/Makefile new file mode 100644 index 0000000..52164c0 --- /dev/null +++ b/bindings/python/lyric-task/Makefile @@ -0,0 +1,5 @@ +.DEFAULT_GOAL := help + +.PHONY: build +build: + rye build \ No newline at end of file diff --git a/bindings/python/lyric-task/pyproject.toml b/bindings/python/lyric-task/pyproject.toml index d8a0a21..b1eb47c 100644 --- a/bindings/python/lyric-task/pyproject.toml +++ b/bindings/python/lyric-task/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lyric-task" -version = "0.1.2-rc1" +version = "0.1.3" description = "Add your description here" authors = [ { name = "Fangyin Cheng", email = "staneyffer@gmail.com" }, diff --git a/bindings/python/pyproject.toml b/bindings/python/pyproject.toml index 1b1f25e..8888727 100644 --- a/bindings/python/pyproject.toml +++ b/bindings/python/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "python" -version = "0.1.2" +version = "0.1.3" description = "Add your description here" authors = [ { name = "Fangyin Cheng", email = "staneyffer@gmail.com" } @@ -19,7 +19,8 @@ dev-dependencies = [ "pytest>=7.0.0", "black>=23.0.0", "isort>=5.0.0", - "maturin>=1.7,<2.0" + "maturin>=1.7,<2.0", + "twine" ] [tool.rye.workspace] diff --git a/bindings/python/requirements-dev.lock b/bindings/python/requirements-dev.lock index 1aa43f5..6b886df 100644 --- a/bindings/python/requirements-dev.lock +++ b/bindings/python/requirements-dev.lock @@ -15,37 +15,90 @@ -e file:lyric-task # via lyric-py # via lyric-py-worker +backports-tarfile==1.2.0 + # via jaraco-context black==24.10.0 +certifi==2024.8.30 + # via requests +charset-normalizer==3.4.0 + # via requests click==8.1.7 # via black cloudpickle==3.1.0 # via lyric-py componentize-py==0.15.2 +docutils==0.21.2 + # via readme-renderer exceptiongroup==1.2.2 # via pytest +idna==3.10 + # via requests +importlib-metadata==8.5.0 + # via keyring + # via twine iniconfig==2.0.0 # via pytest isort==5.13.2 +jaraco-classes==3.4.0 + # via keyring +jaraco-context==6.0.1 + # via keyring +jaraco-functools==4.1.0 + # via keyring +keyring==25.5.0 + # via twine +markdown-it-py==3.0.0 + # via rich maturin==1.7.4 +mdurl==0.1.2 + # via markdown-it-py +more-itertools==10.5.0 + # via jaraco-classes + # via jaraco-functools msgpack==1.1.0 # via lyric-py mypy-extensions==1.0.0 # via black +nh3==0.2.18 + # via readme-renderer packaging==24.1 # via black # via pytest pathspec==0.12.1 # via black pip==24.3.1 +pkginfo==1.10.0 + # via twine platformdirs==4.3.6 # via black pluggy==1.5.0 # via pytest +pygments==2.18.0 + # via readme-renderer + # via rich pytest==8.3.3 +readme-renderer==44.0 + # via twine +requests==2.32.3 + # via requests-toolbelt + # via twine +requests-toolbelt==1.0.0 + # via twine +rfc3986==2.0.0 + # via twine +rich==13.9.4 + # via twine tomli==2.0.2 # via black # via maturin # via pytest tomli-w==1.1.0 +twine==5.1.1 typing-extensions==4.12.2 # via black + # via rich +urllib3==2.2.3 + # via requests + # via twine +zipp==3.20.2 + # via importlib-metadata diff --git a/crates/Makefile b/crates/Makefile index 38c316b..87d34b8 100644 --- a/crates/Makefile +++ b/crates/Makefile @@ -23,6 +23,9 @@ publish: cargo publish --allow-dirty --registry crates-io -p lyric-rpc sleep 20 + cargo publish --allow-dirty --registry crates-io -p lyric-wasm-runtime + sleep 20 + cargo publish --allow-dirty --registry crates-io -p lyric sleep 20 @@ -33,5 +36,8 @@ publish-dry-run: cargo publish --dry-run --allow-dirty --registry crates-io -p lyric-rpc sleep 20 + cargo publish --dry-run --allow-dirty --registry crates-io -p lyric-wasm-runtime + sleep 20 + cargo publish --dry-run --allow-dirty --registry crates-io -p lyric sleep 20 \ No newline at end of file