hatch icon indicating copy to clipboard operation
hatch copied to clipboard

Fix "hatch test -py 3.14 --cover" IndexError crash: Add 3.14 to internal default_config matrix in env/internal/test.py

Open jwatson0 opened this issue 2 months ago • 5 comments

Fixes IndexError crash in "hatch test -py 3.14 --cover"

Before this PR:

$ 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

jwatson0 avatar Oct 09 '25 17:10 jwatson0

Can you adjust tests/cli/env/test_show.py for test_default_as_json test as well for this change?

cjames23 avatar Oct 09 '25 22:10 cjames23

https://github.com/jwatson0/hatch/pull/1

flying-sheep avatar Oct 13 '25 08:10 flying-sheep

Applied changes from commit 0636e7b

jwatson0 avatar Oct 15 '25 16:10 jwatson0

This needs another workflow run

jwatson0 avatar Oct 17 '25 15:10 jwatson0

Can you resolve conflicts and check what of your PR is still needed? A lot of this should be already merged in from other PRs

cjames23 avatar Nov 16 '25 05:11 cjames23