Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- bitwarden-cli
- bitwarden-secrets-manager
- mise
- mise-python
- vault
baseImage:
- debian:latest
Expand Down Expand Up @@ -62,6 +63,7 @@ jobs:
- bitwarden-secrets-manager
- kamal
- mise
- mise-python
- vault
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ elif [[ $1 == +([0-9]) ]]; then
fi

FEATURE="$1"
BASE_IMAGE="${BASE_IMAGE:-$(echo $BASE_IMAGES | jq --raw-output ".$FEATURE // empty")}"
BASE_IMAGE="${BASE_IMAGE:-$(echo $BASE_IMAGES | jq --raw-output ".\"$FEATURE\" // empty")}"
BASE_IMAGE="${BASE_IMAGE:-$BASE_IMAGE_DEFAULT}"

cd $BASE_PATH
Expand Down
2 changes: 1 addition & 1 deletion bin/test_autogenerated
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ elif [[ $1 == +([0-9]) ]]; then
fi

FEATURE="$1"
BASE_IMAGE="${BASE_IMAGE:-$(echo $BASE_IMAGES | jq --raw-output ".$FEATURE // empty")}"
BASE_IMAGE="${BASE_IMAGE:-$(echo $BASE_IMAGES | jq --raw-output ".\"$FEATURE\" // empty")}"
BASE_IMAGE="${BASE_IMAGE:-$BASE_IMAGE_DEFAULT}"

cd $BASE_PATH
Expand Down
25 changes: 25 additions & 0 deletions src/mise-python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# mise-en-place version manager (mise)

Installs mise-en-place version manager.

## Example Usage

```json
"features": {
"ghcr.io/RouL/devcontainer-features/mise:1": {}
}
```

## Options

| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| no_ruby_dependencies | If set to true, the dependencies for building ruby won't be installed. | boolean | false |
| no_python_dependencies | If set to true, the dependencies for building python won't be installed. | boolean | false |



---

_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/RouL/devcontainer-features/blob/main/src/mise/devcontainer-feature.json). Add additional notes to a `NOTES.md`._
21 changes: 21 additions & 0 deletions src/mise-python/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"id": "mise",
"version": "1.0.0",
"name": "mise-en-place version manager",
"description": "Installs mise-en-place version manager.",
"dependsOn": {
"ghcr.io/RouL/devcontainer-features/mise:latest": {}
},
"options": {
"version": {
"description": "Version to be installed as default.",
"type": "string",
"default": "latest"
},
"extra_versions": {
"description": "Additional versions to be installed. (space separated)",
"type": "string",
"default": ""
}
}
}
45 changes: 45 additions & 0 deletions src/mise-python/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/bash
set -e

USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
VERSION="${VERSION:-latest}"

REQUIRED_PACKAGES="build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl git libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev"

apt_get_update()
{
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update -y
fi
}

check_packages() {
if ! dpkg -s "$@" > /dev/null 2>&1; then
apt_get_update
apt-get -y install --no-install-recommends "$@"
fi
}

export DEBIAN_FRONTEND=noninteractive

check_packages $REQUIRED_PACKAGES

install() {
su ${USERNAME} -c "mise use --global python@${VERSION}"
}

echo "(*) Installing Python (${VERSION}) via mise as default..."

install

for extraVersion in $EXTRA_VERSIONS
do
echo "(*) Installung Python (${extraVersion}) via mise"
su ${USERNAME} -c "mise install python@${VERSION}"
done

# Clean up
rm -rf /var/lib/apt/lists/*

echo "Done!"
8 changes: 8 additions & 0 deletions test/mise-python/python3.12.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e

source dev-container-features-test-lib

check "check default python == 3.12" bash -c "python --version | grep -E '^Python 3\\.12\\.'"

reportResults
10 changes: 10 additions & 0 deletions test/mise-python/python3.13_python3.12_python3.11.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

source dev-container-features-test-lib

check "check default python == 3.13" bash -c "python --version | grep -E '^Python 3\\.13\\.'"
check "check [email protected]" bash -c "mise exec [email protected] -- python --version | grep -E '^Python 3\\.12\\.'"
check "check [email protected]" bash -c "mise exec [email protected] -- python --version | grep -E '^Python 3\\.11\\.'"

reportResults
19 changes: 19 additions & 0 deletions test/mise-python/scenarios.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"python3.12": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"mise-python": {
"version": "3.12"
}
}
},
"python3.13_python3.12_python3.11": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"mise-python": {
"version": "3.13",
"extra_versions": "3.12 3.11"
}
}
}
}
14 changes: 14 additions & 0 deletions test/mise-python/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e

sudo apt-get update -y > /dev/null
sudo apt-get install -y curl jq ca-certificates > /dev/null

CURRENT_VERSION="$(curl -L --no-progress-meter https://api.github.com/repos/jdx/mise/releases/latest | jq --raw-output '.tag_name')"
CURRENT_VERSION="${CURRENT_VERSION#v}"

source dev-container-features-test-lib

check "check default python" bash -c "python --version | grep -E '^Python '"

reportResults
Loading