Skip to content

Commit

Permalink
chore: Update CI workflow to include Python 3.11 and Windows testing
Browse files Browse the repository at this point in the history
  • Loading branch information
fbriol committed Jun 28, 2024
1 parent 41028db commit 73a16fe
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 41 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI

on:
push:
branches: "*"
pull_request:
branches: main

jobs:
linux:
name: ${{ matrix.python-version }}-posix
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.11']
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Miniconda
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
condarc: |
channels:
- conda-forge
create-args: |
python=${{ matrix.python-version }}
environment-name: FES
environment-file: conda/environment.yml

- name: Compile and Testing Python Package
shell: bash -l {0}
run: |
python setup.py build
pytest -v -ra --processes
- name: Build C++ Library and Testing
shell: bash -l {0}
run: |
mkdir build
cd build
cmake .. -DFES_ENABLE_TEST=ON
make
ctest
win:
name: win
runs-on: windows-2019

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Miniconda
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
condarc: |
channels:
- conda-forge
create-args: |
python=3.11
environment-name: FES
environment-file: conda/environment.yml

- name: Building Testing Python Package
shell: bash -l {0}
run: |
python setup.py build
pytest -v -ra --processes
38 changes: 0 additions & 38 deletions .github/workflows/cmake.yml

This file was deleted.

15 changes: 13 additions & 2 deletions conda/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,16 @@ channels:
- conda-forge
- defaults
dependencies:
- boa
- anaconda-client
- cmake
- eigen
- setuptools_scm
- netcdf4
- pytest
- boost-cpp
- git
- git-lfs
- gxx
- make # [not win]
- binutils # [not win]
- pyyaml
- gtest
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import re
import sys
import sysconfig
import warnings

import setuptools
import setuptools.command.build_ext
Expand Down Expand Up @@ -49,7 +50,13 @@ def version() -> str:
# otherwise setuptools_scm will not be able to find the version number.
os.chdir(WORKING_DIRECTORY)
import setuptools_scm
return setuptools_scm.get_version()
try:
return setuptools_scm.get_version()
except: # noqa: E722
warnings.warn(
'Unable to find the version number with setuptools_scm.',
RuntimeWarning)
return '0.0.0'
with path.open() as stream:
for line in stream:
if line.startswith('__version__'):
Expand Down

0 comments on commit 73a16fe

Please sign in to comment.