Make boto3 and warrant-lite optional dependencies#2020
Merged
Conversation
These heavy dependencies (~100MB installed) are only used by NexityAuthStrategy. Moving them to a `nexity` extra avoids pulling in the entire AWS SDK for users who don't need Nexity support.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the heavy Nexity authentication dependencies (boto3, warrant-lite) optional via a nexity extra, adds a runtime ImportError with install instructions when Nexity auth is used without the extra, and updates tests + docs accordingly.
Changes:
- Move
boto3+warrant-litefrom core dependencies to[project.optional-dependencies].nexity. - Add guarded/lazy imports in
NexityAuthStrategy.login()with a clear missing-depsImportError. - Add/adjust tests to cover the missing-dependency path and skip Nexity-specific tests when deps aren’t installed; document the extra in getting-started + migration guide.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Moves Nexity deps to an optional nexity extra. |
uv.lock |
Updates lock metadata to reflect nexity extra and markers. |
pyoverkiz/auth/strategies.py |
Wraps Nexity imports in try/except ImportError and raises an install-hint error. |
tests/test_auth.py |
Adds missing-deps test for Nexity login; skips Nexity tests when deps aren’t present. |
docs/getting-started.md |
Documents optional extras and how to install pyoverkiz[nexity]. |
docs/migration-v2.md |
Notes the Nexity deps are now optional and error behavior at login time. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Quote bracket syntax in install hint for zsh compatibility - Check all three Nexity modules (boto3, warrant_lite, botocore) in test guard
Restore TYPE_CHECKING import for BaseClient to eliminate Any return type on _client(). Use importlib.util.find_spec in tests instead of try/except import guard.
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.
Summary
boto3andwarrant-litefrom core dependencies to anexityoptional extra (pip install pyoverkiz[nexity])ImportErrorwith install instructions whenNexityAuthStrategy.login()is called without the extraResolves PY-1 from #2014.
Test plan
test_login_raises_import_error_without_nexity_extratest verifies the error message