Skip to content

Issue with ast in Python3.14 #893

@rossbar

Description

@rossbar

We've encountered an issue with nbqa with Python3.14; specifically an AttributeError with ast:

nbQA failed to process content/algorithms/assortativity/correlation.md
with exception "AttributeError("module 'ast' has no attribute 'Str'")"

Reproduce

git clone https://github.com/networkx/nx-guides
python3.14 -m venv test-env
source test-env/bin/activate
pip install -r requirements.txt 
pip install pre-commit
pre-commit install
pre-commit run --all-files

which gives

nbqa-pyupgrade...........................................................Failed
- hook id: nbqa-pyupgrade
- exit code: 123

nbQA failed to process content/algorithms/assortativity/correlation.md with exception "AttributeError("module 'ast' has no attribute 'Str'")"
nbQA failed to process content/algorithms/dag/index.md with exception "AttributeError("module 'ast' has no attribute 'Str'")"
nbQA failed to process content/exploratory_notebooks/facebook_notebook.md with exception "AttributeError("module 'ast' has no attribute 'Str'")"
nbQA failed to process content/generators/geometric.md with exception "AttributeError("module 'ast' has no attribute 'Str'")"

If you believe the notebook(s) to be valid, please report a bug at https://github.com/nbQA-dev/nbQA/issues 

nbqa-black...............................................................Failed
- hook id: nbqa-black
- exit code: 123

All done! ✨ 🍰 ✨
8 files left unchanged.

nbQA failed to process content/algorithms/assortativity/correlation.md with exception "AttributeError("module 'ast' has no attribute 'Str'")"
nbQA failed to process content/algorithms/dag/index.md with exception "AttributeError("module 'ast' has no attribute 'Str'")"
nbQA failed to process content/exploratory_notebooks/facebook_notebook.md with exception "AttributeError("module 'ast' has no attribute 'Str'")"
nbQA failed to process content/generators/geometric.md with exception "AttributeError("module 'ast' has no attribute 'Str'")"

If you believe the notebook(s) to be valid, please report a bug at https://github.com/nbQA-dev/nbQA/issues 

Additional context

Runs fine with python3.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions