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

Support for Python 3.11 #891

Closed
blazewicz opened this issue Nov 21, 2022 · 4 comments
Closed

Support for Python 3.11 #891

blazewicz opened this issue Nov 21, 2022 · 4 comments

Comments

@blazewicz
Copy link

blazewicz commented Nov 21, 2022

We're using invoke internally and it seems to be the last dependency incompatible with Python 3.11.

Error we're getting is pasted below, probably not the last one.

Traceback (most recent call last):
  File ".venv/bin/invoke", line 8, in <module>
    sys.exit(program.run())
             ^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/invoke/program.py", line 373, in run
    self.parse_collection()
  File ".venv/lib/python3.11/site-packages/invoke/program.py", line 465, in parse_collection
    self.load_collection()
  File ".venv/lib/python3.11/site-packages/invoke/program.py", line 699, in load_collection
    module, parent = loader.load(coll_name)
                     ^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/invoke/loader.py", line 76, in load
    module = imp.load_module(name, fd, path, desc)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/imp.py", line 235, in load_module
    return load_source(name, filename, file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/imp.py", line 172, in load_source
    module = _load(spec)
             ^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 721, in _load
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "src/tasks.py", line 29, in <module>
    @task(name="migrate")
     ^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/invoke/tasks.py", line 357, in inner
    obj = klass(
          ^^^^^^
  File ".venv/lib/python3.11/site-packages/invoke/tasks.py", line 76, in __init__
    self.positional = self.fill_implicit_positionals(positional)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/invoke/tasks.py", line 167, in fill_implicit_positionals
    args, spec_dict = self.argspec(self.body)
                      ^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/invoke/tasks.py", line 153, in argspec
    spec = inspect.getargspec(func)
           ^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?
@oznogon
Copy link

oznogon commented Dec 4, 2022

Similar to/dupe of #833, which contains workarounds (shimming getargspec or switching to a fork that applies the patch); #458 and #606 would fix this specific error if merged. Maintainers suggest this is blocked by #856 (remove python2 support).

@blazewicz
Copy link
Author

I can confirm that issue was fixed with 8f6c061, we're awaiting for next release.

@Snooz82
Copy link

Snooz82 commented Jan 14, 2023

Any ideas when the next release will come?

@blazewicz
Copy link
Author

Support for 3.11 was brought with release 2.0.0 🎉 thanks @bitprophet!

trey-stafford added a commit to nsidc/qgreenland that referenced this issue Jan 20, 2023
We'll have to hold off on upgrading to python 3.11 until invoke v2.0 is
released. Although invoke can be installed with python v3.11, attempts to use it
result in an error. See: pyinvoke/invoke#891
phreer pushed a commit to phreer/platform2 that referenced this issue Sep 12, 2023
We have to bump CherryPy from 17.4.2 to 18.8.0, due to
a compatibility issue with CherryPy 17's dependency, invoke, and
Python 3.11 (used outside chroot).

We would see the following error without this change:
module 'inspect' has no attribute 'getargspec'

It is unclear if the new version of CherryPy still uses invoke,
but we don't see the error after upgrading.

See pyinvoke/invoke#891 for more info about
the error.

BUG=None
TEST=# Test inside (python 3.8.16) and outside (python 3.11.4)
     # of chroot.
     ./host-run.sh

Change-Id: I3236a04c994c719efd810b8d2e6e881f198a3be5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/4811705
Reviewed-by: Firas Sammoura <fsammoura@google.com>
Tested-by: Craig Hesling <hesling@chromium.org>
Commit-Queue: Craig Hesling <hesling@chromium.org>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants