Skip to content

Make boto3 and warrant-lite optional dependencies#2020

Merged
iMicknl merged 4 commits intov2/mainfrom
feature/optional-boto3
May 1, 2026
Merged

Make boto3 and warrant-lite optional dependencies#2020
iMicknl merged 4 commits intov2/mainfrom
feature/optional-boto3

Conversation

@iMicknl
Copy link
Copy Markdown
Owner

@iMicknl iMicknl commented Apr 25, 2026

Summary

  • Moves boto3 and warrant-lite from core dependencies to a nexity optional extra (pip install pyoverkiz[nexity])
  • Adds a clear ImportError with install instructions when NexityAuthStrategy.login() is called without the extra
  • Adds test coverage for the missing-dependency error path
  • Documents the optional extra in the getting-started guide and migration guide

Resolves PY-1 from #2014.

Test plan

  • All 397 existing tests pass
  • New test_login_raises_import_error_without_nexity_extra test verifies the error message
  • Existing Nexity auth tests still pass (skipped gracefully when extra is not installed)
  • Pre-commit hooks pass (ruff, mypy, ty)

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.
@iMicknl iMicknl added enhancement New feature or request v2 labels Apr 25, 2026
@iMicknl iMicknl marked this pull request as ready for review April 30, 2026 20:18
@iMicknl iMicknl requested a review from tetienne as a code owner April 30, 2026 20:18
Copilot AI review requested due to automatic review settings April 30, 2026 20:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-lite from core dependencies to [project.optional-dependencies].nexity.
  • Add guarded/lazy imports in NexityAuthStrategy.login() with a clear missing-deps ImportError.
  • 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.

Comment thread tests/test_auth.py Outdated
Comment thread pyoverkiz/auth/strategies.py Outdated
iMicknl added 3 commits May 1, 2026 17:34
- 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.
@iMicknl iMicknl merged commit 5c440ae into v2/main May 1, 2026
8 checks passed
@iMicknl iMicknl deleted the feature/optional-boto3 branch May 1, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants