Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | name: 'Setup Python and uv from mise.lock' |
| 2 | description: 'Sets up the mise-locked Python toolchain with enterprise-allowlisted actions' |
| 3 | |
| 4 | inputs: |
| 5 | python-version: |
| 6 | description: 'Python version to use. Defaults to mise.lock' |
| 7 | required: false |
| 8 | default: '' |
| 9 | uv-version: |
| 10 | description: 'uv version to install. Defaults to mise.lock' |
| 11 | required: false |
| 12 | default: '' |
| 13 | enable-caching: |
| 14 | description: 'Enable uv/tool cache' |
| 15 | required: false |
| 16 | default: 'true' |
| 17 | cache-dependency-glob: |
| 18 | description: 'Workspace-relative files used to invalidate the uv cache' |
| 19 | required: false |
| 20 | # Extend setup-uv defaults with legacy package metadata and our toolchain lock. |
| 21 | default: | |
| 22 | **/*requirements*.txt |
| 23 | **/*requirements*.in |
| 24 | **/*constraints*.txt |
| 25 | **/*constraints*.in |
| 26 | **/pyproject.toml |
| 27 | **/setup.py |
| 28 | **/uv.lock |
| 29 | **/*.py.lock |
| 30 | mise.lock |
| 31 | |
| 32 | outputs: |
| 33 | python-version: |
| 34 | description: 'The installed Python version (e.g., 3.12.0)' |
| 35 | value: ${{ steps.versions.outputs.python }} |
| 36 | |
| 37 | runs: |
| 38 | using: 'composite' |
| 39 | steps: |
| 40 | - name: Install mise CLI |
| 41 | shell: bash |
| 42 | run: bash "$GITHUB_ACTION_PATH/../../scripts/install-mise.sh" |
| 43 | |
| 44 | - name: Resolve mise-locked versions |
| 45 | id: tool-versions |
| 46 | shell: bash |
| 47 | env: |
| 48 | PYTHON_VERSION: ${{ inputs.python-version }} |
| 49 | UV_VERSION: ${{ inputs.uv-version }} |
| 50 | run: | |
| 51 | resolver="$GITHUB_ACTION_PATH/../../scripts/read-mise-lock-version.sh" |
| 52 | python_version="$PYTHON_VERSION" |
| 53 | uv_version="$UV_VERSION" |
| 54 | |
| 55 | if [[ -z "$python_version" ]]; then |
| 56 | python_version=$(bash "$resolver" python) |
| 57 | fi |
| 58 | if [[ -z "$uv_version" ]]; then |
| 59 | uv_version=$(bash "$resolver" uv) |
| 60 | fi |
| 61 | |
| 62 | echo "python=$python_version" >> "$GITHUB_OUTPUT" |
| 63 | echo "uv=$uv_version" >> "$GITHUB_OUTPUT" |
| 64 | |
| 65 | - name: Setup Python |
| 66 | id: python |
| 67 | uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
| 68 | with: |
| 69 | python-version: ${{ steps.tool-versions.outputs.python }} |
| 70 | |
| 71 | - name: Setup uv |
| 72 | uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
| 73 | with: |
| 74 | version: ${{ steps.tool-versions.outputs.uv }} |
| 75 | enable-cache: ${{ inputs.enable-caching }} |
| 76 | # Keep restores scoped to these dependency files and tool versions. |
| 77 | # A fallback to older dependencies can hide newly published releases. |
| 78 | cache-dependency-glob: ${{ inputs.cache-dependency-glob }} |
| 79 | cache-suffix: py-${{ steps.python.outputs.python-version }}-uv-${{ steps.tool-versions.outputs.uv }} |
| 80 | prune-cache: true |
| 81 | |
| 82 | - name: Report versions |
| 83 | id: versions |
| 84 | shell: bash |
| 85 | run: echo "python=$(python --version | awk '{print $2}')" >> "$GITHUB_OUTPUT" |