Skip to content

BLD: Install anaconda client in a separate step #48755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_BUILD_VERBOSITY: 3

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

# Used to push the built wheels
# TODO: once Python 3.11 is available on conda, de-dup with
# setup python above
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
# Really doesn't matter what version we upload with
# just the version we test with
python-version: '3.8'
channels: conda-forge
channel-priority: true
mamba-version: "*"

- name: Install anaconda client
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is env.IS_PUSH different from github.event_name == 'push'?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it actually only looks for tagged events.

run: conda install -q -y anaconda-client


- name: Upload wheels
if: success()
shell: bash
Expand Down Expand Up @@ -136,16 +154,24 @@ jobs:
# A shallow clone can work when the following issue is resolved:
# https://github.com/actions/checkout/issues/338
fetch-depth: 0
# Used to push the built wheels
- uses: actions/setup-python@v3

# Used to push the built sdist
- uses: conda-incubator/setup-miniconda@v2
with:
# Build sdist on lowest supported Python
auto-update-conda: true
# Really doesn't matter what version we upload with
# just the version we test with
python-version: '3.8'
channels: conda-forge
channel-priority: true
mamba-version: "*"

- name: Build sdist
run: |
pip install build
python -m build --sdist
- name: Test the sdist
shell: bash -el {0}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR, but I think it'd be nice to have this at the beginning for all steps. I think I tried once and had some problems, even if it's supposed to be supported. But maybe worth having a look at some point, as we're using conda environments most of the time.

run: |
# TODO: Don't run test suite, and instead build wheels from sdist
# by splitting the wheel builders into a two stage job
Expand All @@ -162,6 +188,11 @@ jobs:
name: sdist
path: ./dist/*

- name: Install anaconda client
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
run: |
conda install -q -y anaconda-client

- name: Upload sdist
if: success()
shell: bash
Expand Down
1 change: 0 additions & 1 deletion ci/upload_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ upload_wheels() {
if [ -z ${TOKEN} ]; then
echo no token set, not uploading
else
conda install -q -y anaconda-client
# sdists are located under dist folder when built through setup.py
if compgen -G "./dist/*.gz"; then
echo "Found sdist"
Expand Down