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

[7.17](backport #42233) github-actions: python 3.12 is the default when using ubuntu-latest #42237

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 7, 2025

Proposed commit message

The GitHub runners has been bumped from ubuntu-22 to ubuntu-24 and the default python version has changed from 3.10 to 3.12. See actions/runner-images#10636

For the long run: make check-default should be updated to support 3.12.

This a workaround for:

ModuleNotFoundError: No module named 'lib2to3'
Traceback (most recent call last):
  File "/home/runner/work/beats/beats/build/python-env/bin/autopep8", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/autopep8.py", line 4474, in main
    results = fix_multiple_files(args.files, args, sys.stdout)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/autopep8.py", line 4369, in fix_multiple_files
    ret = _fix_file((name, options, output))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/autopep8.py", line 4345, in _fix_file
    return fix_file(*parameters)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/autopep8.py", line 3596, in fix_file
    original_source = readlines_from_file(filename)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/autopep8.py", line 188, in readlines_from_file
    with open_with_encoding(filename) as input_file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/autopep8.py", line 165, in open_with_encoding
    encoding = detect_encoding(filename, limit_byte_check=limit_byte_check)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/autopep8.py", line 175, in detect_encoding
    from lib2to3.pgen2 import tokenize as lib2to3_tokenize
ModuleNotFoundError: No module named 'lib2to3'
Traceback (most recent call last):
  File "/home/runner/work/beats/beats/build/python-env/bin/pylint", line 5, in <module>
    from pylint import run_pylint
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/pylint/__init__.py", line 13, in <module>
    from pylint.checkers.similar import Run as SimilarRun
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/pylint/checkers/__init__.py", line 42, in <module>
    from pylint.checkers.base_checker import BaseChecker, BaseTokenChecker
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/pylint/checkers/base_checker.py", line 17, in <module>
    from pylint.config import OptionsProviderMixIn
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/pylint/config.py", line 49, in <module>
    from pylint import utils
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/pylint/utils/__init__.py", line 44, in <module>
    from pylint.utils.ast_walker import ASTWalker
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/pylint/utils/ast_walker.py", line 8, in <module>
    from astroid import nodes
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/astroid/__init__.py", line 43, in <module>
    import wrapt
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/wrapt/__init__.py", line 10, in <module>
    from .decorators import (adapter_factory, AdapterFactory, decorator,
  File "/home/runner/work/beats/beats/build/python-env/lib/python3.12/site-packages/wrapt/decorators.py", line 34, in <module>
    from inspect import ismethod, isclass, formatargspec
ImportError: cannot import name 'formatargspec' from 'inspect' (/usr/lib/python3.12/inspect.py). Did you mean: 'formatargvalues'?
Code is not compatible with Python 3

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs


This is an automatic backport of pull request #42233 done by [Mergify](https://mergify.com).

…42233)

github-actions: python 3.12 is the default when using ubuntu-latest

* check-docs uses python too

* single quote

(cherry picked from commit 6474305)
@mergify mergify bot added the backport label Jan 7, 2025
@mergify mergify bot requested a review from a team as a code owner January 7, 2025 13:03
@mergify mergify bot assigned v1v Jan 7, 2025
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 7, 2025
@botelastic
Copy link

botelastic bot commented Jan 7, 2025

This pull request doesn't have a Team:<team> label.

@rdner rdner merged commit ff0fb42 into 7.17 Jan 7, 2025
11 checks passed
@rdner rdner deleted the mergify/bp/7.17/pr-42233 branch January 7, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants