Files
Duy /zuey/ 6e5e51a18b feat(packages): Phase 2a — pip + npm update flow (#900) (#6)
* feat(packages): backend pip + npm update flow (#900)

Extend Phase 1 update infrastructure to pip + npm sources. Register
checkers/executors behind edition gate (Lite edition stays github-only).
Per-source sentinel errors + stderr classifier; strict package-name
validators reject @version suffix. Shared PackageLocker serializes
install + update paths. HTTP response surfaces per-source availability
from LookPath detection.

Closes part of #900 (Phase 2a).

* feat(packages): frontend multi-source updates UI (#900)

Unified flat updates list with source pill (github/pip/npm) + filter
dropdown. Summary bar shows per-source counts, hiding sources whose
backend availability=false. 30 i18n keys with full en/vi/zh parity.
Mobile-safe table (overflow-x-auto + min-w-[600px]).

Part of #900 (Phase 2a).

* test(packages): pip + npm integration e2e (#900)

Optional real-runtime integration test behind `pipnpm_e2e` build tag.
Skipped by default CI; exercises full check + apply cycle with real
pip3/npm in Alpine container.

Part of #900 (Phase 2a).

* docs(packages): document pip + npm update flow (#900)

Adds packages-pip-npm.md covering command matrix, exit codes, stderr
error classes, pre-release handling, availability detection, runbook
for EACCES/ERESOLVE/externally-managed, min versions, fixture regen.
Cross-link from packages-github.md. Changelogs updated.

Part of #900 (Phase 2a).

* fix(packages): set exec bit on testdata npm/pip scripts
2026-05-11 15:31:32 +07:00

47 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# Fixture pip3 for unit tests.
# Controlled via env vars:
# FIXTURE_PIP_EXIT — exit code for `install` subcommand (default 0)
# FIXTURE_PIP_STDERR — text written to stderr for `install` subcommand (default empty)
#
# `list --outdated` emits the JSON fixture files relative to this script's directory.
# `list --outdated --pre` emits outdated-empty.json (no additional pre-release updates).
# `install ...` exits with FIXTURE_PIP_EXIT and emits FIXTURE_PIP_STDERR to stderr.
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
FIXTURE_DIR="$(dirname "$SCRIPT_DIR")"
if [ "$1" = "list" ] && [ "$2" = "--outdated" ]; then
# Check if --pre flag is present anywhere in args.
has_pre=0
for arg in "$@"; do
if [ "$arg" = "--pre" ]; then
has_pre=1
break
fi
done
if [ "$has_pre" = "1" ]; then
cat "$FIXTURE_DIR/outdated-empty.json" 2>/dev/null || echo "[]"
else
cat "$FIXTURE_DIR/outdated-23.3.json"
fi
exit 0
fi
if [ "$1" = "install" ]; then
: "${FIXTURE_PIP_EXIT:=0}"
: "${FIXTURE_PIP_STDERR:=}"
if [ -n "$FIXTURE_PIP_STDERR" ]; then
printf '%s\n' "$FIXTURE_PIP_STDERR" >&2
fi
exit "$FIXTURE_PIP_EXIT"
fi
if [ "$1" = "cache" ]; then
# cleanCaches calls `pip3 cache purge`; succeed silently.
exit 0
fi
# Unknown subcommand.
exit 2