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

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

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

v1v
Copy link
Member

@v1v v1v 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

@v1v v1v added backport-7.17 Automated backport to the 7.17 branch with mergify backport-8.x Automated backport to the 8.x branch with mergify backport-8.16 Automated backport with mergify backport-8.17 Automated backport with mergify labels Jan 7, 2025
@v1v v1v requested a review from a team as a code owner January 7, 2025 09:21
@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.

@mergify mergify bot assigned v1v Jan 7, 2025
@rdner rdner merged commit 6474305 into elastic:main Jan 7, 2025
10 checks passed
mergify bot pushed a commit that referenced this pull request Jan 7, 2025
…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 bot pushed a commit that referenced this pull request Jan 7, 2025
…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 bot pushed a commit that referenced this pull request Jan 7, 2025
…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 bot pushed a commit that referenced this pull request Jan 7, 2025
…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)
rdner pushed a commit that referenced this pull request Jan 7, 2025
…42233) (#42237)

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

* check-docs uses python too

* single quote

(cherry picked from commit 6474305)

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
rdner pushed a commit that referenced this pull request Jan 7, 2025
…42233) (#42238)

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

* check-docs uses python too

* single quote

(cherry picked from commit 6474305)

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
rdner pushed a commit that referenced this pull request Jan 7, 2025
…42233) (#42240)

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

* check-docs uses python too

* single quote

(cherry picked from commit 6474305)

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
rdner pushed a commit that referenced this pull request Jan 7, 2025
…42233) (#42239)

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

* check-docs uses python too

* single quote

(cherry picked from commit 6474305)

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7.17 Automated backport to the 7.17 branch with mergify backport-8.x Automated backport to the 8.x branch with mergify backport-8.16 Automated backport with mergify backport-8.17 Automated backport with mergify needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants