Thanks to visit codestin.com
Credit goes to github.com

Skip to content

"hatch test -py 3.14 --cover" crashes with IndexError #2081

@jwatson0

Description

@jwatson0

Even though I have 3.14 included in tool.hatch.envs.test.matrix in pyproject.toml,
I get a crash when running hatch test -py 3.14 --cover. It's specific to 3.14 and --cover.

$ hatch --version
Hatch, version 1.14.2
[[tool.hatch.envs.test.matrix]]
python = ["3.12", "3.13", "3.14"]
$ hatch test -py 3.14 --cover
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/jwatson/.pyenv/versions/3.14.0/lib/python3.14/site-packages/hatch/cli/__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                                                                                            │
│                                                                                                  │
│ /home/jwatson/.pyenv/versions/3.14.0/lib/python3.14/site-packages/click/core.py:1462 in __call__ │
│                                                                                                  │
│ /home/jwatson/.pyenv/versions/3.14.0/lib/python3.14/site-packages/click/core.py:1383 in main     │
│                                                                                                  │
│ /home/jwatson/.pyenv/versions/3.14.0/lib/python3.14/site-packages/click/core.py:1850 in invoke   │
│                                                                                                  │
│ /home/jwatson/.pyenv/versions/3.14.0/lib/python3.14/site-packages/click/core.py:1246 in invoke   │
│                                                                                                  │
│ /home/jwatson/.pyenv/versions/3.14.0/lib/python3.14/site-packages/click/core.py:814 in invoke    │
│                                                                                                  │
│ /home/jwatson/.pyenv/versions/3.14.0/lib/python3.14/site-packages/click/decorators.py:34 in      │
│ new_func                                                                                         │
│                                                                                                  │
│ /home/jwatson/.pyenv/versions/3.14.0/lib/python3.14/site-packages/hatch/cli/test/__init__.py:199 │
│ in test                                                                                          │
│                                                                                                  │
│   196 │   │   │   context.env_vars['COVERAGE_PROCESS_START'] = coverage_config_file              │
│   197 │                                                                                          │
│   198 │   if cover:                                                                              │
│ ❱ 199 │   │   for context in app.runner_context([selected_envs[0]]):                             │
│   200 │   │   │   context.add_shell_command('cov-combine')                                       │
│   201 │   │                                                                                      │
│   202 │   │   if not cover_quiet:                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: list index out of range

PR #2080 fixes it for me.

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