#i don't see anything here about
1 messages · Page 1 of 1 (latest)
[[tool.hatch.envs.default.matrix]]
python = ["3.12", "3.11", "3.10", "3.9", "3.8"]
and then you can run something like hatch run python -c "import sys;print(sys.executable)"
thanks, i'll give it a go in an hour or two, see how it goes.
np lmk, I'm always here
do you have an example of anything that is currently using this already?
what do you mean?
Is there any project that is already using matrix?
some users here https://hatch.pypa.io/latest/community/users/
is there something in particular you are trying to find out?
the short of it is that i need to do
python -m pip install venv venv && activate
python -m pip install -r requirements.txt
python -m module --option1 --option2 arg.py
start exe
python main.py
``` on a matrix
i have my own hombrew solution but it's only for windows and relies on the pylauncher
that seems pretty standard and is totally possible, have you read the docs?
sorry for the lack of response, got a bit busy with other stuff
[[tool.hatch.envs.main.matrix]]
python = ["3.11", "3.12"]
[tool.hatch.envs.main]
dependencies = ["rich"]
[tool.hatch.envs.main.scripts]
hello = "python --version"
``` in theory this should be able to just run with `hatch run main`
unless i'm missing something
welp, it didn't
hatch run main:hello
environment selection is shown throughout the documentation:
that's pretty cool, thank you!
main 0.0.0 /home/krrt/Desktop/sampler
it seems to create an editable project however, is there a way i can avoid this?
can i make it create a clean env each run? rather than reusing the venv
You can remove a single environment or environment matrix by using the env remove command or all of a project's environments by using the env prune command.
maybe i'm doing something wrong there
everything is documented https://hatch.pypa.io/latest/config/environment/overview/#dev-mode
the tables show configuration and currently there is no indication of which environments are created or not
thank you!
i'm not finding a sort of cleanup everytime option however
is that planned?
what do you mean by that?
i want everything to be built from scratch every time
final two questions
can i pass pip commands like --upgrade-deps globally? rather than needing python.exe -m pip install --upgrade pip as part of the script
does hatch have a discord?
that is planned but right now you can easily set environment variables to modify behavior
[[tool.hatch.envs.main.matrix]]
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
nuitka_versions = ["nuitka", "https://github.com/Nuitka/Nuitka/archive/factory.zip"]
[tool.hatch.envs.main]
dependencies = ["{matrix:nuitka_versions}"]
dev-mode = false
skip-install = true
[tool.hatch.envs.main.scripts]
hello = "python -m pip install --upgrade pip && python main.py"
either that or i'm doing something dumb
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect:
'C:\Users\NuitkaDevOps\AppData\Local\hatch\env\.metadata\rkHVLIwO\virtual\main.py3.7-https:\github.com\Nuitka\Nuitka\ar
chive\factory.zip.json'
seems like it grabs the arg and sets it as a path on disk
the values of matrix variables should be representable as filesystem names
you should use the overrides mechanism to do complex stuff https://hatch.pypa.io/latest/config/environment/advanced/#matrix-variable-overrides
[[tool.hatch.envs.main.matrix]]
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
nuitka = ["standard", "dev"]
[tool.hatch.envs.main.overrides]
matrix.nuitka.dependencies = [
{ value = "nuitka", if = ["standard"] },
{ value = "nuitka @ https://github.com/Nuitka/Nuitka/archive/factory.zip", if = ["dev"] },
]
thank you that works, is it safe to create a venv from within the hatch matrix enviroment?