hatch icon indicating copy to clipboard operation
hatch copied to clipboard

run environment with specific python patch-release version

Open 15r10nk opened this issue 1 year ago • 2 comments

Hi, thank you for writing hatch. I really like it a lot.

I have sometimes issues where my library has problems if it is used with a specific python version like 3.12.5. Is possible to specify a specific patch-release to be used for hatch test?

It would also be useful to specify different versions in a matrix like this:

[[tool.hatch.envs.test.matrix]]
python = ["3.12.0", "3.12.1"]

I tried also to install a specific python version but it didn't worked.

> hatch python install 3.12.3
Unknown distributions: 3.12.3

15r10nk avatar Aug 18 '24 12:08 15r10nk

Automatic installation of patch releases is not possible, but will be eventually. What you can do right now however is manually install what you want and ensure that it is on PATH.

ofek avatar Aug 18 '24 17:08 ofek

+1

another use case for being able to choose python versions down to the patch version is ray, the distributed machine learning framework. Ray requires the client that submits a job to the cluster having the exact same python version down to patch version as the worker.

nucflash avatar May 23 '25 21:05 nucflash