Skip to content

Commit 85fc50d

Browse files
JonZeollaclaude
andcommitted
fix: add Windows support to Taskfile VERSION and LOCAL_PLATFORM vars
The VERSION var used a namespace-package import (from src.X) that fails on Windows. Switch to explicit sys.path.insert so the import works cross-platform. Also use bash directly for LOCAL_PLATFORM instead of uv run, since shell scripts need bash on Windows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dba422f commit 85fc50d

2 files changed

Lines changed: 5 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -210,32 +210,19 @@ jobs:
210210
Write-Host "Windows smoke test passed: project generated and verified successfully"
211211
- name: Initialize generated project
212212
shell: bash
213-
# Task's top-level VERSION var uses a namespace-package import that
214-
# fails on Windows, so we run the init commands directly.
215213
run: |
216214
cd "$RUNNER_TEMP/replace-me"
217-
uv sync --frozen --all-extras
215+
task -v init
218216
- name: Run tests
219217
shell: bash
220218
run: |
221219
cd "$RUNNER_TEMP/replace-me"
222-
uv run --frozen pytest -m "unit" tests/
223-
uv run --frozen pytest -m "integration" tests/
220+
task -v test
224221
- name: Build Docker image
225222
shell: bash
226223
run: |
227224
cd "$RUNNER_TEMP/replace-me"
228-
docker buildx create --name multiplatform --driver docker-container --use 2>/dev/null || true
229-
docker buildx build \
230-
--platform linux/amd64 \
231-
--pull \
232-
--load \
233-
--build-arg NAME="replace_me" \
234-
--build-arg DESCRIPTION="A brief description of the project" \
235-
--build-arg TIMESTAMP="$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
236-
--build-arg COMMIT_HASH="$(git rev-parse HEAD)" \
237-
-t zenable-io/replace-me:latest \
238-
.
225+
task -v build
239226
- name: Verify Docker image
240227
shell: bash
241228
run: |

{{cookiecutter.project_name|replace(" ", "")}}/Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ vars:
1414
PYTHON_VERSION: {{ cookiecutter.python_version }}
1515
SUPPORTED_PLATFORMS: 'linux/amd64,linux/arm64'
1616
VERSION:
17-
sh: uv run python -c 'from src.{{ '{{.PROJECT_SLUG}}' }} import __version__; print(__version__)'
17+
sh: uv run python -c "import sys; sys.path.insert(0, 'src'); from {{ '{{.PROJECT_SLUG}}' }} import __version__; print(__version__)"
1818
RUN_SCRIPT: 'uv run --frozen'
1919
SCRIPTS_DIR: 'scripts'
2020
LOCAL_PLATFORM:
21-
sh: "{{ '{{.RUN_SCRIPT}}' }} {{ '{{.SCRIPTS_DIR}}' }}/get_platform.sh"
21+
sh: "bash {{ '{{.SCRIPTS_DIR}}' }}/get_platform.sh"
2222
# Use PLATFORM if specified, otherwise use LOCAL_PLATFORM
2323
PLATFORM: '{{ '{{if .PLATFORM}}' }}{{ '{{.PLATFORM}}' }}{{ '{{else}}' }}{{ '{{.LOCAL_PLATFORM}}' }}{{ '{{end}}' }}'
2424
# Output redirect based on CI environment

0 commit comments

Comments
 (0)