Skip to content

python ver

python ver #34

name: Build wheel and sdist for a non-pure Python package
on:
push:
jobs:
# build_sdist:
# defaults:
# run:
# shell: bash -l {0}
# name: Build pyobjcryst sdist
# runs-on: ubuntu-latest
# steps:
# - name: Check out pyobjcryst
# uses: actions/checkout@v4
# - name: Initialize miniconda
# uses: conda-incubator/setup-miniconda@v3
# with:
# activate-environment: sdist
# channels: conda-forge
# auto-update-conda: true
# auto-activate-base: false
# python-version: 3.13
# - name: Conda config
# run: >-
# conda config --set always_yes yes
# --set changeps1 no
# - name: Build sdist
# run: |
# pip install --upgrade build
# python -m build --sdist
# - uses: actions/upload-artifact@v4
# with:
# name: cibw-sdist
# path: ./dist/*.tar.gz
build-wheels:
# needs: [build_sdist]
defaults:
run:
shell: bash -l {0}
name: cibw-wheels-${{ matrix.python[0] }}-${{ matrix.buildplat[0] }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
fail-fast: false
matrix:
buildplat:
- [ubuntu-latest, manylinux_x86_64]
# - [macos-13, macosx_x86_64]
# - [macos-14, macosx_arm64]
# - [windows-latest, win_amd64]
python:
- ["3.11", "cp311"]
# - ["3.12", "cp312"]
# - ["3.13", "cp313"]
steps:
- name: Check out pyobjcryst
uses: actions/checkout@v4
# - name: Get sdist for CIBW
# uses: actions/download-artifact@v4
# with:
# name: cibw-sdist
# path: dist/
- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: build
channels: conda-forge
auto-update-conda: true
auto-activate-base: false
python-version: ${{ matrix.python[0] }}
- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no
- name: Install pyobjcryst and requirements
run: |
conda install --file requirements/conda.txt
conda install --file requirements/pip.txt
pip install --upgrade build
python -m pip wheel --no-deps --no-build-isolation --wheel-dir ./dist .
# - name: Build wheels from sdist
# uses: pypa/cibuildwheel@v2.21.1
# env:
# CIBW_BUILD_VERBOSITY: "2"
# CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_34_x86_64:latest
# CIBW_ENVIRONMENT: >
# CONDA_PREFIX=$HOME/miniconda/envs/build
# CPATH=$CONDA_PREFIX/include
# LIBRARY_PATH=/usr/lib:/usr/lib64:$CONDA_PREFIX/lib
# LD_LIBRARY_PATH=/usr/lib:/usr/lib64
# CIBW_REPAIR_WHEEL_COMMAND: "auditwheel -v repair -w {dest_dir} {wheel}"
# CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }}
# CIBW_BEFORE_BUILD: |
# curl -sSL https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
# -o miniconda.sh
# bash miniconda.sh -b -p "$HOME/miniconda"
# export PATH="$HOME/miniconda/bin:$PATH"
# . "$HOME/miniconda/etc/profile.d/conda.sh"
# conda config --set always_yes yes
# conda config --set changeps1 no
# conda config --set auto_update_conda true
# conda config --set auto_activate_base false
# conda create -n build -y --override-channels -c conda-forge \
# python=${{ matrix.python[0] }}
# conda activate build
# conda install -n build -y --override-channels -c conda-forge \
# --file requirements/conda.txt
# conda install -n build -y --override-channels -c conda-forge \
# --file requirements/build.txt
# echo "Using CONDA_PREFIX=$CONDA_PREFIX"
# # python -m pip wheel --no-build-isolation --wheel-dir ./dist .
# with:
# output-dir: dist
- name: Upload wheels to GitHub
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.python[0] }}-${{ matrix.buildplat[0] }}.whl
path: ./dist/*.whl
test-wheels:
needs: [build-wheels]
defaults:
run:
shell: bash -l {0}
name: test-wheels-${{ matrix.python }}-${{ matrix.buildplat }}
runs-on: ${{ matrix.buildplat }}
strategy:
fail-fast: false
matrix:
buildplat:
- ubuntu-latest
# - macos-13
# - macos-14
# - windows-latest
python:
- "3.11"
# - "3.12"
# - "3.13"
steps:
- name: Check out pyobjcryst
uses: actions/checkout@v4
- name: Download wheels
uses: actions/download-artifact@v4
with:
name: ${{ matrix.python }}-${{ matrix.buildplat }}.whl
path: ./dist
- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
channels: conda-forge
auto-update-conda: true
auto-activate-base: false
python-version: ${{ matrix.python }}
- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no
- name: Install pyobjcryst and requirements
run: |
conda install --file requirements/conda.txt
conda install --file requirements/tests.txt
- name: Install wheel and test
run: |
pip install ./dist/*.whl
pytest