pypa / hatch

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

Running 'hatch test' command, default matrix does not respect 'requires-python' #1571

Open hobbsd opened 1 month ago

hobbsd commented 1 month ago

Discussed in https://github.com/pypa/hatch/discussions/1568

I have one project with requires-python = ">=3.8", and running hatch test works — the project gets installed in the 'hatch-test.py3.11' environment, so the imports within my test modules work.

A second project has requires-python = ">=3.12", and running hatch test doesn't create a new 'hatch-test.py3.12' environment and install the project in it, so the tests error out.

I thought changing requires-python to ">=3.11" in the second project might make hatch test go ahead and install the project in the existing 3.11 hatch-test environment, but it didn't. But running hatch test -py 3.12 created a new 3.12 test environment and worked.

ofek commented 1 month ago

Thank you, I will fix this!

hobbsd commented 1 month ago

Thank you for hatch — I'm into it!