-
Notifications
You must be signed in to change notification settings - Fork 520
Add option to exclude boto3 and botocore from dependencies #2525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
setup.py
Outdated
|
||
# Check if slim is being requested via environment variable | ||
# (This is the most reliable way to detect slim installation intent) | ||
is_slim_install = os.environ.get("SNOWFLAKE_SLIM_INSTALL", "").lower() in ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor
is_slim_install = os.environ.get("SNOWFLAKE_SLIM_INSTALL", "").lower() in ( | |
is_slim_install = os.environ.get("SNOWFLAKE_NO_BOTO", "").lower() in ( |
deactivate | ||
rm -rf test_default_env | ||
|
||
- name: Test installation with SNOWFLAKE_NO_BOTO=1 (should exclude boto) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make this more generally into a slim package, in case we need to include additional dependencies in the near future?
Example: we're discovering more gaps in our WIF client-side story on Azure because we're rolling our own client library rather than using Microsoft's MSAL libraries. It would be nice to have the option to bundle MSAL later.
Having a slim
package would give flexibility to include such dependencies, rather than a "noboto" package which only seems to be related to AWS boto.
@@ -152,6 +158,12 @@ def create_aws_attestation( | |||
|
|||
If the application isn't running on AWS or no credentials were found, raises an error. | |||
""" | |||
if not BOTO_AVAILABLE: | |||
raise MissingDependencyError( | |||
msg="boto3 or botocore dependency is not installed. [boto] extension is required for the AWS provider.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest a more user-facing and actionable error message:
msg="boto3 or botocore dependency is not installed. [boto] extension is required for the AWS provider.", | |
msg="AWS Workload Identity Federation is not supported in the slim snowflake-python-connect build. Please update your pip dependencies to use the full connector package instead.", |
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes #SNOW-2107016
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
This PR introduces an option to install
snowflake-connector-python
without boto3 and botocore dependenciesIt includes as well: