Skip to content

Commit d9a3018

Browse files
bottlerfmassa
authored andcommitted
typing only needed for python 3.5 and previous (#1778)
1 parent cc40410 commit d9a3018

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

packaging/conda/build_vision.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ for py_ver in "${DESIRED_PYTHON[@]}"; do
157157
rm -rf "$output_folder"
158158
mkdir "$output_folder"
159159

160+
if [[ "$py_ver" == 3.5 ]]; then
161+
export CONDA_TYPING_CONSTRAINT="- typing"
162+
else
163+
export CONDA_TYPING_CONSTRAINT=""
164+
fi
165+
160166
export VSTOOLCHAIN_PACKAGE=vs2017
161167

162168
# We need to build the compiler activation scripts first on Windows

packaging/pkg_helpers.bash

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,23 @@ setup_macos() {
115115
fi
116116
}
117117

118+
# set variable to determine whether the typing library needs to be built in
119+
setup_typing() {
120+
if [[ "$PYTHON_VERSION" == 3.5 ]]; then
121+
export CONDA_TYPING_CONSTRAINT="- typing"
122+
else
123+
export CONDA_TYPING_CONSTRAINT=""
124+
fi
125+
}
126+
118127
# Top-level entry point for things every package will need to do
119128
#
120129
# Usage: setup_env 0.2.0
121130
setup_env() {
122131
setup_cuda
123132
setup_build_version "$1"
124133
setup_macos
134+
setup_typing
125135
}
126136

127137
# Function to retry functions that sometimes timeout or have flaky failures

packaging/torchvision/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ test:
4747
- mock
4848
- av
4949
- ca-certificates
50-
- typing
50+
{{ environ.get('CONDA_TYPING_CONSTRAINT') }}
5151
commands:
5252
pytest .
5353

0 commit comments

Comments
 (0)