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.
Discussed in https://github.com/pypa/hatch/discussions/1568
I have one project with
requires-python = ">=3.8"
, and runninghatch 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 runninghatch 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 makehatch test
go ahead and install the project in the existing 3.11 hatch-test environment, but it didn't. But runninghatch test -py 3.12
created a new 3.12 test environment and worked.