-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Describe the bug
Attempting to install AWS CLI with
uv tool install git+https://github.com/aws/aws-cli.git@v2
fails with a traceback, because ast.Str (and a bunch of other deprecated classes) was removed in 3.14.
Quoting https://docs.python.org/dev/whatsnew/3.14.html#id9:
Remove the following classes, which have been deprecated aliases of Constant since Python 3.8 and have emitted deprecation warnings since Python 3.12:
- Bytes
- Ellipsis
- NameConstant
- Num
- Str
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
The above command should complete successfully without a traceback or other undesired complications.
Current Behavior
I already created a workaround for the global install, but here is a repro in a new virtual environment.
tmp$ uv venv --seed nst
Using CPython 3.14.0
Creating virtual environment with seed packages at: nst
+ pip==25.3
Activate with: source nst/bin/activate
tmp$ . nst/bin/activate
(nst) tmp$ python --version
Python 3.14.0
(nst) tmp$ uv pip install git+https://github.com/aws/aws-cli.git@v2
Using Python 3.14.0 environment at: nst
Updated https://github.com/aws/aws-cli.git (66fddbdca2b933cbff84f18c7e5219cb34e0
error: The build backend returned an error
Caused by: Call to `pep517.build_wheel` failed (exit status: 1)
[stderr]
Traceback (most recent call last):
File "<string>", line 14, in <module>
requires = get_requires_for_build({})
File "/Users/me/.cache/uv/git-v0/checkouts/a28ee72bf38d12f6/66fddbdca/backends/pep517.py", line 101, in get_requires_for_build_wheel
requires = flit_core.buildapi.get_requires_for_build_wheel(config_settings)
File "/Users/me/.cache/uv/builds-v0/.tmpEcMon9/lib/python3.14/site-packages/flit_core/buildapi.py", line 32, in get_requires_for_build_wheel
docstring, version = get_docstring_and_version_via_ast(module)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/Users/me/.cache/uv/builds-v0/.tmpEcMon9/lib/python3.14/site-packages/flit_core/common.py", line 160, in get_docstring_and_version_via_ast
and isinstance(child.value, ast.Str)
^^^^^^^
AttributeError: module 'ast' has no attribute 'Str'
hint: This usually indicates a problem with the package or the build environment.
Here is the same (in the same virtual environment) with just pip, which then no longer implicates uv (though it still mentions flit):
(nst) WSAC9JJH41J9J:tmp$ pip install git+https://github.com/aws/aws-cli.git@v2
Collecting git+https://github.com/aws/aws-cli.git@v2
Cloning https://github.com/aws/aws-cli.git (to revision v2) to ./pip-req-build-5ohmuar_
Running command git clone --filter=blob:none --quiet https://github.com/aws/aws-cli.git /private/tmp/pip-req-build-5ohmuar_
Running command git checkout -b v2 --track origin/v2
Switched to a new branch 'v2'
branch 'v2' set up to track 'origin/v2'.
Resolved https://github.com/aws/aws-cli.git to commit 66fddbdca2b933cbff84f18c7e5219cb34e072fc
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [18 lines of output]
Traceback (most recent call last):
File "/private/tmp/nst/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
main()
~~~~^^
File "/private/tmp/nst/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/tmp/nst/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
return hook(config_settings)
File "/private/tmp/pip-req-build-5ohmuar_/backends/pep517.py", line 101, in get_requires_for_build_wheel
requires = flit_core.buildapi.get_requires_for_build_wheel(config_settings)
File "/private/tmp/pip-build-env-ybq9tt56/overlay/lib/python3.14/site-packages/flit_core/buildapi.py", line 32, in get_requires_for_build_wheel
docstring, version = get_docstring_and_version_via_ast(module)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/private/tmp/pip-build-env-ybq9tt56/overlay/lib/python3.14/site-packages/flit_core/common.py", line 160, in get_docstring_and_version_via_ast
and isinstance(child.value, ast.Str)
^^^^^^^
AttributeError: module 'ast' has no attribute 'Str'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'git+https://github.com/aws/aws-cli.git@v2' when getting requirements to build wheel
Reproduction Steps
The "current behavior" section above contains two examples of reproducing this, one with uv pip install and the other with just pip install. They both work correctly with a Python 3.13 virtual environment.
Possible Solution
No response
Additional Information/Context
As a workaround, I did
uv tool install --python 3.13 git+https://github.com/aws/aws-cli.git@v2
This is with uv installed from Astral with
curl -LsSf https://astral.sh/uv/install.sh | sh
basically on a new Mac out of the box. On top of that, you need
uv python install 3.14
uv python install --default
CLI version used
aws-cli/2.31.22 Python/3.13.9 Darwin/24.6.0 source/arm64
Environment details (OS name and version, etc.)
MacOS Sequoia 15.7.1