Skip to content

Commit 5b310b4

Browse files
authored
Add poetry and pypi tests (#1419)
* smoke test poetry Add a little more tests test Test poetry test Test poetry on python 3.10 Add more poetry tests Test en us test test Try verboose testing testing try quiet install Code refactooring test move linux pipy validation to workflow test test Fix path try test pipy More torch installations test testing test test test new fix install 2 try poetry nightly test nightly test test Test poetry validation test test_new test * Put back executing this on pull
1 parent fd80689 commit 5b310b4

File tree

4 files changed

+46
-12
lines changed

4 files changed

+46
-12
lines changed

.github/scripts/validate_binaries.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@ if [[ ${MATRIX_PACKAGE_TYPE} == "libtorch" ]]; then
22
curl ${MATRIX_INSTALLATION} -o libtorch.zip
33
unzip libtorch.zip
44
else
5-
# Special case Pypi installation package, only applicable to linux nightly CUDA 11.7 builds, wheel package
6-
if [[ ${TARGET_OS} == 'linux' && ${MATRIX_GPU_ARCH_VERSION} == '11.7' && ${MATRIX_PACKAGE_TYPE} == 'manywheel' && ${MATRIX_CHANNEL} != 'nightly' ]]; then
7-
conda create -yp ${ENV_NAME}_pypi python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
8-
INSTALLATION_PYPI=${MATRIX_INSTALLATION/"cu117"/"cu117_pypi_cudnn"}
9-
INSTALLATION_PYPI=${INSTALLATION_PYPI/"torchvision torchaudio"/""}
10-
INSTALLATION_PYPI=${INSTALLATION_PYPI/"index-url"/"extra-index-url"}
11-
conda run -p ${ENV_NAME}_pypi ${INSTALLATION_PYPI}
12-
conda run -p ${ENV_NAME}_pypi python ./test/smoke_test/smoke_test.py --package torchonly
13-
conda deactivate
14-
conda env remove -p ${ENV_NAME}_pypi
15-
fi
16-
175
# Please note ffmpeg is required for torchaudio, see https://github.com/pytorch/pytorch/issues/96159
186
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
197
conda activate ${ENV_NAME}

.github/scripts/validate_pipy.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
conda create -yp ${ENV_NAME}_pypi python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
2+
3+
if [[ ${MATRIX_CHANNEL} != "release" ]]; then
4+
conda run -p ${ENV_NAME}_pypi pip3 install --pre torch --index-url "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}_pypi_cudnn"
5+
conda run -p ${ENV_NAME}_pypi pip3 install --pre torchvision torchaudio --index-url "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}"
6+
else
7+
conda run -p ${ENV_NAME}_pypi pip3 install torch torchvision torchaudio
8+
fi
9+
10+
conda run -p ${ENV_NAME}_pypi python ./test/smoke_test/smoke_test.py
11+
conda deactivate
12+
conda env remove -p ${ENV_NAME}_pypi

.github/scripts/validate_poetry.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
conda create -y -n ${ENV_NAME}_poetry python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
3+
conda activate ${ENV_NAME}_poetry
4+
curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry.git@master
5+
export PATH="/root/.local/bin:$PATH"
6+
7+
poetry --version
8+
poetry new test_poetry
9+
cd test_poetry
10+
11+
if [[ ${MATRIX_CHANNEL} != "release" ]]; then
12+
# Installing poetry from our custom repo. We need to configure it before use and disable authentication
13+
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
14+
poetry source add --priority=explicit domains "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}"
15+
poetry source add --priority=explicit pytorch "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}_pypi_cudnn"
16+
poetry --quiet add --source pytorch torch
17+
poetry --quiet add --source domains torchvision torchaudio
18+
else
19+
poetry --quiet add torch torchaudio torchvision
20+
fi
21+
22+
python ../test/smoke_test/smoke_test.py
23+
conda deactivate
24+
conda env remove -p ${ENV_NAME}_poetry
25+
cd ..

.github/workflows/validate-linux-binaries.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,13 @@ jobs:
5555
export ENV_NAME="conda-env-${{ github.run_id }}"
5656
export TARGET_OS="linux"
5757
eval "$(conda shell.bash hook)"
58+
59+
# Special case PyPi installation package. And Install of PyPi package via poetry
60+
if [[ ${MATRIX_PACKAGE_TYPE} == "manywheel" ]] && \
61+
{[${MATRIX_GPU_ARCH_VERSION} == "12.1" && ${MATRIX_CHANNEL} != "release"] || \
62+
[${MATRIX_GPU_ARCH_VERSION} == "11.7" && ${MATRIX_CHANNEL} == "release"]}; then
63+
source ./.github/scripts/validate_pipy.sh
64+
source ./.github/scripts/validate_poetry.sh
65+
fi
66+
5867
source ./.github/scripts/validate_binaries.sh

0 commit comments

Comments
 (0)