diff --git a/.github/workflows/build-macos-arm64.yaml b/.github/workflows/build-macos-arm64.yaml index dab3b92c98..d44039b0a3 100644 --- a/.github/workflows/build-macos-arm64.yaml +++ b/.github/workflows/build-macos-arm64.yaml @@ -105,8 +105,10 @@ jobs: run: | perl -pli -e 's/magicmime: false/magicmime: true/' stack.yaml # lts-24 caps `magic` at 1.1 while some transitive dep pulls 1.1.2; - # pin the exact-1.1 hackage revision that stack itself recommends. - echo '- magic-1.1@sha256:3a31ca1c49fa5f6a857f647471739bd240a6020af6ae43e71fb72201fc482fa2,928' >> stack.yaml + # pin the exact-1.1 hackage revision (idempotent: upstream may + # already ship a `- magic-*` entry, avoid the stack S-5470 dup). + grep -qE '^- magic(-|@|$)' stack.yaml \ + || echo '- magic-1.1@sha256:3a31ca1c49fa5f6a857f647471739bd240a6020af6ae43e71fb72201fc482fa2,928' >> stack.yaml - name: stack setup run: stack setup @@ -468,9 +470,11 @@ jobs: - name: Run datalad tests run: | - mkdir -p __testhome__ - cd __testhome__ - python -m pytest -c ../datalad/tox.ini -s -v --pyargs datalad + testhome="$PWD/__testhome__" + toxini="../datalad/tox.ini" + mkdir -p "$testhome" + cd "$testhome" + python -m pytest -c "$toxini" -s -v --pyargs datalad - name: Set final PR status if: always() && github.event.inputs.pr != '' diff --git a/.github/workflows/build-macos.yaml b/.github/workflows/build-macos.yaml index f0c9659ade..d97fac0eb0 100644 --- a/.github/workflows/build-macos.yaml +++ b/.github/workflows/build-macos.yaml @@ -105,8 +105,10 @@ jobs: run: | perl -pli -e 's/magicmime: false/magicmime: true/' stack.yaml # lts-24 caps `magic` at 1.1 while some transitive dep pulls 1.1.2; - # pin the exact-1.1 hackage revision that stack itself recommends. - echo '- magic-1.1@sha256:3a31ca1c49fa5f6a857f647471739bd240a6020af6ae43e71fb72201fc482fa2,928' >> stack.yaml + # pin the exact-1.1 hackage revision (idempotent: upstream may + # already ship a `- magic-*` entry, avoid the stack S-5470 dup). + grep -qE '^- magic(-|@|$)' stack.yaml \ + || echo '- magic-1.1@sha256:3a31ca1c49fa5f6a857f647471739bd240a6020af6ae43e71fb72201fc482fa2,928' >> stack.yaml - name: stack setup run: stack setup @@ -467,9 +469,11 @@ jobs: - name: Run datalad tests run: | - mkdir -p __testhome__ - cd __testhome__ - python -m pytest -c ../datalad/tox.ini -s -v --pyargs datalad + testhome="$PWD/__testhome__" + toxini="../datalad/tox.ini" + mkdir -p "$testhome" + cd "$testhome" + python -m pytest -c "$toxini" -s -v --pyargs datalad - name: Set final PR status if: always() && github.event.inputs.pr != '' diff --git a/.github/workflows/build-ubuntu.yaml b/.github/workflows/build-ubuntu.yaml index b8ee4daf27..98b8c76824 100644 --- a/.github/workflows/build-ubuntu.yaml +++ b/.github/workflows/build-ubuntu.yaml @@ -510,9 +510,11 @@ jobs: - name: Run datalad tests run: | - mkdir -p __testhome__ - cd __testhome__ - python -m pytest -c ../datalad/tox.ini -s -v --pyargs datalad + testhome="$PWD/__testhome__" + toxini="../datalad/tox.ini" + mkdir -p "$testhome" + cd "$testhome" + python -m pytest -c "$toxini" -s -v --pyargs datalad - name: Set final PR status if: always() && github.event.inputs.pr != '' diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index e7e259a44f..2053e7934f 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -101,8 +101,10 @@ jobs: run: | perl -pli -e 's/magicmime: false/magicmime: true/' stack.yaml # lts-24 caps `magic` at 1.1 while some transitive dep pulls 1.1.2; - # pin the exact-1.1 hackage revision that stack itself recommends. - echo '- magic-1.1@sha256:3a31ca1c49fa5f6a857f647471739bd240a6020af6ae43e71fb72201fc482fa2,928' >> stack.yaml + # pin the exact-1.1 hackage revision (idempotent: upstream may + # already ship a `- magic-*` entry, avoid the stack S-5470 dup). + grep -qE '^- magic(-|@|$)' stack.yaml \ + || echo '- magic-1.1@sha256:3a31ca1c49fa5f6a857f647471739bd240a6020af6ae43e71fb72201fc482fa2,928' >> stack.yaml - name: Set UPGRADE_LOCATION run: | @@ -442,9 +444,17 @@ jobs: - name: Run datalad tests run: | - mkdir -p __testhome__ - cd __testhome__ - python -m pytest -c ../datalad/tox.ini -s -v --pyargs datalad + # windows-2025: HOME and default tempfile live on C: while the + # actions workspace is on D:. Any datalad code that computes + # `os.path.relpath(some_C_path, some_D_path)` raises + # `ValueError: path is on mount 'D:', start on mount 'C:'`. + # Run pytest from a C: directory so tempdir + HOME + CWD all + # share one drive. See commit message for context. + testhome="$HOME/dl-testhome" + toxini="$GITHUB_WORKSPACE/datalad/tox.ini" + mkdir -p "$testhome" + cd "$testhome" + python -m pytest -c "$toxini" -s -v --pyargs datalad - name: Set final PR status if: always() && github.event.inputs.pr != '' diff --git a/.github/workflows/template/build-{{ostype}}.yaml.j2 b/.github/workflows/template/build-{{ostype}}.yaml.j2 index 8c885f7c62..d2d7e15d5a 100644 --- a/.github/workflows/template/build-{{ostype}}.yaml.j2 +++ b/.github/workflows/template/build-{{ostype}}.yaml.j2 @@ -197,8 +197,10 @@ jobs: run: | perl -pli -e 's/magicmime: false/magicmime: true/' stack.yaml # lts-24 caps `magic` at 1.1 while some transitive dep pulls 1.1.2; - # pin the exact-1.1 hackage revision that stack itself recommends. - echo '- magic-1.1@sha256:3a31ca1c49fa5f6a857f647471739bd240a6020af6ae43e71fb72201fc482fa2,928' >> stack.yaml + # pin the exact-1.1 hackage revision (idempotent: upstream may + # already ship a `- magic-*` entry, avoid the stack S-5470 dup). + grep -qE '^- magic(-|@|$)' stack.yaml \ + || echo '- magic-1.1@sha256:3a31ca1c49fa5f6a857f647471739bd240a6020af6ae43e71fb72201fc482fa2,928' >> stack.yaml - name: stack setup run: stack setup @@ -238,8 +240,10 @@ jobs: run: | perl -pli -e 's/magicmime: false/magicmime: true/' stack.yaml # lts-24 caps `magic` at 1.1 while some transitive dep pulls 1.1.2; - # pin the exact-1.1 hackage revision that stack itself recommends. - echo '- magic-1.1@sha256:3a31ca1c49fa5f6a857f647471739bd240a6020af6ae43e71fb72201fc482fa2,928' >> stack.yaml + # pin the exact-1.1 hackage revision (idempotent: upstream may + # already ship a `- magic-*` entry, avoid the stack S-5470 dup). + grep -qE '^- magic(-|@|$)' stack.yaml \ + || echo '- magic-1.1@sha256:3a31ca1c49fa5f6a857f647471739bd240a6020af6ae43e71fb72201fc482fa2,928' >> stack.yaml - name: Set UPGRADE_LOCATION run: | @@ -778,9 +782,22 @@ jobs: {% endif %} - name: Run datalad tests run: | - mkdir -p __testhome__ - cd __testhome__ - python -m pytest -c ../datalad/tox.ini -s -v --pyargs datalad + {% if ostype == "windows" %} + # windows-2025: HOME and default tempfile live on C: while the + # actions workspace is on D:. Any datalad code that computes + # `os.path.relpath(some_C_path, some_D_path)` raises + # `ValueError: path is on mount 'D:', start on mount 'C:'`. + # Run pytest from a C: directory so tempdir + HOME + CWD all + # share one drive. See commit message for context. + testhome="$HOME/dl-testhome" + toxini="$GITHUB_WORKSPACE/datalad/tox.ini" + {% else %} + testhome="$PWD/__testhome__" + toxini="../datalad/tox.ini" + {% endif %} + mkdir -p "$testhome" + cd "$testhome" + python -m pytest -c "$toxini" -s -v --pyargs datalad - name: Set final PR status if: always() && github.event.inputs.pr != ''