@@ -84,75 +84,34 @@ runs:
84
84
# and "/" is not allowed in artifact names. //\//_ is to replace all forward slashes,
85
85
# not just the first one
86
86
echo "ARTIFACT_NAME=${REPOSITORY//\//_}_${REF//\//_}_${PYTHON_VERSION}_${CU_VERSION}_${ARCH}" >> "${GITHUB_ENV}"
87
- - name : Setup miniconda (for pytorch_pkg_helpers)
88
- if : ${{ inputs.setup-miniconda == 'true' }}
89
- uses :
conda-incubator/[email protected]
90
- with :
91
- miniconda-version : " latest"
92
- python-version : 3.9
93
- - name : Clean conda environment
94
- shell : bash -l {0}
95
- run : |
96
- set -euxo pipefail
97
- conda info | grep -i 'base environment'
98
- conda clean --all --quiet --yes
99
- - name : Reset channel priority
87
+
88
+ - name : Install uv environment
100
89
shell : bash -l {0}
101
90
run : |
102
91
set -euxo pipefail
103
- conda config --set channel_priority false
92
+ curl -LsSf https://astral.sh/uv/install.sh | sh
93
+
104
94
- name : Generate file from pytorch_pkg_helpers
105
95
working-directory : ${{ inputs.repository }}
106
96
shell : bash -l {0}
107
97
run : |
108
98
set -euxo pipefail
109
- CONDA_ENV="${RUNNER_TEMP}/pytorch_pkg_helpers_${GITHUB_RUN_ID}"
110
- conda create \
111
- --yes --quiet \
112
- --prefix "${CONDA_ENV}" \
113
- "python=3.9"
114
- CONDA_ENV="${CONDA_ENV}"
115
- CONDA_RUN="conda run -p ${CONDA_ENV}"
116
- ${CONDA_RUN} python -m pip install ${GITHUB_WORKSPACE}/test-infra/tools/pkg-helpers
99
+ uv venv --python 3.9
100
+ source .venv/bin/activate
101
+
102
+ python -m pip install ${GITHUB_WORKSPACE}/test-infra/tools/pkg-helpers
117
103
BUILD_ENV_FILE="${RUNNER_TEMP}/build_env_${GITHUB_RUN_ID}"
118
- ${CONDA_RUN} python -m pytorch_pkg_helpers > "${BUILD_ENV_FILE}"
104
+ python -m pytorch_pkg_helpers > "${BUILD_ENV_FILE}"
119
105
cat "${BUILD_ENV_FILE}"
120
106
echo "BUILD_ENV_FILE=${BUILD_ENV_FILE}" >> "${GITHUB_ENV}"
121
- - name : Setup conda environment for build
107
+
108
+ - name : Setup uv environment for build
122
109
shell : bash -l {0}
123
110
env :
124
111
PYTHON_VERSION : ${{ inputs.python-version }}
125
112
run : |
126
113
set -euxo pipefail
127
- CONDA_ENV="${RUNNER_TEMP}/conda_environment_${GITHUB_RUN_ID}"
128
- export CONDA_EXTRA_PARAM=""
129
-
130
- if [[ "${PYTHON_VERSION:-}" == "3.13t" ]]; then
131
- export PYTHON_VERSION=3.13
132
- export CONDA_EXTRA_PARAM=" python-freethreading -c conda-forge"
133
-
134
- # downgrade conda version for python 3.13t install.
135
- # TODO: remove this once python 3.13t is fully supported on conda
136
- # Please see : https://github.com/conda/conda/issues/14554
137
- if [[ "$(uname)" == Darwin ]]; then
138
- # required to be able to downgrade on MacOS arm64
139
- conda install -y python=3.9
140
- if [[ -n "$(conda list | grep conda-anaconda-telemetry)" ]]; then
141
- conda uninstall -y conda-anaconda-telemetry conda-anaconda-tos
142
- fi
143
- fi
144
- conda install -y conda=24.7.1 conda-libmamba-solver=24.1.0
145
- fi
146
-
147
- conda create \
148
- --yes --quiet \
149
- --prefix "${CONDA_ENV}" \
150
- "python=${PYTHON_VERSION}" \
151
- cmake=3.31.2 \
152
- ninja=1.12.1 \
153
- pkg-config=0.29 \
154
- wheel=0.37 \
155
- ${CONDA_EXTRA_PARAM}
156
114
157
- echo "CONDA_ENV=${CONDA_ENV}" >> "${GITHUB_ENV}"
158
- echo "CONDA_RUN=conda run -p ${CONDA_ENV}" >> "${GITHUB_ENV}"
115
+ uv venv py${PYTHON_VERSION} --python ${PYTHON_VERSION}
116
+ source ./py${PYTHON_VERSION}/bin/activate
117
+ uv pip install cmake==3.31.2 ninja wheel==0.37
0 commit comments