Skip to content

ruff 0.13.1 is crashing hatch run #2052

@pavel-sinkevich

Description

@pavel-sinkevich

Very similar to issue with click 8.3.0, ruff 0.13.1 is crashing hatch run:

hatch run ruff check

╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/hatch/c │
│ li/__init__.py:221 in main                                                   │
│                                                                              │
│   218                                                                        │
│   219 def main():  # no cov                                                  │
│   220 │   try:                                                               │
│ ❱ 221 │   │   hatch(prog_name='hatch', windows_expand_args=False)            │
│   222 │   except Exception:  # noqa: BLE001                                  │
│   223 │   │   import sys                                                     │
│   224                                                                        │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/click/c │
│ ore.py:1462 in __call__                                                      │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/click/c │
│ ore.py:1383 in main                                                          │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/click/c │
│ ore.py:1850 in invoke                                                        │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/click/c │
│ ore.py:1246 in invoke                                                        │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/click/c │
│ ore.py:814 in invoke                                                         │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/click/d │
│ ecorators.py:34 in new_func                                                  │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/hatch/c │
│ li/run/__init__.py:147 in run                                                │

│ ❱ 147 │   ctx.invoke(                                                        │
│   148 │   │   run_command,                                                   │
│   149 │   │   args=[command, *final_args],                                   │
│   150 │   │   env_names=[env_name],                                          │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/click/c │
│ ore.py:814 in invoke                                                         │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/click/d │
│ ecorators.py:46 in new_func                                                  │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/hatch/c │
│ li/env/run.py:123 in run                                                     │
│                                                                              │
│   120 │   if filter_json:                                                    │
│   121 │   │   import json                                                    │
│   122 │   │                                                                  │
│ ❱ 123 │   │   filter_data = json.loads(filter_json)                          │
│   124 │   │   if not isinstance(filter_data, dict):                          │
│   125 │   │   │   app.abort('The --filter/-f option must be a JSON mapping') │
│   126                                                                        │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/json/__init__.py:339  │
│ in loads                                                                     │
│                                                                              │
│   336 │   │   │   │   │   │   │   │     s, 0)                                │
│   337 │   else:                                                              │
│   338 │   │   if not isinstance(s, (bytes, bytearray)):                      │
│ ❱ 339 │   │   │   raise TypeError(f'the JSON object must be str, bytes or by │
│   340 │   │   │   │   │   │   │   f'not {s.__class__.__name__}')             │
│   341 │   │   s = s.decode(detect_encoding(s), 'surrogatepass')              │
│   342                                                                        │
╰──────────────────────────────────────────────────────────────────────────────╯
TypeError: the JSON object must be str, bytes or bytearray, not Sentinel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions