Skip to content

Commit 3e6551c

Browse files
authored
[Conda] Use selectors rather than shell scripts (#966)
* [Conda] Use selectors rather than shell scripts According to [conda-build doc](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#preprocessing-selectors) selectors are valid Python statement Use it to specify version specific constraints rather than use environment variables Move openssl and numpy constraints to selectors as well For Python-3.10, min numpy version is 1.21.2 and on Windows numpy depends on mkl=2021.4 Also openssl constraint should only be applied to Linux builds, as Mac and Windows ones are built without encryption Delete Python-3.10 specific installation instructions from `smoke_test.bat`
1 parent a2f7d2a commit 3e6551c

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

conda/build_pytorch.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,6 @@ for py_ver in "${DESIRED_PYTHON[@]}"; do
344344
rm -rf "$output_folder"
345345
mkdir "$output_folder"
346346

347-
export OPENSSL_PACKAGE=""
348-
export NUMPY_PACKAGE=" - numpy=1.19"
349-
if [[ ${py_ver} = "3.10" ]]; then
350-
export NUMPY_PACKAGE=" - numpy>=1.21.2"
351-
export OPENSSL_PACKAGE=" - openssl=1.1.1l"
352-
fi
353-
354347
# We need to build the compiler activation scripts first on Windows
355348
if [[ "$OSTYPE" == "msys" ]]; then
356349
vs_package="vs$VC_YEAR"

conda/pytorch-nightly/meta.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ requirements:
1616
- python
1717
- setuptools
1818
- pyyaml
19-
- mkl=2020.2 # [x86_64]
2019
- mkl-include # [x86_64]
20+
- mkl=2020.2 # [x86_64 and (not win or py <= 39)]
21+
- mkl=2021.4 # [x86_64 and win and py >= 310]
2122
- typing_extensions
2223
- dataclasses # [py36]
2324
- ninja
2425
- libuv # [win]
2526
- libuv # [unix]
2627
- pkg-config # [unix]
28+
- numpy=1.19 # [py <= 39]
29+
- numpy>=1.21.2 # [py >= 310]
30+
- openssl=1.1.1l # [py >= 310 and linux]
2731
{{ environ.get('PYTORCH_LLVM_PACKAGE', ' - llvmdev=9') }}
2832
{{ environ.get('MAGMA_PACKAGE', '') }}
29-
# Conda has some pretty unpredictable behavior when it comes to channel priority
30-
# so to be safe on which numpy version we want we default to 1.19
31-
{{ environ.get('NUMPY_PACKAGE', ' - numpy=1.19') }}
32-
{{ environ.get('OPENSSL_PACKAGE', '') }}
3333

3434
run:
3535
- python

windows/internal/smoke_test.bat

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ set CUDA_VER_MINOR=%CUDA_VERSION:~-1,1%
100100
set CUDA_VERSION_STR=%CUDA_VER_MAJOR%.%CUDA_VER_MINOR%
101101

102102
call conda update -n base -y -c defaults conda
103-
if "%PACKAGE_TYPE%" == "conda" (if "%DESIRED_PYTHON%" == "3.10" (
104-
call conda install -c=conda-forge -y cudatoolkit=%CUDA_VERSION_STR%
105-
if errorlevel 1 exit /b 1
106-
))
107103

108104
call conda install %CONDA_EXTRA_ARGS% -yq protobuf numpy
109105
if ERRORLEVEL 1 exit /b 1

0 commit comments

Comments
 (0)