pypa / hatch

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

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

Open hobbsd opened 5 months ago

hobbsd commented 5 months 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 5 months ago

Thank you, I will fix this!

hobbsd commented 5 months ago

Thank you for hatch — I'm into it!