Skip to content
Merged
Show file tree
Hide file tree
Changes from 110 commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
e52009f
cpp_init
CompromisedKiwi Dec 11, 2025
f7fb288
pypi test
CompromisedKiwi Dec 11, 2025
fc3b4a9
install poetry
CompromisedKiwi Dec 11, 2025
4bdb1d6
hash spliter
CompromisedKiwi Dec 11, 2025
c358226
tag
CompromisedKiwi Dec 11, 2025
a8bb053
uncomment
CompromisedKiwi Dec 11, 2025
79bb593
echo
CompromisedKiwi Dec 11, 2025
ff932c9
no echo
CompromisedKiwi Dec 11, 2025
f7e1069
echo
CompromisedKiwi Dec 11, 2025
c83fd6a
space
CompromisedKiwi Dec 11, 2025
331bd5d
space
CompromisedKiwi Dec 11, 2025
cec2a4f
new space
CompromisedKiwi Dec 11, 2025
622dcd9
no space
CompromisedKiwi Dec 11, 2025
39bebaf
new space 2
CompromisedKiwi Dec 11, 2025
bc99b33
name
CompromisedKiwi Dec 11, 2025
9ac2f4a
test.pypi
CompromisedKiwi Dec 11, 2025
0544eda
--warning=no-file-changed
CompromisedKiwi Dec 12, 2025
19db100
verbose
CompromisedKiwi Dec 12, 2025
38ba9c5
exclude self
CompromisedKiwi Dec 12, 2025
163b0ec
touch first
CompromisedKiwi Dec 12, 2025
bdfaac6
use bash
CompromisedKiwi Dec 12, 2025
10037e6
cp
CompromisedKiwi Dec 12, 2025
0a9d432
pull pybind11
CompromisedKiwi Dec 12, 2025
5b453f6
space
CompromisedKiwi Dec 12, 2025
2436b30
csrc/thirdparty
CompromisedKiwi Dec 12, 2025
ec4eb74
csrc/thirdparty/
CompromisedKiwi Dec 12, 2025
85dc48d
copy
CompromisedKiwi Dec 12, 2025
2a53d8f
tag
CompromisedKiwi Dec 12, 2025
e008766
replace
CompromisedKiwi Dec 12, 2025
e676500
tag
CompromisedKiwi Dec 12, 2025
01cd888
FULL_TAG_NAME
CompromisedKiwi Dec 12, 2025
472d6ad
steps
CompromisedKiwi Dec 12, 2025
975d48b
dir
CompromisedKiwi Dec 12, 2025
c76b31f
dir ..
CompromisedKiwi Dec 12, 2025
0bdffa6
no file name
CompromisedKiwi Dec 12, 2025
50a7af1
with file name
CompromisedKiwi Dec 12, 2025
277e652
copy
CompromisedKiwi Dec 12, 2025
78d679e
use cmake copy
CompromisedKiwi Dec 12, 2025
0bb4a8d
yaml
CompromisedKiwi Dec 12, 2025
ed7da91
v1
CompromisedKiwi Dec 12, 2025
a0c77a9
release
CompromisedKiwi Dec 12, 2025
f35bc13
pattern
CompromisedKiwi Dec 15, 2025
1d914a5
merge-multiple: true
CompromisedKiwi Dec 15, 2025
c9ebb7d
list
CompromisedKiwi Dec 15, 2025
e081796
rename
CompromisedKiwi Dec 15, 2025
013de63
no token
CompromisedKiwi Dec 15, 2025
2738c9f
id-token
CompromisedKiwi Dec 15, 2025
a0eeaec
password
CompromisedKiwi Dec 15, 2025
76ffeb1
test
CompromisedKiwi Dec 15, 2025
314df72
pybind
CompromisedKiwi Dec 15, 2025
c0ac257
setup
CompromisedKiwi Dec 15, 2025
3f4dd60
space
CompromisedKiwi Dec 16, 2025
c49be85
tmp
CompromisedKiwi Dec 18, 2025
cba36a4
repair
CompromisedKiwi Dec 18, 2025
bebb5df
no setup
CompromisedKiwi Dec 18, 2025
4c0e2c9
build
CompromisedKiwi Dec 18, 2025
51ae827
default no ext
CompromisedKiwi Dec 18, 2025
b9ada36
cd
CompromisedKiwi Dec 18, 2025
8916011
fast
CompromisedKiwi Dec 18, 2025
c8d2960
\
CompromisedKiwi Dec 18, 2025
519e614
no version
CompromisedKiwi Dec 18, 2025
49550fb
comma
CompromisedKiwi Dec 18, 2025
47abde7
cpy
CompromisedKiwi Dec 18, 2025
6fa6399
test cui
CompromisedKiwi Dec 18, 2025
d4d6843
no needs
CompromisedKiwi Dec 18, 2025
be6df50
upload
CompromisedKiwi Dec 18, 2025
05212ac
check
CompromisedKiwi Dec 18, 2025
bebe412
needs
CompromisedKiwi Dec 18, 2025
155b711
test download
CompromisedKiwi Dec 18, 2025
9d7d3a9
tar
CompromisedKiwi Dec 18, 2025
044ffde
test down
CompromisedKiwi Dec 18, 2025
4d95966
mv
CompromisedKiwi Dec 18, 2025
a6f2807
cone
CompromisedKiwi Dec 18, 2025
0f992b3
cp
CompromisedKiwi Dec 18, 2025
8b021a8
setup.py
CompromisedKiwi Dec 18, 2025
8cd0817
CIBW_BUILD
CompromisedKiwi Dec 18, 2025
1109d0f
quote
CompromisedKiwi Dec 18, 2025
a29f51e
generate-setup-file = true
CompromisedKiwi Dec 18, 2025
069f2e7
CIBW_BUILD_VERBOSITY: 1
CompromisedKiwi Dec 18, 2025
10229fa
setuptools
CompromisedKiwi Dec 18, 2025
53996f9
enter
CompromisedKiwi Dec 18, 2025
0a0a56e
raise
CompromisedKiwi Dec 18, 2025
5633b08
scikit_build_core
CompromisedKiwi Dec 18, 2025
46863bc
full
CompromisedKiwi Dec 18, 2025
b920a48
no raise
CompromisedKiwi Dec 18, 2025
c2c3ac5
no poetry
CompromisedKiwi Dec 18, 2025
f0d752b
packages = ["lazyllm"]
CompromisedKiwi Dec 18, 2025
1542ee2
no mv
CompromisedKiwi Dec 18, 2025
3d17b09
save
CompromisedKiwi Dec 18, 2025
84635b5
test restore
CompromisedKiwi Dec 18, 2025
c36fc2f
fu
CompromisedKiwi Dec 18, 2025
27d9458
quick test
CompromisedKiwi Dec 18, 2025
5a8a351
DPYTHON_EXECUTABLE
CompromisedKiwi Dec 18, 2025
71a9aa0
sys
CompromisedKiwi Dec 18, 2025
02ef9bb
.Module
CompromisedKiwi Dec 18, 2025
e0f7a05
no bind11
CompromisedKiwi Dec 18, 2025
80ba2d4
scikit_build_core.build
CompromisedKiwi Dec 18, 2025
6ba1f2a
restore main
CompromisedKiwi Dec 19, 2025
891bf4b
new wf
CompromisedKiwi Dec 19, 2025
13836ac
build-doc
CompromisedKiwi Dec 19, 2025
df01240
pip install build
CompromisedKiwi Dec 19, 2025
c1385f6
url
CompromisedKiwi Dec 19, 2025
60ce8cc
quote
CompromisedKiwi Dec 19, 2025
b27b652
--extra-index-url
CompromisedKiwi Dec 19, 2025
dc00bf4
lazyllm
CompromisedKiwi Dec 19, 2025
a928e9b
${{ env.PYTHON_VERSION }}
CompromisedKiwi Dec 19, 2025
814d613
pip install -U pip setuptools wheel
CompromisedKiwi Dec 19, 2025
638835b
from lazyllm import lazyllm_cpp
CompromisedKiwi Dec 19, 2025
81abf04
restore yamls
CompromisedKiwi Dec 19, 2025
c580ad2
Merge branch 'wzh/cpp_init' into yzh/publish_workflow_check
wzh1994 Dec 19, 2025
628a19a
restore vllm lightllm extra
CompromisedKiwi Dec 19, 2025
c400c0c
[project.scripts]
CompromisedKiwi Dec 19, 2025
bf493e7
for poetry check
CompromisedKiwi Dec 22, 2025
86b59f7
Manage pybind11 via cibuildwheel.
CompromisedKiwi Dec 22, 2025
9438a32
Poetry dependency specification needed.
CompromisedKiwi Dec 22, 2025
cd6c436
Change poetry build to let toml decide.
CompromisedKiwi Dec 22, 2025
3c2e917
Remove poetry logic
CompromisedKiwi Dec 23, 2025
6fdf293
restore poetry dependencies
CompromisedKiwi Dec 23, 2025
360cf50
Poetry compatibility enhencement
CompromisedKiwi Dec 23, 2025
f83f089
lazyagi only
CompromisedKiwi Dec 23, 2025
d35ea0c
remove requirements.full.txt
CompromisedKiwi Dec 23, 2025
1cfa7b2
Get deps from toml.
CompromisedKiwi Dec 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
239 changes: 167 additions & 72 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,51 @@ on:
workflow_dispatch:

