Skip to content

Support for Python 3.11 #891

Closed
Closed

Description

@blazewicz

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'?

Activity

  1. oznogon commented on Dec 4, 2022

    @oznogon

    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).

  2. blazewicz commented on Dec 23, 2022

    @blazewicz
    Author

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

  3. Snooz82 commented on Jan 14, 2023

    @Snooz82

    Any ideas when the next release will come?

  4. blazewicz commented on Jan 17, 2023

    @blazewicz
    Author

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

  5. added a commit that references this issue on Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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