зеркало из https://github.com/microsoft/torchgeo.git
Fix failing Windows tests (#2225)
* Debug failing Windows tests * Use bash shell for fast-fail * Add azcopy.exe symlink to azcopy for Windows testing * Try .py suffix * Check default value of PATHEXT * Remove .exe * Prepend PATHEXT * Set PATHEXT in conftest.py * No symlinks * Use path returned by shutil.which * Change name to match shutil.which parameter * Fix bug * Try .bat file * Revert changes * Use output of which to run exe
This commit is contained in:
Родитель
497ac959d1
Коммит
57a28a9067
|
@ -6,6 +6,9 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- release**
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
jobs:
|
||||
integration:
|
||||
name: integration
|
||||
|
|
|
@ -8,6 +8,9 @@ on:
|
|||
branches:
|
||||
- main
|
||||
- release**
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
jobs:
|
||||
mypy:
|
||||
name: mypy
|
||||
|
|
|
@ -8,6 +8,9 @@ on:
|
|||
branches:
|
||||
- main
|
||||
- release**
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
jobs:
|
||||
latest:
|
||||
name: latest
|
||||
|
|
|
@ -10,6 +10,9 @@ on:
|
|||
- main
|
||||
paths:
|
||||
- docs/tutorials/**
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
jobs:
|
||||
notebooks:
|
||||
name: notebooks
|
||||
|
|
|
@ -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)
|
|
@ -0,0 +1 @@
|
|||
azcopy.py
|
|
@ -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 %*
|
|
@ -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)
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче