Repository navigation
fix: drop the obsolete secfoo[api] extra and its misleading install hint - #156
Merged
Merged
Conversation
litellm and langgraph are regular dependencies, so the `api` extra installed nothing and `pip install "secfoo[api]"` could not fix a failed import. Remove the empty extra and make the error text, docs/agents.md and the test agree: an import failure means a broken install, so the message says to reinstall secfoo and includes the ImportError. Add a consistency test so the extra cannot return. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DsERxaCi7rNtqUTYked7Jd
README's first install channel is pipx, where 'pip install --force-reinstall' would install into a different environment. The consistency test now parses requirement names robustly and also scans action.yml, the Dockerfile, the npm README and the CI examples. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
|
Thanks @Varunpoojari, nicely scoped, and I appreciate the "Part of #120" rather than I pushed two small follow-ups to your branch instead of asking for another round:
I also merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #120 (item 1). Deliberately not
Fixes, because the other items in that issue are still open.Problem
litellmandlanggraphare regular dependencies of secfoo, but the project still carried a separateapiextra with the same two packages. Theapiagent's import-failure message also told users to runpip install secfoo[api]. That advice is wrong: the extra duplicates base dependencies, so installing it changes nothing. The docs repeated the same hint.Changes
pyproject.toml: remove theapiextra and leave a short comment explaining why there isn't one.src/secfoo/agents/api.py: theImportErrorhandler now says thatlitellm/langgraphship with secfoo, so a failed import means a broken or partial install, and suggestspip install --force-reinstall secfoo.docs/agents.md: theapirow and the troubleshooting bullet match the new behaviour.tests/test_agents/test_api.py: the existing missing-litellm test is renamed and asserts the new message and thatsecfoo[api]is gone.tests/test_docs_consistency.py: newtest_no_obsolete_api_extra. It checks that there is noapioptional-dependency, thatlitellmandlanggraphare in the base dependencies, and thatsecfoo[api]appears in no README, CONTRIBUTING, docs orsrcfile. It follows the pattern of the docs-consistency tests added in docs: fix REFERENCE.md claim that releases build on tag push (#120 item 5) #151.Checks run
mainand passes on this branch.tests/test_agents/test_api.pyandtests/test_docs_consistency.py: 30 passed.test_activity_routes.pyx3 andtest_architecture_dashboard.py::test_dashboard_diagram_section_still_present_alongside_new_dashboard). They fail the same way on an unmodifiedmaincheckout and don't touch these files.ruff checkis clean on the touched files.Notes
secfoo[api]in a requirements file will now get pip's "does not provide the extra 'api'" warning rather than an error, and the install still pulls both packages in as base dependencies.