diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 67ebd4253..84d512338 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,6 +6,9 @@ on: pull_request: branches: - release** +defaults: + run: + shell: bash jobs: integration: name: integration diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml index 860c820e3..0688606d3 100644 --- a/.github/workflows/style.yaml +++ b/.github/workflows/style.yaml @@ -8,6 +8,9 @@ on: branches: - main - release** +defaults: + run: + shell: bash jobs: mypy: name: mypy diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ee7c4af31..4e863f1d4 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -8,6 +8,9 @@ on: branches: - main - release** +defaults: + run: + shell: bash jobs: latest: name: latest diff --git a/.github/workflows/tutorials.yaml b/.github/workflows/tutorials.yaml index dd5b83b91..cebc4f373 100644 --- a/.github/workflows/tutorials.yaml +++ b/.github/workflows/tutorials.yaml @@ -10,6 +10,9 @@ on: - main paths: - docs/tutorials/** +defaults: + run: + shell: bash jobs: notebooks: name: notebooks diff --git a/tests/datasets/azcopy b/tests/datasets/azcopy deleted file mode 100755 index 1f74b4c4d..000000000 --- a/tests/datasets/azcopy +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -"""Basic mock-up of the azcopy CLI.""" - -import argparse -import shutil - -if __name__ == '__main__': - parser = argparse.ArgumentParser() - subparsers = parser.add_subparsers() - copy = subparsers.add_parser('copy') - copy.add_argument('source') - copy.add_argument('destination') - copy.add_argument('--recursive', default='false') - sync = subparsers.add_parser('sync') - sync.add_argument('source') - sync.add_argument('destination') - sync.add_argument('--recursive', default='true') - args, _ = parser.parse_known_args() - - if args.recursive == 'true': - shutil.copytree(args.source, args.destination, dirs_exist_ok=True) - else: - shutil.copy(args.source, args.destination) diff --git a/tests/datasets/azcopy b/tests/datasets/azcopy new file mode 120000 index 000000000..2081c7768 --- /dev/null +++ b/tests/datasets/azcopy @@ -0,0 +1 @@ +azcopy.py \ No newline at end of file diff --git a/tests/datasets/azcopy.bat b/tests/datasets/azcopy.bat new file mode 100644 index 000000000..11ea5c45b --- /dev/null +++ b/tests/datasets/azcopy.bat @@ -0,0 +1,6 @@ +REM Copyright (c) Microsoft Corporation. All rights reserved. +REM Licensed under the MIT License. + +@ECHO OFF + +python3 tests\datasets\azcopy.py %* diff --git a/tests/datasets/azcopy.py b/tests/datasets/azcopy.py new file mode 100755 index 000000000..1f74b4c4d --- /dev/null +++ b/tests/datasets/azcopy.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +"""Basic mock-up of the azcopy CLI.""" + +import argparse +import shutil + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + subparsers = parser.add_subparsers() + copy = subparsers.add_parser('copy') + copy.add_argument('source') + copy.add_argument('destination') + copy.add_argument('--recursive', default='false') + sync = subparsers.add_parser('sync') + sync.add_argument('source') + sync.add_argument('destination') + sync.add_argument('--recursive', default='true') + args, _ = parser.parse_known_args() + + if args.recursive == 'true': + shutil.copytree(args.source, args.destination, dirs_exist_ok=True) + else: + shutil.copy(args.source, args.destination) diff --git a/torchgeo/datasets/utils.py b/torchgeo/datasets/utils.py index 2f7291698..820ffe6ae 100644 --- a/torchgeo/datasets/utils.py +++ b/torchgeo/datasets/utils.py @@ -849,8 +849,8 @@ def which(name: Path) -> Executable: .. versionadded:: 0.6 """ - if shutil.which(name): - return Executable(name) + if cmd := shutil.which(name): + return Executable(cmd) else: msg = f'{name} is not installed and is required to use this dataset.' raise DependencyNotFoundError(msg) from None