env files with mise.lock
Discussed in https://github.com/jdx/mise/discussions/4755
Originally posted by acesyde March 30, 2025 I'm encountering some behavior that I wanted to confirm is intended before opening a formal issue. Here are the steps I've followed:
Steps to Reproduce
- Create a new folder.
- Add a
mise.tomland amise.lockempty files. - Enable experimental features
mise settings set experimental true -l
- Install Python (example: version 3.13):
mise use [email protected]
At this point, the files contain the following
mise.toml
[settings]
experimental = true
[tools]
python = "3.13"
mise.lock
[tools.python]
version = "3.13.2"
backend = "core:python"
- Set the environment variable:
export MISE_ENV=workspace
- Install pre-commit:
mise use [email protected]
After this, a new file named mise.workspace.toml is created, containing:
[tools]
pre-commit = "4.2"
And the mise.lock doesn't seems to be affected
mise.lock
[tools.python]
version = "3.13.2"
backend = "core:python"
Observations
Environment Installation Behavior
When installing pre-commit, I did not specify the -e/--env parameter. Despite this, the tool was added to the mise.workspace.toml file. Is this the expected behavior?
Lock File Inconsistency
The mise.lock file does not contain the pre-commit package entry. Shouldn't it be listed here as well? Or is the mise.workspace.toml meant to override the lock file under these circumstances?
Would love to get your feedback on whether these behaviors are expected or if I'm perhaps missing a step or misunderstanding how mise is intended to handle this scenario.
Ping @jdx
#4307 #4730