env:
POETRY_VERSION: "1.8.3"
PYTHON_VERSION: "3.10.9"
PYPI_PUBLISH_URL: ${{ vars.PYPI_PUBLISH_URL || 'https://pypi.org/legacy/' }}
PYPI_DOWNLOAD_URL: ${{ vars.PYPI_DOWNLOAD_URL || 'https://pypi.org/simple/' }}

defaults:
run:
shell: bash

jobs:
check-exists:
name: Check Pypi version exists
if: github.repository == 'LazyAGI/LazyLLM'
if: endsWith(github.repository, '/LazyLLM')
runs-on: ubuntu-latest
outputs:
TAG: ${{ steps.set_tag_var.outputs.tag }}
pypi_version_exists: ${{ steps.pypi_check.outputs.pypi_version_exists }}
steps:
- name: Extract tag from ref
id: set_tag_var
run: |
FULL_TAG_NAME="${{ github.ref_name }}"
echo "tag=${FULL_TAG_NAME#v}" >> $GITHUB_OUTPUT

- uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 0

- name: Set up python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Check PyPI for existing version
id: pypi_check
run: |
VERSION=$(poetry version -s)
PACKAGE_NAME=$(poetry version | awk '{print $1}')
RESPONSE=$(curl -s https://pypi.org/pypi/$PACKAGE_NAME/json)
if echo "$RESPONSE" | jq -e ".releases | has(\"$VERSION\")"; then
echo "Version $VERSION already exists on PyPI. Skipping publish."
TAG=${{ steps.set_tag_var.outputs.tag }}
echo "TAG: ${TAG}"
PACKAGE_NAME=$(grep -m 1 'name = "' pyproject.toml | cut -d'"' -f2)
RESPONSE=$(curl -s https://test.pypi.org/pypi/$PACKAGE_NAME/json)
if echo "$RESPONSE" | jq -e ".releases | has(\"$TAG\")"; then
echo "Version $TAG already exists on PyPI. Skipping publish."
echo "pypi_version_exists=true" >> $GITHUB_OUTPUT
else
echo "Version $VERSION does not exist on PyPI. Proceeding with publish."
echo "Version $TAG does not exist on PyPI. Proceeding with publish."
echo "pypi_version_exists=false" >> $GITHUB_OUTPUT
fi

Expand All @@ -46,50 +69,34 @@ jobs:

- name: Init specific submodule
run: |
git submodule init LazyLLM-Env
git submodule update LazyLLM-Env
git submodule update --init LazyLLM-Env

- name: Set up python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}

- name: Extract tag from ref
id: extract_tag
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

- name: Update version in pyproject.toml and __init__.py
run: |
sed -i "s/^version = \".*\"/version = \"$TAG\"/" pyproject.toml
sed -i "s/version='[^']*',/version='$TAG',/" setup.py
sed -i "s/^__version__ = '.*'/__version__ = '$TAG'/" lazyllm/__init__.py
echo $TAG
env:
TAG: ${{ env.TAG }}
TAG=${{ needs.check-exists.outputs.TAG }}
echo "TAG: ${TAG}"
sed -i "s#^version = \".*\"#version = \"$TAG\"#" pyproject.toml
sed -i "s#^__version__ = '.*'#__version__ = '$TAG'#" lazyllm/__init__.py

- name: Install deps
shell: bash
run: pip install -e .

- name: Test import
working-directory: /tmp
shell: bash
run: python -c "import lazyllm"

- name: Check requirements
shell: bash
run: |
pip install toml
python scripts/check_requirements.py

- name: Copy files
shell: bash
run: cp LazyLLM-Env/poetry.lock . && cp pyproject.toml lazyllm/
run: cp pyproject.toml lazyllm/

- name: Build doc
run: |
Expand All @@ -107,7 +114,9 @@ jobs:

- name: Tar repo with docs
run: |
tar --exclude='.git' -czf repo-with-docs.tar.gz .
touch repo-with-docs.tar.gz
tar --exclude=.git --exclude=repo-with-docs.tar.gz \
-czf repo-with-docs.tar.gz .
ls -lh repo-with-docs.tar.gz

- name: Upload repo artifact (with docs inserted)
Expand All @@ -117,14 +126,15 @@ jobs:
path: repo-with-docs.tar.gz
retention-days: 7

build-wheels:
name: Build wheels with native extensions (${{ matrix.os }}-py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]

- name: Save wheels to cache
uses: actions/cache/save@v3
with:
path: repo-with-docs.tar.gz
key: repo-with-docs

build-wheel-rollback-version:
needs: build-doc
runs-on: ubuntu-latest
steps:
- name: Download repo-with-docs
uses: actions/download-artifact@v4
Expand All @@ -138,63 +148,149 @@ jobs:
mkdir -p repo
tar -xzf repo_artifact/repo-with-docs.tar.gz -C repo
# copy extracted content to workspace root (overwrite)
rsync -a repo/ ./
cp -a repo/. ./
# show a bit for debug
ls -la | sed -n '1,200p'

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install build deps
run: |
python -m pip install -U pip build setuptools wheel
python-version: "3.10"

- name: Build default wheel
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
run: |
python -m build --wheel --outdir dist/ --config-setting="--universal"
pip install build
python -m build --config-setting=skbuild.wheel.cmake=false
ls -la dist/

- name: Build C++ extension
- name: Upload source_code
uses: actions/upload-artifact@v4
with:
name: source_code
path: dist/*.tar.gz

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheels-pure-python
path: dist/*.whl
retention-days: 7

build-wheel-with-cpp-extension:
name: Build wheels with native extensions (${{ matrix.os }})
needs: build-doc
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
# - uses: actions/checkout@v4
# with:
# submodules: false

- name: Download repo-with-docs
uses: actions/download-artifact@v4
with:
name: repo-with-docs
path: ./repo_artifact

- name: Extract repo-with-docs
run: |
set -ex
python setup.py build_ext --inplace
mkdir -p repo
tar -xzf repo_artifact/repo-with-docs.tar.gz -C repo
# copy extracted content to workspace root (overwrite)
cp -a repo/. ./
# show a bit for debug
ls -la | sed -n '1,200p'

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Build wheel
run: |
python -m build --wheel --outdir dist/
ls -la dist/
pip install cibuildwheel
cibuildwheel --output-dir repaired_wheel
ls -la repaired_wheel/
env:
CIBW_BUILD_VERBOSITY: 1

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-py${{ matrix.python-version }}
path: dist/*.whl
name: wheels-${{ matrix.os }}
path: repaired_wheel/*.whl
retention-days: 7

publish:
name: publish to PyPI
if: github.repository == 'LazyAGI/LazyLLM'
needs: build-wheels
if: endsWith(github.repository, '/LazyLLM')
needs: [build-wheel-with-cpp-extension, build-wheel-rollback-version]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: ./dist

merge-multiple: true

- name: List downloaded files
run: |
echo "Files in dist directory:"
ls -la ./dist/

- name: Publish all wheels to PyPI
uses: pypa/gh-action-pypi-publish@v1.6.7
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.LazyLLM_INDEX_PYPI_TOKEN }}
repository-url: ${{ env.PYPI_PUBLISH_URL }}
packages_dir: dist/

check-pypi-installation:
name: Check pypi installation
needs: publish
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install LazyLLM from PyPI
run: |
pip install -U pip setuptools wheel
sleep 180
FULL_TAG_NAME="${{ github.ref_name }}"
if [ -n "${{ vars.PYPI_DOWNLOAD_URL }}" ]; then
pip install lazyllm==${FULL_TAG_NAME#v} \
--index-url ${{ vars.PYPI_DOWNLOAD_URL }} \
--no-deps
pip install lazyllm==${FULL_TAG_NAME#v} \
--extra-index-url https://pypi.org/simple \
--no-build-isolation
else
pip install lazyllm==${FULL_TAG_NAME#v}
fi

- name: Verify installation
run: |
python -c "import lazyllm; print(lazyllm.__version__)"
python -c "from lazyllm import lazyllm_cpp"

check-release:
name: check and create GitHub Release
if: github.repository == 'LazyAGI/LazyLLM'
needs: publish
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -224,21 +320,20 @@ jobs:
release_name: ${{ github.ref }}
draft: false
prerelease: false

- name: Set upload_url for new release
if: env.release_exists == 'false'
run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV
- name: Get Asset name
run: |
export PKG=$(ls dist/ | grep tar)
set -- $PKG
echo "name=$1" >> $GITHUB_ENV
- name: Upload Release Asset (sdist) to GitHub
id: upload-release-asset
uses: actions/upload-release-asset@v1

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: source_code
path: ./dist

- name: Upload Release Asset (sdist)
run: |
FILE_PATH=$(ls dist/*)
gh release upload "${GITHUB_REF#refs/tags/}" "$FILE_PATH" --repo "$GITHUB_REPOSITORY" --clobber
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
with:
upload_url: ${{ env.upload_url }}
asset_path: dist/${{ env.name }}
asset_name: ${{ env.name }}
asset_content_type: application/zip
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ docs/zh/assets
*.app

# build directories
build*
build*
lazyllm_cpp.egg-info/
Loading
Loading