ci(deps): automate AgentScope updates (#504)

* ci(deps): automate AgentScope updates

* fix(ci): enforce AgentScope release pin contract
This commit is contained in:
jinliyl 2026-08-28 13:27:21 +08:00 • committed by GitHub
parent 99afc2604f
commit 157b096448
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 69 additions and 4 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,25 @@ 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}")
agentscope_requirement = agentscope_requirements[0]
agentscope_specifiers = list(agentscope_requirement.specifier)
if (
agentscope_requirement.extras != {"model-ollama"}
or agentscope_requirement.marker is not None
or len(agentscope_specifiers) != 1
or agentscope_specifiers[0].operator != "=="
or Version(agentscope_specifiers[0].version).is_prerelease
):
raise SystemExit(f"Expected a stable exact agentscope[model-ollama] pin, found {agentscope_requirement}")
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_requirement}", file=output)
print(f"Publishing {project['name']} {actual}")
PY
@ -100,6 +117,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 +126,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,25 @@ 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}")
agentscope_requirement = agentscope_requirements[0]
agentscope_specifiers = list(agentscope_requirement.specifier)
if (
agentscope_requirement.extras != {"model-ollama"}
or agentscope_requirement.marker is not None
or len(agentscope_specifiers) != 1
or agentscope_specifiers[0].operator != "=="
or Version(agentscope_specifiers[0].version).is_prerelease
):
raise SystemExit(f"Expected a stable exact agentscope[model-ollama] pin, found {agentscope_requirement}")
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_requirement}", file=output)
print(f"Publishing {project['name']} {actual}")
PY
@ -99,6 +116,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 +127,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,7 @@ dependencies = [
[project.optional-dependencies]
as = [
"agentscope[model-ollama]==2.0.7",
"agentscope[model-ollama]==2.0.7.post1",
]
web = [
"reme_studio",

View file

@ -42,7 +42,16 @@ 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"}
assert agentscope_requirement.marker is None
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