Skip to content

Commit 6b93a0c

Browse files
BLD: Install anaconda client in a separate step (#48755)
* BLD: Install anaconda client in a separate step * Apply suggestions from code review Co-authored-by: Marc Garcia <[email protected]> * Update wheels.yml * Update wheels.yml Co-authored-by: Marc Garcia <[email protected]>
1 parent 5763023 commit 6b93a0c

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

.github/workflows/wheels.yml

+35-4
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
CIBW_ARCHS_MACOS: x86_64 universal2
8383
CIBW_BUILD_VERBOSITY: 3
8484

85-
# Used to push the built wheels
85+
# Used to test the built wheels
8686
- uses: actions/setup-python@v3
8787
with:
8888
python-version: ${{ matrix.python[1] }}
@@ -98,6 +98,24 @@ jobs:
9898
name: ${{ matrix.python[0] }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
9999
path: ./wheelhouse/*.whl
100100

101+
# Used to push the built wheels
102+
# TODO: once Python 3.11 is available on conda, de-dup with
103+
# setup python above
104+
- uses: conda-incubator/setup-miniconda@v2
105+
with:
106+
auto-update-conda: true
107+
# Really doesn't matter what version we upload with
108+
# just the version we test with
109+
python-version: '3.8'
110+
channels: conda-forge
111+
channel-priority: true
112+
mamba-version: "*"
113+
114+
- name: Install anaconda client
115+
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
116+
run: conda install -q -y anaconda-client
117+
118+
101119
- name: Upload wheels
102120
if: success()
103121
shell: bash
@@ -136,16 +154,24 @@ jobs:
136154
# A shallow clone can work when the following issue is resolved:
137155
# https://github.com/actions/checkout/issues/338
138156
fetch-depth: 0
139-
# Used to push the built wheels
140-
- uses: actions/setup-python@v3
157+
158+
# Used to push the built sdist
159+
- uses: conda-incubator/setup-miniconda@v2
141160
with:
142-
# Build sdist on lowest supported Python
161+
auto-update-conda: true
162+
# Really doesn't matter what version we upload with
163+
# just the version we test with
143164
python-version: '3.8'
165+
channels: conda-forge
166+
channel-priority: true
167+
mamba-version: "*"
168+
144169
- name: Build sdist
145170
run: |
146171
pip install build
147172
python -m build --sdist
148173
- name: Test the sdist
174+
shell: bash -el {0}
149175
run: |
150176
# TODO: Don't run test suite, and instead build wheels from sdist
151177
# by splitting the wheel builders into a two stage job
@@ -162,6 +188,11 @@ jobs:
162188
name: sdist
163189
path: ./dist/*
164190

191+
- name: Install anaconda client
192+
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
193+
run: |
194+
conda install -q -y anaconda-client
195+
165196
- name: Upload sdist
166197
if: success()
167198
shell: bash

ci/upload_wheels.sh

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ upload_wheels() {
2424
if [ -z ${TOKEN} ]; then
2525
echo no token set, not uploading
2626
else
27-
conda install -q -y anaconda-client
2827
# sdists are located under dist folder when built through setup.py
2928
if compgen -G "./dist/*.gz"; then
3029
echo "Found sdist"

0 commit comments

Comments
 (0)