mirror of https://github.com/jdx/mise
parent
2e62fbe05a
commit
1cf5b49b4e
|
@ -56,14 +56,14 @@ variable.
|
|||
## Precompiled python binaries
|
||||
|
||||
By default, mise will
|
||||
download [precompiled binaries](https://github.com/indygreg/python-build-standalone)
|
||||
download [precompiled binaries](https://github.com/astral-sh/python-build-standalone)
|
||||
for python instead of compiling them with python-build. This makes installing python much faster.
|
||||
|
||||
In addition to being faster, it also means you don't have to install all of the system dependencies
|
||||
either.
|
||||
|
||||
That said, there are
|
||||
some [quirks](https://github.com/indygreg/python-build-standalone/blob/main/docs/quirks.rst)
|
||||
some [quirks](https://github.com/astral-sh/python-build-standalone/blob/main/docs/quirks.rst)
|
||||
with the precompiled binaries to be aware of.
|
||||
|
||||
If you'd like to disable these binaries, set `mise settings python.compile=1`.
|
||||
|
|
|
@ -4,15 +4,15 @@ export MISE_PYTHON_DEFAULT_PACKAGES_FILE="$HOME/.default-python-packages"
|
|||
|
||||
cat >.mise.toml <<EOF
|
||||
[env._.python]
|
||||
venv = {path = "my_venv", create=true}
|
||||
venv = {path = "{{env.HOME}}/my_venv", create=true}
|
||||
[tools]
|
||||
python = "3.12.3"
|
||||
EOF
|
||||
|
||||
mise i
|
||||
assert "mise x -- python --version" "Python 3.12.3"
|
||||
assert "mise env -s bash | grep VIRTUAL_ENV" "export VIRTUAL_ENV=$PWD/my_venv"
|
||||
assert "mise x -- which python" "$PWD/my_venv/bin/python"
|
||||
assert "mise env -s bash | grep VIRTUAL_ENV" "export VIRTUAL_ENV=$HOME/my_venv"
|
||||
assert "mise x -- which python" "$HOME/my_venv/bin/python"
|
||||
|
||||
# verify nested virtualenv is used
|
||||
mkdir -p subdir
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
cat <<'EOF' >mise.toml
|
||||
cat <<EOF >mise.toml
|
||||
[env]
|
||||
mise.file = ['.test-env']
|
||||
EOF
|
||||
|
||||
echo FOO_FROM_FILE=foo_from_file >.test-env
|
||||
echo TEST_ENV2=foo >.test-env2
|
||||
|
||||
assert "mise x -- env | grep FOO_FROM_FILE" "FOO_FROM_FILE=foo_from_file"
|
||||
assert "MISE_ENV_FILE=.test-env2 mise x -- env | grep TEST_ENV2" "TEST_ENV2=foo"
|
||||
|
||||
cat <<'EOF' >mise.toml
|
||||
cat <<EOF >mise.toml
|
||||
[env]
|
||||
_.file = 'not_present'
|
||||
EOF
|
||||
assert "mise env" # does not error
|
||||
|
||||
cat <<'EOF' >mise.toml
|
||||
cat <<EOF >mise.toml
|
||||
[env]
|
||||
_.file = ['a', 'b.json']
|
||||
EOF
|
||||
|
@ -25,3 +23,10 @@ echo 'export A=1' >a
|
|||
echo '{"B": 2}' >b.json
|
||||
assert "mise env | grep -v PATH" "export A=1
|
||||
export B=2"
|
||||
|
||||
cat <<EOF >mise.toml
|
||||
[env]
|
||||
mise.file = ['{{env.HOME}}/.home-test-env']
|
||||
EOF
|
||||
echo FOO_FROM_FILE=foo_from_file_home >~/.home-test-env
|
||||
assert "mise x -- env | grep FOO_FROM_FILE" "FOO_FROM_FILE=foo_from_file_home"
|
||||
|
|
|
@ -173,14 +173,14 @@ impl PythonPlugin {
|
|||
if cfg!(unix) {
|
||||
hint!(
|
||||
"python_precompiled",
|
||||
"installing precompiled python from indygreg/python-build-standalone\n\
|
||||
"installing precompiled python from astral-sh/python-build-standalone\n\
|
||||
if you experience issues with this python (e.g.: running poetry), switch to python-build by running",
|
||||
"mise settings python.compile=1"
|
||||
);
|
||||
}
|
||||
|
||||
let url = format!(
|
||||
"https://github.com/indygreg/python-build-standalone/releases/download/{tag}/{filename}"
|
||||
"https://github.com/astral-sh/python-build-standalone/releases/download/{tag}/{filename}"
|
||||
);
|
||||
let filename = url.split('/').last().unwrap();
|
||||
let install = tv.install_path();
|
||||
|
|
Loading…
Reference in New Issue