mise icon indicating copy to clipboard operation
mise copied to clipboard

`mise use --global [email protected]` copies virtualenv configuration from current directory

Open rouge8 opened this issue 1 year ago • 0 comments

Describe the bug

When I run mise use --global [email protected] from a directory with a mise.toml and a virtualenv configuration, mise copies the virtualenv configuration to the global Python which is definitely not what I want/expect.

To Reproduce

❯ cat mise.toml 
[tools]
python = {version="3.13.0", virtualenv=".ve"}
❯ mise trust
mise trusted /Users/andyfreeland/tmp/mise-venv-bug/mise.toml
mise WARN  no venv found at: ~/tmp/mise-venv-bug/.ve

To create a virtualenv manually, run:
python -m venv ~/tmp/mise-venv-bug/.ve
❯ mise use --global [email protected]
mise hint use multiple versions simultaneously with mise use [email protected] [email protected]
mise WARN  python is defined in ~/tmp/mise-venv-bug/mise.toml which overrides the global config (~/.config/mise/config.toml)
mise ~/.config/mise/config.toml tools: [email protected]
mise WARN  no venv found at: ~/tmp/mise-venv-bug/.ve

To create a virtualenv manually, run:
python -m venv ~/tmp/mise-venv-bug/.ve
❯ cat ~/.config/mise/config.toml
[tools]
python = { version = "3.13", virtualenv = ".ve" }

[settings]
experimental = true

Expected behavior

The virtualenv setting should not affect the global config.

mise doctor output

❯ mise doctor
version: 2024.12.4 macos-arm64 (2024-12-09)
activated: yes
shims_on_path: no

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Mon, 9 Dec 2024 19:22:13 +0000
  Rust Version: rustc 1.83.0 (90b35a623 2024-11-26) (Homebrew)
  Profile: release

shell:
  /opt/homebrew/bin/fish
  fish, version 3.7.1

dirs:
  cache: ~/Library/Caches/mise
  config: ~/.config/mise
  data: ~/.local/share/mise
  shims: ~/.local/share/mise/shims
  state: ~/.local/state/mise

config_files:
  ~/.config/mise/config.toml
  ~/tmp/mise-venv-bug/mise.toml

backends:
  aqua
  asdf
  cargo
  core
  gem
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  opa        https://github.com/tochukwuvictor/asdf-opa.git#5734a47
  terraform  https://github.com/asdf-community/asdf-hashicorp.git#0346f5d

toolset:
  core:[email protected]

env_vars:
  MISE_SHELL=fish

settings:
  experimental  true ~/.config/mise/config.toml

No problems found

Additional context Add any other context about the problem here. Consider running mise with --debug or --trace for extra debug info.

rouge8 avatar Dec 09 '24 23:12 rouge8