fix: handle upstream rename of minisweagent_path.py → mini_swe_runner.py

Upstream removed minisweagent_path.py in favor of mini_swe_runner.py,
breaking the nightly-package-contents check. Accept either module name
in checks and ensure both are patched into pyproject.toml py-modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rasyidan Akbar F. 2026-03-26 11:31:43 +07:00
commit 4f787c78f3
2 changed files with 13 additions and 3 deletions

View file

@ -226,14 +226,19 @@ pythonPackages.buildPythonApplication {
# Don't run tests during build
doCheck = false;
# Upstream pyproject.toml is missing minisweagent_path from py-modules.
# Also ensure mini-swe-agent/src is importable.
# Upstream pyproject.toml may be missing minisweagent_path / mini_swe_runner
# from py-modules. Also ensure mini-swe-agent/src is importable.
postPatch = ''
# Fix: add minisweagent_path.py to py-modules if missing from pyproject.toml
if [ -f minisweagent_path.py ] && ! grep -q minisweagent_path pyproject.toml; then
sed -i 's/py-modules = \[/py-modules = ["minisweagent_path", /' pyproject.toml
fi
# Fix: add mini_swe_runner.py to py-modules if missing (upstream rename)
if [ -f mini_swe_runner.py ] && ! grep -q mini_swe_runner pyproject.toml; then
sed -i 's/py-modules = \[/py-modules = ["mini_swe_runner", /' pyproject.toml
fi
# Make mini-swe-agent importable by copying src into the package
if [ -d mini-swe-agent/src/minisweagent ]; then
cp -r mini-swe-agent/src/minisweagent .