Skip to content
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
12 changes: 12 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
codecov:
notify:
after_n_builds: 3
coverage:
status:
project:
default:
target: auto
threshold: 5%
patch:
default:
informational: true
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
dependencies:
patterns:
- "*"
5 changes: 5 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
exclude:
authors:
- dependabot
- pre-commit-ci
42 changes: 30 additions & 12 deletions .github/workflows/python-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,52 @@ jobs:
- name: Upload SDist
uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: release-sdist
path: ./dist/*.tar.gz
retention-days: 30

build_wheels:
name: Build wheel (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
arch: x86_64
- os: windows-2019
arch: AMD64
msvc_arch: x64
- os: macos-13
arch: x86_64
cmake_osx_architectures: x86_64
macosx_deployment_target: 10.13
- os: macos-14
arch: arm64
cmake_osx_architectures: arm64
macosx_deployment_target: 14.0
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.21
uses: pypa/cibuildwheel@v2.22
env:
# skip PyPy and muslinux (for now)
CIBW_SKIP: "pp* *musllinux*"
# skip 32-bits platforms on linux and windows
CIBW_ARCHS_LINUX: "auto64"
CIBW_ARCHS_WINDOWS: "auto64"
# macos: opt-in cross-compile on arm64
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64"
CIBW_ARCHS: ${{ matrix.arch }}
# need also to redefine here some environment vars defined in pyprojet.toml
CIBW_ENVIRONMENT_MACOS:
MACOSX_DEPLOYMENT_TARGET=${{ matrix.macosx_deployment_target }}
CMAKE_OSX_ARCHITECTURES='${{ matrix.cmake_osx_architectures }}'
SKBUILD_CMAKE_ARGS='-DFS_DOWNLOAD_XTENSOR_PYTHON=ON'

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl
name: release-${{ matrix.os }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl
retention-days: 5

upload_all:
needs: [build_wheels, make_sdist]
Expand All @@ -62,7 +79,8 @@ jobs:
- name: Get dist files
uses: actions/download-artifact@v4
with:
name: artifact
pattern: release-*
merge-multiple: true
path: dist

- name: Publish on PyPI
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04", "ubuntu-latest", "macos-latest", "windows-latest"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Checkout repo
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- uses: prefix-dev/[email protected].1
- uses: prefix-dev/[email protected].10
with:
pixi-version: v0.40.1
cache: true
Expand Down
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ conda:

sphinx:
fail_on_warning: true
configuration: doc/source/conf.py

formats: []
2 changes: 1 addition & 1 deletion doc/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
- python=3.11
- breathe
- cmake
- xtensor-python
- xtensor-python>=0.27,<0.28
- pybind11
- scikit-build-core
- numpy
Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: fastscapelib-dev
channels:
- conda-forge
dependencies:
- xtensor
- xtensor>=0.25,<0.26
- cmake
- gtest
- benchmark
2 changes: 1 addition & 1 deletion environment-python-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
- python>=3.10
- numpy
- numba
- xtensor-python
- xtensor-python>=0.27,<0.28
- pybind11
- cmake
- scikit-build-core
Expand Down
7,123 changes: 4,252 additions & 2,871 deletions pixi.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ xtensor = ">=0.24,<0.26"
cmake = ">=3.31.4,<4"
ninja = ">=1.12.1,<2"
make = ">=4.4.1,<5"
cxx-compiler = ">=1.9.0,<1.10.0"

[feature.cpp.dependencies]
eigen = ">=3.4.0,<4"
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ test-command = "pytest {project}/python/fastscapelib/tests"
build-verbosity = 1

[[tool.cibuildwheel.overrides]]
# TODO: remove when numba supports python 3.13
# keep this override: will be useful for next versions of Python
# (Numba support always come with a delay)
# TODO: activate numba tests for py313
# (still some failing test with jitclass in macos arm64, issue seems in numba)
select = "cp3{10,11,12}-*"
inherit.test-requires = "append"
test-requires = ["numba"]

[tool.cibuildwheel.macos]
environment = {SKBUILD_CMAKE_ARGS='-DFS_DOWNLOAD_XTENSOR_PYTHON=ON', MACOSX_DEPLOYMENT_TARGET=10.13}

[tool.isort]
profile = "black"
skip_gitignore = true
Expand Down
3 changes: 3 additions & 0 deletions python/fastscapelib/flow/numba/flow_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import numba as nb
import numpy as np
import numpy.typing as npt
from numba.experimental.jitclass import _box # type: ignore[missing-imports]

from fastscapelib.flow import (
Expand Down Expand Up @@ -970,6 +971,8 @@ def apply_flow_kernel(
if kernel.node_data_init:
kernel.node_data_init(node_data, data.jitclass_obj)

indices: npt.NDArray[np.uint64]

if wrapped_kernel.apply_dir == FlowGraphTraversalDir.ANY:
indices = np.arange(0, flow_graph.size, 1, dtype=np.uint64)
elif wrapped_kernel.apply_dir == FlowGraphTraversalDir.BREADTH_UPSTREAM:
Expand Down
Loading