Skip to content

Conversation

@hugovk
Copy link
Contributor

@hugovk hugovk commented Apr 25, 2025

The CI was installing Python Docs Theme from GitHub:

git+https://github.com/python/python-docs-theme.git#egg=python-docs-theme

And the theme recently dropped Python 3.10 and 3.11: python/python-docs-theme#234

But the CI is using 3.11:

python-version: "3.11"

The quickest fix is to pin python-docs-theme==2025.2, which is the most recent release and still supports Python 3.11.


There's another error when using Python 3.13 on the CI:

Details
WARNING: autodoc: failed to import module 'swift' from module 'bandersnatch_storage_plugins'; the following exception was raised:
looking for now-outdated files... none found
['Traceback (most recent call last):\n', '  File "/home/runner/work/bandersnatch/bandersnatch/.tox/doc_build/lib/python3.13/site-packages/sphinx/ext/autodoc/importer.py", line 175, in import_module\n    module = importlib.import_module(modname)\n', '  File "/opt/hostedtoolcache/Python/3.13.3/x64/lib/python3.13/importlib/__init__.py", line 88, in import_module\n    return _bootstrap._gcd_import(name[level:], package, level)\n           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', '  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import\n', '  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load\n', '  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked\n', '  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked\n', '  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module\n', '  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed\n', '  File "/home/runner/work/bandersnatch/bandersnatch/.tox/doc_build/lib/python3.13/site-packages/bandersnatch_storage_plugins/swift.py", line 229, in <module>\n    class SwiftPath(pathlib.Path):\n    ...<229 lines>...\n                    yield from path.iterdir(conn=conn, recurse=recurse)\n', '  File "/home/runner/work/bandersnatch/bandersnatch/.tox/doc_build/lib/python3.13/site-packages/bandersnatch_storage_plugins/swift.py", line 230, in SwiftPath\n    _flavour = getattr(pathlib, "_posix_flavour")  # noqa\n', "AttributeError: module 'pathlib' has no attribute '_posix_flavour'\n", '\nThe above exception was the direct cause of the following exception:\n\n', 'Traceback (most recent call last):\n', '  File "/home/runner/work/bandersnatch/bandersnatch/.tox/doc_build/lib/python3.13/site-packages/sphinx/ext/autodoc/importer.py", line 269, in import_object\n    module = import_module(modname, try_reload=True)\n', '  File "/home/runner/work/bandersnatch/bandersnatch/.tox/doc_build/lib/python3.13/site-packages/sphinx/ext/autodoc/importer.py", line 187, in import_module\n    raise ImportError(exc, traceback.format_exc()) from exc\n', 'ImportError: (AttributeError("module \'pathlib\' has no attribute \'_posix_flavour\'"), \'Traceback (most recent call last):\\n  File "/home/runner/work/bandersnatch/bandersnatch/.tox/doc_build/lib/python3.13/site-packages/sphinx/ext/autodoc/importer.py", line 175, in import_module\\n    module = importlib.import_module(modname)\\n  File "/opt/hostedtoolcache/Python/3.13.3/x64/lib/python3.13/importlib/__init__.py", line 88, in import_module\\n    return _bootstrap._gcd_import(name[level:], package, level)\\n           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import\\n  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load\\n  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked\\n  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked\\n  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module\\n  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed\\n  File "/home/runner/work/bandersnatch/bandersnatch/.tox/doc_build/lib/python3.13/site-packages/bandersnatch_storage_plugins/swift.py", line 229, in <module>\\n    class SwiftPath(pathlib.Path):\\n    ...<229 lines>...\\n                    yield from path.iterdir(conn=conn, recurse=recurse)\\n  File "/home/runner/work/bandersnatch/bandersnatch/.tox/doc_build/lib/python3.13/site-packages/bandersnatch_storage_plugins/swift.py", line 230, in SwiftPath\\n    _flavour = getattr(pathlib, "_posix_flavour")  # noqa\\nAttributeError: module \\\'pathlib\\\' has no attribute \\\'_posix_flavour\\\'\\n\')\n'] [autodoc.import_object]

https://github.com/hugovk/bandersnatch/actions/runs/14668936590/job/41170649424#step:6:51

A longer term fix is to dig into that, but I think this PR is fine for now?

@codecov
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.40%. Comparing base (4d020e8) to head (edaf77e).
Report is 272 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1935      +/-   ##
==========================================
+ Coverage   79.69%   86.40%   +6.71%     
==========================================
  Files          31       35       +4     
  Lines        4324     4458     +134     
  Branches      780      467     -313     
==========================================
+ Hits         3446     3852     +406     
+ Misses        721      429     -292     
- Partials      157      177      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hugovk
Copy link
Contributor Author

hugovk commented Apr 25, 2025

Please let me know if this needs a changelog entry.

Copy link
Contributor

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

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

Many thanks - Can not remember for the life of me why this didn't work

Locally I worked out why I didn't repro:

cooper@cooper-fedora-MJ0J8MTZ:~$ /tmp/tb/bin/python -V
Python 3.13.2

@cooperlees cooperlees added the skip news Skip CI check for news/changelog label Apr 25, 2025
@cooperlees cooperlees merged commit dea0be9 into pypa:main Apr 25, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news Skip CI check for news/changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants