Repository navigation
Why doesn't hatch find an installed python interpreter to be used in a test environment ? #1918
Replies: 1 comment
|
Current Hatch makes the resolution policy explicit: virtual environments can resolve from two sources, [tool.hatch.envs.test]
python-sources = ["external", "internal"]So on a current Hatch release, an interpreter installed by: hatch python install 3.10
hatch python find 3.10is a valid internal source for an environment selecting Python 3.10. Given that the report is from Hatch 1.14.0, I would first upgrade Hatch and recreate the failed test environment rather than changing hatch self update
hatch python find 3.10
hatch env remove test.py310
hatch run test.py310:covIf you intentionally want to force only the managed interpreter, current Hatch also lets you make that explicit: [tool.hatch.envs.test]
python-sources = ["internal"]Conversely, The subdirectory layout of the project should not itself prevent discovery of an internally managed Python. The useful diagnostic is |
Uh oh!
There was an error while loading. Please reload this page.
I have a python project inside a sub-directory of my git-repo.
The
pyproject.tomlcontains this snippet to configure python interpreter for the test environment(s):This python version seems to be installed:
$ hatch --version Hatch, version 1.14.0 $ hatch python show Installed ┏━━━━━━┳━━━━━━━━━┓ ┃ Name ┃ Version ┃ ┡━━━━━━╇━━━━━━━━━┩ │ 3.10 │ 3.10.16 │ ├──────┼─────────┤ │ 3.12 │ 3.12.8 │ └──────┴─────────┘But when I try to run tests,
hatchcan't setup that env !?I have tried using
3.10as the version string too, but that isn't found either.It works though when using
312as the version string.All reactions