Repository navigation
Conversation
|
Thanks @ump45nose, good fix approach. Please comment on #333 and claim the issue first (GFI, unclaimed duplicates clutter the backlog). Before merge:
Re-run |
7d362b2 to
da757de
Compare
|
Thanks for the rebase onto Still required before merge which were unchanged from prior review:
Please map each #333 acceptance criterion → file/test in the PR description when you push the next update. <3 |
|
Hey @ump45nose let me know if you need help with this, or I can push a maintainer wrap up so we can merge this? thanks. |
- 合并 main 并保留版本解析兜底、安装状态输出与 opt-out 行为 - 增加开发安装脚本、单元覆盖及 CLI 文档
da757de to
943bc55
Compare
|
Hey @ump45nose please try to rebase again, or I can do before merge regardless of state when you push, but we need to comment and claim #333, this is a requirement from prior review,
Once these are in, I will merge, and rebase if needed <3 |
…tall-conflicts Upstream has since landed its own install-health implementation (`assess_install_health` / `InstallHealth` / `format_install_health_report`), which covers every case this branch set out to fix — duplicate registrations, orphan dist-info, editable/wheel mixes and unparseable versions — with a richer report. This branch's `detect_install_conflicts` API is therefore retired rather than kept alongside it. All conflicts take upstream's side. `tests/test_cli.py` keeps only the two assertions upstream lacks (the shared advisory opt-out suppressing install-conflict output, and `config show` surfacing the install section), ported onto the new API; the five it duplicates are dropped, since `tests/test_version_policy.py` already covers them. No test that passed before fails now.
Refs ARPAHLS#333. Clarify the existing shared advisory switch in the environment-variable reference.
|
Addressed the remaining documentation point in a548689: docs/usage/api_keys.md now explicitly says SKILLWARE_NO_VERSION_CHECK=1 suppresses both version and install-conflict advisories, with a changelog entry. The existing opt-out regression test is included in validation. Local validation: 135 tests passed across test_version_policy.py, test_cli.py, test_registry_docs.py, and test_skill_docs.py; Black and Flake8 passed on the version-policy/CLI test paths; git diff --check passed. This was focused validation, not the complete optional-dependency suite. Hosted CI on the new head still needs to run. The follow-up was AI-assisted. No implementation or package-version changes were made in this update. |
Description
Fixes #333 — the CLI prints
vNone/skillware Nonewhen a maintainer mixes editable and PyPI installs on the same Python and pip leaves duplicate/orphanskillwaredistribution metadata.The root cause is
_package_version_str()/get_installed_version()treating corrupt metadata as a valid "None" string and the fallback returningimportlib.metadata.version("skillware")verbatim. This PR hardens both, adds conflict detection, and surfaces it viaskillware doctor --installplus a startup advisory.Changes
skillware/version_policy.pyget_installed_version()now treats"","dev", and literal"None"as invalid (returnsNone).detect_install_conflicts()— flags duplicate distributions, missingMetadata-Version, unparseable versions, orphan.dist-infodirs (noMETADATA/RECORD), and editable+wheel coexistence on one interpreter.InstallConflictdataclass withcode,summary, and Windows/Unix fix commands.skillware/cli.py_package_version_str()never returnsNoneor empty — final fallback is"dev".emit_install_conflict_advisory()— one dim stderr line on CLI startup when conflicts are detected.skillware doctor --install— reports install version + health, lists each conflict with copy-paste Windows/Unix fix commands. Exit 0 = healthy, 1 = conflicts.CONTRIBUTING.md— new "Editable vs PyPI on the same Python" subsection documenting one-mode-per-interpreter, uninstall-before-switching, and orphan cleanup.CHANGELOG.md— entries under[Unreleased].docs/usage/cli.md— documentsskillware doctor --install.Type of Change
skillware/cli.py,docs/usage/cli.mdChecklist (all PRs)
Fixes #333)python -m black --check .passes locallyflake8 .passes locallypytest tests/passes for affected modules (tests/test_cli.py,tests/test_version_policy.py— 87 passed)CHANGELOG.mdupdated under[Unreleased](user-visible behavior change)skills/files changed (skill checklist omitted)Testing
python -m black --check .→ all files unchanged.python -m flake8 .→ clean.python -m pytest tests/test_version_policy.py tests/test_cli.py -q→ 87 passed.skillware doctor --installreports the editable+wheel mix and duplicate distribution that actually exist in the local venv (exit 1), and the startup advisory prints when conflicts exist.Note: the full
pytest tests//pytest skills/suites require the[dev,all]extras (google-genai, playwright, PIL, etc.) that are not installed in this local venv; CI installs them viapip install -e ".[dev,all]"and remains authoritative.AI assistance
This contribution was drafted with AI assistance. Per the repository's Agent Code of Conduct, no AI tool or agent is added to
Co-authored-by:trailers.Related Issues