mise icon indicating copy to clipboard operation
mise copied to clipboard

env files with mise.lock

Open jdx opened this issue 9 months ago • 2 comments

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

  1. Create a new folder.
  2. Add a mise.toml and a mise.lock empty files.
  3. Enable experimental features
mise settings set experimental true -l
  1. 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"
  1. Set the environment variable:
export MISE_ENV=workspace
  1. 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

jdx avatar Mar 30 '25 13:03 jdx