ci(deps): automate AgentScope updates

This commit is contained in:
jinli.yl 2026-08-28 11:55:20 +08:00
parent 99afc2604f
commit 3a3e021e72
4 changed files with 47 additions and 3 deletions

18
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
target-branch: "main"
schedule:
interval: "cron"
cronjob: "30 9 * * *"
timezone: "Asia/Shanghai"
allow:
- dependency-name: "agentscope"
cooldown:
exclude:
- "agentscope"
open-pull-requests-limit: 1
commit-message:
prefix: "chore"
include: "scope"

View file

@ -77,8 +77,15 @@ jobs:
raise SystemExit(f"Expected a base reme-ai dependency, found {requirements[0]!r}")
if Version("0.4.1.8") in reme_requirement.specifier or Version("0.4.1.9") not in reme_requirement.specifier:
raise SystemExit(f"Expected reme-ai>=0.4.1.9, found {requirements[0]!r}")
root_project = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8"))["project"]
agentscope_requirements = [
Requirement(value) for value in root_project["optional-dependencies"]["as"]
]
if len(agentscope_requirements) != 1 or agentscope_requirements[0].name != "agentscope":
raise SystemExit(f"Expected one agentscope dependency, found {agentscope_requirements!r}")
with Path(os.environ["GITHUB_OUTPUT"]).open("a", encoding="utf-8") as output:
print(f"reme_requirement={reme_requirement}", file=output)
print(f"agentscope_requirement={agentscope_requirements[0]}", file=output)
print(f"Publishing {project['name']} {actual}")
PY
@ -100,6 +107,8 @@ jobs:
python -m twine check dist/auto-fin/*
- name: Verify distributions and isolated installation
env:
AGENTSCOPE_REQUIREMENT: ${{ steps.package.outputs.agentscope_requirement }}
run: |
AUTO_FIN_WHEEL="$(pwd)/$(ls dist/auto-fin/reme_auto_fin-*.whl)"
AUTO_FIN_SDIST="$(pwd)/$(ls dist/auto-fin/reme_auto_fin-*.tar.gz)"
@ -107,7 +116,7 @@ jobs:
python -m tarfile -l "${AUTO_FIN_SDIST}" | grep '/LICENSE'
python -m venv "${RUNNER_TEMP}/reme-auto-fin-smoke"
"${RUNNER_TEMP}/reme-auto-fin-smoke/bin/python" -m pip install \
"agentscope[model-ollama]==2.0.7" "${AUTO_FIN_WHEEL}"
"${AGENTSCOPE_REQUIREMENT}" "${AUTO_FIN_WHEEL}"
cd "${RUNNER_TEMP}"
"${RUNNER_TEMP}/reme-auto-fin-smoke/bin/python" - <<'PY'
from importlib.metadata import distribution

View file

@ -76,8 +76,15 @@ jobs:
raise SystemExit(f"Expected reme-ai>=0.4.1.9, found {reme_requirements!r}")
if sum(requirement.name == "pypdf" for requirement in requirements) != 1:
raise SystemExit("Expected exactly one pypdf dependency")
root_project = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8"))["project"]
agentscope_requirements = [
Requirement(value) for value in root_project["optional-dependencies"]["as"]
]
if len(agentscope_requirements) != 1 or agentscope_requirements[0].name != "agentscope":
raise SystemExit(f"Expected one agentscope dependency, found {agentscope_requirements!r}")
with Path(os.environ["GITHUB_OUTPUT"]).open("a", encoding="utf-8") as output:
print(f"reme_requirement={reme_requirements[0]}", file=output)
print(f"agentscope_requirement={agentscope_requirements[0]}", file=output)
print(f"Publishing {project['name']} {actual}")
PY
@ -99,6 +106,8 @@ jobs:
python -m twine check dist/daily-paper/*
- name: Verify distributions and isolated installation
env:
AGENTSCOPE_REQUIREMENT: ${{ steps.package.outputs.agentscope_requirement }}
run: |
DAILY_PAPER_WHEEL="$(pwd)/$(ls dist/daily-paper/reme_daily_paper-*.whl)"
DAILY_PAPER_SDIST="$(pwd)/$(ls dist/daily-paper/reme_daily_paper-*.tar.gz)"
@ -108,7 +117,7 @@ jobs:
python -m tarfile -l "${DAILY_PAPER_SDIST}" | grep '/LICENSE'
python -m venv "${RUNNER_TEMP}/reme-daily-paper-smoke"
"${RUNNER_TEMP}/reme-daily-paper-smoke/bin/python" -m pip install \
"agentscope[model-ollama]==2.0.7" "${DAILY_PAPER_WHEEL}"
"${AGENTSCOPE_REQUIREMENT}" "${DAILY_PAPER_WHEEL}"
cd "${RUNNER_TEMP}"
"${RUNNER_TEMP}/reme-daily-paper-smoke/bin/python" - <<'PY'
from importlib.metadata import distribution

View file

@ -42,7 +42,15 @@ def test_studio_packages_have_independent_identity() -> None:
assert studio_config["project"]["name"] == "reme_studio"
assert npm_config["name"] == "@agentscope-ai/reme_studio"
assert studio_config["project"]["version"] == npm_config["version"]
assert main_config["project"]["optional-dependencies"]["as"] == ["agentscope[model-ollama]==2.0.7"]
agentscope_requirements = [Requirement(value) for value in main_config["project"]["optional-dependencies"]["as"]]
assert len(agentscope_requirements) == 1
agentscope_requirement = agentscope_requirements[0]
assert agentscope_requirement.name == "agentscope"
assert agentscope_requirement.extras == {"model-ollama"}
agentscope_specifiers = list(agentscope_requirement.specifier)
assert len(agentscope_specifiers) == 1
assert agentscope_specifiers[0].operator == "=="
assert not Version(agentscope_specifiers[0].version).is_prerelease
assert main_config["project"]["optional-dependencies"]["web"] == ["reme_studio"]
assert main_config["project"]["optional-dependencies"]["core"].count("reme-ai[as]") == 1
assert main_config["project"]["optional-dependencies"]["core"].count("reme_studio") == 1