Skip to content
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

ImportError: cannot import name 'string_types' from 'six' while testing with uv --resolution=lowest #3338

Open
1 task
pcjedi opened this issue Jan 16, 2025 · 0 comments
Assignees
Labels
bug This issue is a confirmed bug. dependencies This issue is a problem in a dependency. investigating This issue is being investigated and/or work is in progress to resolve the issue. p3 This is a minor priority issue

Comments

@pcjedi
Copy link

pcjedi commented Jan 16, 2025

Describe the bug

Package maintainers who use uv to test the lowest possible set of dependencies for their Python packages and have boto3/botocore as dependencies will encounter this issue.

uv resolves the lowest version of dependencies, and in this case, it installs:

  • python-dateutil==2.1 (minimum version allowed by botocore).
  • six==0.9.0 (the lowest available version since python-dateutil==2.1 does not constrain six).

This combination is incompatible and results in the following error during imports:

ImportError: cannot import name 'string_types' from 'six'

This specifically impacts the maintainers testing their packages with uv --resolution=lowest

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Package maintainers testing with uv pip install --resolution=lowest should not encounter incompatible dependency installations when relying on the latest version of boto3/botocore. The dependency resolution process should prevent incompatible versions of python-dateutil and six from being installed.

Current Behavior

When resolving dependencies with uv --resolution=lowest, boto3 and botocore allow the installation of the following versions:

boto3==1.36.0
botocore==1.36.0
python-dateutil==2.1
six==0.9.0

This combination is incompatible, resulting in the error:

ImportError: cannot import name 'string_types' from 'six'

Reproduction Steps

  1. Install the following versions manually:

pip install "boto3==1.36.0" "six<1"

  1. Attempt to import boto3:

python -c "import boto3"

or

  1. Create a Python package that depends on boto3/botocore
  2. Test the package with uv --resolution=lowest

Example:
https://github.com/pcjedi/botocoredep/actions/runs/12786849699/job/35644776921

Possible Solution

Update the python-dateutil version constraint in botocore to >=2.4, which ensures compatibility with six.

Note: During testing, it was found that all tests in botocore passed successfully only with python-dateutil>=2.7. To ensure broader compatibility, consider raising the constraint to python-dateutil>=2.7.

Additional Information/Context

This issue specifically affects package maintainers relying on boto3/botocore and testing with uv --resolution=lowest

SDK version used

1.36.0

Environment details (OS name and version, etc.)

debian

@pcjedi pcjedi added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Jan 16, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Jan 31, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK added investigating This issue is being investigated and/or work is in progress to resolve the issue. dependencies This issue is a problem in a dependency. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. dependencies This issue is a problem in a dependency. investigating This issue is being investigated and/or work is in progress to resolve the issue. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

2 participants