mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-05 08:06:15 +00:00
* refactor(packaging): reorganize published packages * fix(packaging): install AgentScope extra in wheel smoke * docs: align package guides and documentation site * ci(workflow): add core dependency verification step in Python package build - Add a workflow step to verify released core dependencies by installing the wheel with core extras - Assert the presence of the static index.html file to ensure proper package contents - Create and use a temporary virtual environment for isolation during verification - Keep existing artifacts upload step intact and conditional on inputs.upload_artifacts flag * fix(ci): update package installation dependencies in Windows workflow - Change pip install from editable reme_studio and core to only dev and as extras - Remove installation of reme_studio and core to streamline dependency setup - Ensure Windows CI uses the correct extras for testing environment * fix(tests): add missing commas in toml file reads in package version tests - Added trailing commas in the tomllib.loads calls for auto-fin and daily_paper configs - Ensured consistent syntax to prevent potential tuple misinterpretation - Improved readability and correctness of the test setup code * fix(packaging): protect qwenpaw releases and test Studio health
102 lines
3.5 KiB
YAML
102 lines
3.5 KiB
YAML
name: _Build Python packages
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
expected_version:
|
|
description: Expected release version; omit for a consistency-only check
|
|
required: false
|
|
default: ''
|
|
type: string
|
|
upload_artifacts:
|
|
description: Upload distributions for later publish jobs
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
distributions:
|
|
name: Build Python distributions
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install build packaging pytest twine
|
|
|
|
- name: Validate package versions
|
|
if: inputs.expected_version == ''
|
|
run: python scripts/bump_version.py --check
|
|
|
|
- name: Validate release version
|
|
if: inputs.expected_version != ''
|
|
env:
|
|
EXPECTED_VERSION: ${{ inputs.expected_version }}
|
|
run: python scripts/bump_version.py --check --expected-version "${EXPECTED_VERSION}"
|
|
|
|
- name: Run package tests
|
|
run: PYTHONPATH=. python -m pytest tests/unit/test_package_versions.py -q
|
|
|
|
- name: Build and check distributions
|
|
run: |
|
|
mkdir -p dist/reme
|
|
python -m build --outdir dist/reme
|
|
python -m twine check dist/reme/*
|
|
|
|
- name: Verify distributions and isolated installation
|
|
run: |
|
|
REME_WHEEL="$(pwd)/$(ls dist/reme/reme_ai-[0-9]*.whl)"
|
|
python -m zipfile -l "${REME_WHEEL}" | (! grep 'reme/web/')
|
|
python -m zipfile -l "${REME_WHEEL}" | (! grep 'reme_studio/')
|
|
python -m venv "${RUNNER_TEMP}/reme-package-smoke"
|
|
"${RUNNER_TEMP}/reme-package-smoke/bin/python" -m pip install "${REME_WHEEL}[as]"
|
|
cd "${RUNNER_TEMP}"
|
|
"${RUNNER_TEMP}/reme-package-smoke/bin/python" -c "import reme"
|
|
|
|
- name: Verify released core dependencies
|
|
if: inputs.expected_version != ''
|
|
run: |
|
|
REME_WHEEL="$(pwd)/$(ls dist/reme/reme_ai-[0-9]*.whl)"
|
|
python -m venv "${RUNNER_TEMP}/reme-core-package-smoke"
|
|
"${RUNNER_TEMP}/reme-core-package-smoke/bin/python" -m pip install "${REME_WHEEL}[core]"
|
|
cd "${RUNNER_TEMP}"
|
|
"${RUNNER_TEMP}/reme-core-package-smoke/bin/python" - <<'PY'
|
|
from reme_studio import static_dir
|
|
|
|
assert (static_dir() / "index.html").is_file()
|
|
PY
|
|
|
|
# qwenpaw composes independently released plugins. Keep this before the
|
|
# artifact upload so a core release cannot advertise an unavailable extra.
|
|
- name: Verify released qwenpaw dependencies
|
|
if: inputs.expected_version != ''
|
|
run: |
|
|
REME_WHEEL="$(pwd)/$(ls dist/reme/reme_ai-[0-9]*.whl)"
|
|
python -m venv "${RUNNER_TEMP}/reme-qwenpaw-package-smoke"
|
|
"${RUNNER_TEMP}/reme-qwenpaw-package-smoke/bin/python" -m pip install "${REME_WHEEL}[qwenpaw]"
|
|
cd "${RUNNER_TEMP}"
|
|
"${RUNNER_TEMP}/reme-qwenpaw-package-smoke/bin/python" - <<'PY'
|
|
from importlib.metadata import distribution
|
|
|
|
assert distribution("reme-auto-fin")
|
|
assert distribution("reme-daily-paper")
|
|
PY
|
|
|
|
- name: Upload ReMe distributions
|
|
if: inputs.upload_artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: reme-distributions
|
|
path: dist/reme/
|
|
if-no-files-found: error
|