Skip to content
Draft
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
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

on:
push:
pull_request:
# Allow manual runs through the web UI
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
# python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.10"]

name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'

- name: Install mingw-w64 on Windows
if: ${{ runner.os == 'Windows' }}
uses: msys2/setup-msys2@v2
with:
msystem: ucrt64
update: true
install: |
mingw-w64-ucrt-x86_64-toolchain

- name: Install on MacOS
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew reinstall gcc
CC=/usr/local/bin/gcc-12 pip install ".[test]"

- name: Print gfortran info
run: |
gfortran --version

- name: Install on not MacOS
if: ${{ matrix.os != 'macos-latest' }}
run: |
pip install ".[test]"

- name: Run unit and integration tests
run: |
pytest tests/

publish:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]

name: Build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install mingw-w64 on Windows
if: ${{ runner.os == 'Windows' }}
uses: msys2/setup-msys2@v2
with:
msystem: ucrt64
update: true
install: |
mingw-w64-ucrt-x86_64-toolchain

- name: Build and test wheels
uses: pypa/cibuildwheel@v2.16.1
43 changes: 0 additions & 43 deletions .github/workflows/docs.yml

This file was deleted.

114 changes: 0 additions & 114 deletions .github/workflows/main.yml

This file was deleted.

6 changes: 6 additions & 0 deletions cibw_before_build_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -e
set -x

sudo ln -fs /usr/local/bin/gfortran-12 /usr/local/bin/gfortran
29 changes: 12 additions & 17 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,7 @@ is_mingw = is_windows and cc.get_id() == 'gcc'

cython_c_args = []
if is_windows
# For mingw-w64, link statically against the UCRT.
gcc_link_args = ['-lucrt', '-static']
if is_mingw
add_global_link_arguments(gcc_link_args, language: ['c'])

# Force gcc to float64 long doubles for compatibility with MSVC
# builds, for C only.
add_global_arguments('-mlong-double-64', language: 'c')
Expand All @@ -95,7 +91,7 @@ if is_windows

# Manual add of MS_WIN64 macro when not using MSVC.
# https://bugs.python.org/issue28267
bitness = run_command('apexpy/_gcc_build_bitness.py').stdout().strip()
bitness = run_command('src/apexpy/_gcc_build_bitness.py').stdout().strip()
if bitness == '64'
add_global_arguments('-DMS_WIN64', language: ['c', 'fortran'])
endif
Expand All @@ -108,15 +104,13 @@ if is_windows
# Windows may need the directory for Python.h added. This location
# does not have the same name for all installs. This is the one
# for Windows on GitHub actions
incdir_py = run_command(py3,
['-c', 'import os; os.chdir(".."); import sys; print(os.path.join(sys.prefix, "include"))'],
check : true).stdout().strip()
inc_dirs = include_directories(incdir_numpy, incdir_f2py, incdir_py)
# incdir_py = run_command(py3,
# ['-c', 'import os; os.chdir(".."); import sys; print(os.path.join(sys.prefix, "include"))'],
# check : true).stdout().strip()
# inc_dirs = include_directories(incdir_numpy, incdir_f2py, incdir_py)
endif

if meson.get_compiler('fortran').get_id() == 'gcc'
add_global_link_arguments(gcc_link_args, language: ['fortran'])

# Flag needed to work around BLAS and LAPACK Gfortran dependence on
# undocumented C feature when passing single character string
# arguments.
Expand Down Expand Up @@ -173,11 +167,12 @@ py3.extension_module('fortranapex',

# Declare the sources
py3.install_sources([
'apexpy/__init__.py',
'apexpy/__main__.py',
'apexpy/apex.py',
'apexpy/apexsh.dat',
'apexpy/helpers.py',
'apexpy/igrf13coeffs.txt'],
'src/apexpy/__init__.py',
'src/apexpy/__main__.py',
'src/apexpy/apex.py',
'src/apexpy/apexsh.dat',
'src/apexpy/helpers.py',
'src/apexpy/igrf13coeffs.txt',
],
pure: false,
subdir: 'apexpy')
Loading