pypa / hatch

Modern, extensible Python project management
https://hatch.pypa.io/latest/
MIT License
5.64k stars 277 forks source link

Hatch fails with `IndexError` when testing with specific Python #1454

Open stumpylog opened 1 month ago

stumpylog commented 1 month ago

Given the configuration below, running in Github Actions with actions/setup-python@v5 to setup the specific version in a parallel action matrix, hatch will fail with an IndexError when run with a command such as hatch test --cover --python pypy3.8

...
[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "pypy3.8", "pypy3.9", "pypy3.10"]
...

I think this is two issues:

  1. hatch probably shouldn't crash if the Python version given doesn't match somethin (I'm a little unsure what that something is)
  2. hatch seems to be unable to find the version of PyPy the action sets up, based on hatch python show: https://github.com/stumpylog/tika-client/actions/runs/8927847240/job/24522134685#step:6:1

Example log: https://github.com/stumpylog/tika-client/actions/runs/8927847240/job/24522134685#step:8:1 Hatch Version: 1.10.0

ofek commented 1 month ago

I will fix that error but the test command acts upon the environment hatch-test. Can you please try modifying that environment instead? https://hatch.pypa.io/latest/config/internal/testing/#matrix

stumpylog commented 1 month ago

I see, the default matrix isn't shared as I imagined. Updating that one does resolve everything. Thanks!