skypilot icon indicating copy to clipboard operation
skypilot copied to clipboard

format.sh is not compatible with Python >= 3.11

Open hemildesai opened this issue 1 year ago • 4 comments

Based on the current version pinnings in requirements-dev.txt, format.sh is incompatible with Python versions >= 3.11. Is it possible to upgrade the format script to support versions >= 3.11?

Also, is there a possibility to move to Ruff for linting and formatting? I think it will help unify the format script and provide good speedups (would still need to keep mypy though). The speedups can also help with fast pre-commit hooks.

Below is the traceback on running format.sh,

Traceback (most recent call last):
  File "/home/hd10/micromamba/envs/skypilot/bin/pylint", line 8, in <module>
    sys.exit(run_pylint())
             ^^^^^^^^^^^^
  File "/home/hd10/micromamba/envs/skypilot/lib/python3.11/site-packages/pylint/__init__.py", line 21, in run_pylint
    from pylint.lint import Run as PylintRun
  File "/home/hd10/micromamba/envs/skypilot/lib/python3.11/site-packages/pylint/lint/__init__.py", line 75, in <module>
    from pylint.lint.parallel import check_parallel
  File "/home/hd10/micromamba/envs/skypilot/lib/python3.11/site-packages/pylint/lint/parallel.py", line 7, in <module>
    from pylint import reporters
  File "/home/hd10/micromamba/envs/skypilot/lib/python3.11/site-packages/pylint/reporters/__init__.py", line 25, in <module>
    from pylint import utils
  File "/home/hd10/micromamba/envs/skypilot/lib/python3.11/site-packages/pylint/utils/__init__.py", line 45, in <module>
    from pylint.utils.ast_walker import ASTWalker
  File "/home/hd10/micromamba/envs/skypilot/lib/python3.11/site-packages/pylint/utils/ast_walker.py", line 6, in <module>
    from astroid import nodes
  File "/home/hd10/micromamba/envs/skypilot/lib/python3.11/site-packages/astroid/__init__.py", line 53, in <module>
    from astroid import inference, raw_building
  File "/home/hd10/micromamba/envs/skypilot/lib/python3.11/site-packages/astroid/inference.py", line 33, in <module>
    import wrapt
  File "/home/hd10/micromamba/envs/skypilot/lib/python3.11/site-packages/wrapt/__init__.py", line 10, in <module>
    from .decorators import (adapter_factory, AdapterFactory, decorator,
  File "/home/hd10/micromamba/envs/skypilot/lib/python3.11/site-packages/wrapt/decorators.py", line 34, in <module>
    from inspect import ismethod, isclass, formatargspec
ImportError: cannot import name 'formatargspec' from 'inspect' (/home/hd10/micromamba/envs/skypilot/lib/python3.11/inspect.py)

hemildesai avatar Nov 18 '23 22:11 hemildesai

I think moving to Ruff would be great. It would fold in most of the tools in format.sh + run a zillion times faster :)

kbrgl avatar Jan 06 '24 12:01 kbrgl

gave it a try. I'm no expert in yapf so I'm not sure about how to translate all constraints from one to the next https://github.com/skypilot-org/skypilot/pull/2971

remyleone avatar Jan 10 '24 15:01 remyleone

Awesome! Haven’t looked, but if ruff preserves existing yapf styles such that we don’t have tons of formatting changes, this sounds like a no brainer.

concretevitamin avatar Jan 10 '24 18:01 concretevitamin

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar May 10 '24 01:05 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar May 21 '24 01:05 github-actions[bot]