Skip to content

Commit a1e2f20

Browse files
committed
Allow installation of mise from tox workflow
1 parent 22b8f1f commit a1e2f20

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

.github/workflows/test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
other_names: |
2222
docs
2323
lint
24+
py-mise:tox -e py:mise=true
2425
node-version-file: .tool-versions
2526

2627
check: # This job does nothing and is only used for the branch protection

.github/workflows/tox.yml

+24-8
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,34 @@ jobs:
144144
run: |
145145
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
146146
147+
- name: Install mise
148+
if: ${{ matrix.mise == 'true' }}
149+
run: |
150+
set -exuo pipefail
151+
type mise || {
152+
curl https://mise.run | sh
153+
echo "$HOME/.local/share/mise/bin" >> $GITHUB_PATH
154+
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH
155+
}
156+
mise install
157+
147158
- name: Install python build tools
148159
run: |
149160
set -exuo pipefail
150-
echo $PATH
151-
python3 -m pip install --upgrade pip uv
152-
# uv tool update-shell
153-
uv tool install "tox>=4.23.2" --with "tox-uv>=1.16.0"
161+
echo PATH=$PATH
162+
# that depends on python3 blend being used and might not be already in path:
163+
SCRIPTS_DIR=$(python3 -c 'import os,sysconfig;print(sysconfig.get_path("scripts",f"{os.name}_user"))')
164+
if [[ ":$PATH:" != *":$SCRIPTS_DIR:"* ]]; then
165+
export PATH=$SCRIPTS_DIR:$PATH
166+
echo "$SCRIPTS_DIR" >> $GITHUB_PATH
167+
echo "Added $SCRIPTS_DIR to PATH to avoid further issues."
168+
fi
169+
python3 -m pip install --upgrade --user --break-system-packages pip uv 'tox>=4.23.2' 'tox-uv>=1.16.0'
170+
which -a uv pip tox
171+
echo "uv tool update-shell"
154172
tox --version
155-
which -a uv
156-
157-
- name: Log installed dists
158-
run: python3 -m uv pip freeze
173+
echo "Log installed dists"
174+
python3 -m uv pip freeze
159175
160176
- run: ${{ matrix.command }}
161177

0 commit comments

Comments
 (0)