Use meson build in place of numpy distutils #127
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- '*' | |
schedule: | |
- cron: "0 13 * * 1" | |
env: | |
CACHE_NUMBER: 3 # increase to reset cache manually | |
jobs: | |
build-and-test: | |
name: Testing (${{ matrix.python-version }}, ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: False | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
include: | |
- os: ubuntu-latest | |
label: linux-64 | |
prefix: /usr/share/miniconda3/envs/my-env | |
- os: macos-latest | |
label: osx-64 | |
prefix: /usr/share/miniconda3/envs/my-env | |
- os: windows-latest | |
label: win-64 | |
prefix: C:\Miniconda3\envs\my-env | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
mamba-version: '*' | |
channels: conda-forge, defaults | |
channel-priority: true | |
activate-environment: dev | |
- name: Get Date | |
id: get-date | |
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v2 | |
with: | |
path: ${{ matrix.prefix }} | |
key: ${{ matrix.label }}-${{ matrix.python-version }}-conda-${{ env.DATE }}-${{ env.CACHE_NUMBER }} | |
id: cache | |
- name: Conda information | |
run: | | |
conda info | |
conda list | |
conda config --show | |
- name: Create environment | |
run: | | |
mamba install --quiet --yes pip numpy scipy cython mkl=2023 pytest pytest-cov mkl-devel pkg-config meson-python meson ninja setuptools_scm | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: Install Our Package | |
run: | | |
python -m pip install --no-build-isolation --verbose --editable . --config-setting=compile-args=-v | |
conda list | |
- name: Run Tests | |
run: | | |
pytest --cov-config=.coveragerc --cov-report=xml --cov=pydiso -s -v | |
- name: Upload coverage | |
if: ${{ matrix.os == 'ubuntu-latest' }} and {{ matrix.python-version == '3.8' }} | |
uses: codecov/codecov-action@v2 | |
with: | |
verbose: true # optional (default = false) | |
distribute: | |
name: Distributing from 3.8 | |
needs: build-and-test | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
activate-environment: dev | |
python-version: 3.8 | |
- name: Install Env | |
run: | | |
conda info | |
conda list | |
conda config --show | |
conda install --quiet --yes pip numpy scipy cython mkl pytest pytest-cov mkl-devel pkg-config meson-python meson ninja setuptools_scm | |
- name: Install Our Package | |
run: | | |
echo $CONDA_PREFIX | |
pip install -v -e . | |
- name: Generate Source Distribution | |
run: | | |
python -m build --no-isolation --skip-dependency-check --sdist . | |
- name: pypi-publish | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip_existing: true |