@@ -14,23 +14,26 @@ case $(uname) in
14
14
Darwin)
15
15
OS_TYPE=macos
16
16
;;
17
+ MSYS* )
18
+ OS_TYPE=windows
19
+ ;;
17
20
* )
18
21
echo " Unknown OS type:" $( uname)
19
22
exit 1
20
23
;;
21
24
esac
22
25
23
- echo ' ::group::Uninstall system JPEG libraries on macOS'
24
- # The x86 macOS runners, e.g. the GitHub Actions native "macos-12" runner, has some JPEG libraries installed by default
25
- # that interfere with our build. We uninstall them here and use the one from conda below.
26
26
if [[ " ${OS_TYPE} " == " macos" && $( uname -m) == x86_64 ]]; then
27
+ echo ' ::group::Uninstall system JPEG libraries on macOS'
28
+ # The x86 macOS runners, e.g. the GitHub Actions native "macos-12" runner, has some JPEG libraries installed by
29
+ # default that interfere with our build. We uninstall them here and use the one from conda below.
27
30
JPEG_LIBS=$( brew list | grep jpeg)
28
31
echo $JPEG_LIBS
29
32
for lib in $JPEG_LIBS ; do
30
33
brew uninstall --ignore-dependencies --force $lib || true
31
34
done
35
+ echo ' ::endgroup::'
32
36
fi
33
- echo ' ::endgroup::'
34
37
35
38
echo ' ::group::Create build environment'
36
39
# See https://github.com/pytorch/vision/issues/7296 for ffmpeg
@@ -66,10 +69,24 @@ ltt install --progress-bar=off \
66
69
torch
67
70
68
71
if [[ $GPU_ARCH_TYPE == ' cuda' ]]; then
69
- python3 -c " import torch; exit(not torch.cuda.is_available())"
72
+ python -c " import torch; exit(not torch.cuda.is_available())"
70
73
fi
71
74
echo ' ::endgroup::'
72
75
76
+ if [[ " ${OS_TYPE} " == " windows" ]]; then
77
+ echo ' ::group::Install third party dependencies prior to TorchVision install on Windows'
78
+ # `easy_install`, i.e. `python setup.py` has problems downloading the dependencies due to SSL.
79
+ # Thus, we install them upfront with `pip` to avoid that.
80
+ # Instead of fixing the SSL error, we can probably maintain this special case until we switch away from the deprecated
81
+ # `easy_install` anyway.
82
+ python setup.py egg_info
83
+ # The requires.txt cannot be used with `pip install -r` directly. The requirements are listed at the top and the
84
+ # optional dependencies come in non-standard syntax after a blank line. Thus, we just extract the header.
85
+ sed -e ' /^$/,$d' * .egg-info/requires.txt > requirements.txt
86
+ pip install --progress-bar=off -r requirements.txt
87
+ echo ' ::endgroup::'
88
+ fi
89
+
73
90
echo ' ::group::Install TorchVision'
74
91
python setup.py develop
75
92
echo ' ::endgroup::'
0 commit comments