Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hatch test fails with IndexError when getting unknown environment #1866

Open
nightblure opened this issue Dec 23, 2024 · 0 comments
Open

hatch test fails with IndexError when getting unknown environment #1866

nightblure opened this issue Dec 23, 2024 · 0 comments

Comments

@nightblure
Copy link

nightblure commented Dec 23, 2024

Given: my pyproject.toml not contains env "3.13":

[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

Attempt to run command with unknown environment hatch test -i python="3.13" --cover and get next output:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /opt/homebrew/Cellar/hatch/1.14.0/libexec/lib/python3.13/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                                                                                            │
│                                                                                                  │
│ /opt/homebrew/Cellar/hatch/1.14.0/libexec/lib/python3.13/site-packages/click/core.py:1157 in     │
│ __call__                                                                                         │
│                                                                                                  │
│ /opt/homebrew/Cellar/hatch/1.14.0/libexec/lib/python3.13/site-packages/click/core.py:1078 in     │
│ main                                                                                             │
│                                                                                                  │
│ /opt/homebrew/Cellar/hatch/1.14.0/libexec/lib/python3.13/site-packages/click/core.py:1688 in     │
│ invoke                                                                                           │
│                                                                                                  │
│ /opt/homebrew/Cellar/hatch/1.14.0/libexec/lib/python3.13/site-packages/click/core.py:1434 in     │
│ invoke                                                                                           │
│                                                                                                  │
│ /opt/homebrew/Cellar/hatch/1.14.0/libexec/lib/python3.13/site-packages/click/core.py:783 in      │
│ invoke                                                                                           │
│                                                                                                  │
│ /opt/homebrew/Cellar/hatch/1.14.0/libexec/lib/python3.13/site-packages/click/decorators.py:33 in │
│ new_func                                                                                         │
│                                                                                                  │
│ /opt/homebrew/Cellar/hatch/1.14.0/libexec/lib/python3.13/site-packages/hatch/cli/test/__init__.p │
│ y: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
@nightblure nightblure changed the title Hatch test fails with "index out of range" Hatch test fails with IndexError Dec 23, 2024
@nightblure nightblure changed the title Hatch test fails with IndexError hatch test fails with IndexError Dec 23, 2024
@nightblure nightblure changed the title hatch test fails with IndexError hatch test fails with IndexError when getting unknown environment Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant