Skip to content

Commit 478a32d

Browse files
committed
check
1 parent 8b43877 commit 478a32d

2 files changed

Lines changed: 29 additions & 20 deletions

File tree

Makefile

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,15 @@ SAM_CLI_TELEMETRY ?= 0
88
init:
99
@if [ "$$GITHUB_ACTIONS" = "true" ]; then \
1010
command -v uv >/dev/null 2>&1 || pip install uv==0.9.1; \
11-
SAM_CLI_DEV=1 uv pip install --system --break-system-packages --python "$$(uv python find)" -e '.[dev]'; \
11+
echo "=== UV_PYTHON resolved to: $$(uv python find $$UV_PYTHON) ==="; \
12+
SAM_CLI_DEV=1 uv pip install --system --break-system-packages --python "$$(uv python find $$UV_PYTHON)" -e '.[dev]'; \
1213
else \
1314
SAM_CLI_DEV=1 pip install -e '.[dev]'; \
1415
fi
1516

1617
# Set up a pytest venv with test dependencies (cross-platform)
1718
setup-pytest:
18-
@if [ "$${RUNNER_OS:-}" = "Windows" ]; then \
19-
python3.11 -m venv $(HOME)/pytest; \
20-
VENV_PY="$(HOME)/pytest/Scripts/python.exe"; \
21-
SAM_CLI_DEV=1 uv pip install --python "$$VENV_PY" -e '.[dev]'; \
22-
"$(HOME)/pytest/Scripts/pytest" --version; \
23-
if [ -n "$$GITHUB_ENV" ]; then \
24-
echo "SCRIPT_PY=$$VENV_PY" >> "$$GITHUB_ENV"; \
25-
echo "$(HOME)/pytest/Scripts" >> "$$GITHUB_PATH"; \
26-
fi; \
27-
else \
28-
python3.11 -m venv $(HOME)/pytest; \
29-
VENV_PY="$(HOME)/pytest/bin/python3"; \
30-
SAM_CLI_DEV=1 uv pip install --python "$$VENV_PY" -e '.[dev]'; \
31-
sudo ln -sf $(HOME)/pytest/bin/pytest /usr/local/bin/pytest 2>/dev/null || true; \
32-
$(HOME)/pytest/bin/pytest --version; \
33-
if [ -n "$$GITHUB_ENV" ]; then \
34-
echo "SCRIPT_PY=$$VENV_PY" >> "$$GITHUB_ENV"; \
35-
fi; \
36-
fi
19+
bash tests/setup-pytest.sh
3720
# Install SAM CLI nightly binary
3821
init-nightly:
3922
bash tests/install-sam-cli-binary.sh sam-cli-nightly

tests/setup-pytest.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
# Set up a pytest venv with test dependencies (cross-platform).
3+
# Also exports SCRIPT_PY to GITHUB_ENV and adds Scripts dir to GITHUB_PATH on Windows.
4+
set -euo pipefail
5+
6+
echo "=== UV_PYTHON resolved to: $(uv python find $UV_PYTHON) ==="
7+
8+
if [ "${RUNNER_OS:-}" = "Windows" ]; then
9+
python3 -m venv "$HOME/pytest"
10+
VENV_PY="$HOME/pytest/Scripts/python.exe"
11+
SAM_CLI_DEV=1 uv pip install --python "$VENV_PY" -e '.[dev]'
12+
"$HOME/pytest/Scripts/pytest" --version
13+
if [ -n "${GITHUB_ENV:-}" ]; then
14+
echo "SCRIPT_PY=$VENV_PY" >> "$GITHUB_ENV"
15+
echo "$HOME/pytest/Scripts" >> "$GITHUB_PATH"
16+
fi
17+
else
18+
python3.11 -m venv "$HOME/pytest"
19+
VENV_PY="$HOME/pytest/bin/python3"
20+
SAM_CLI_DEV=1 uv pip install --python "$VENV_PY" -e '.[dev]'
21+
sudo ln -sf "$HOME/pytest/bin/pytest" /usr/local/bin/pytest 2>/dev/null || true
22+
"$HOME/pytest/bin/pytest" --version
23+
if [ -n "${GITHUB_ENV:-}" ]; then
24+
echo "SCRIPT_PY=$VENV_PY" >> "$GITHUB_ENV"
25+
fi
26+
fi

0 commit comments

Comments
 (0)