Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions .github/actions/setup-build-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
required: true
install-build-backend:
description: >
Whether to pre-install pybind11, scikit-build-core and numpy into the
Whether to pre-install nanobind, scikit-build-core into the
host environment. Required for `--no-build-isolation` builds; can be
skipped when pip provisions an isolated build environment.
required: false
Expand Down Expand Up @@ -63,4 +63,4 @@ runs:
- name: Install Python build backend (for --no-build-isolation builds)
if: inputs.install-build-backend == 'true'
shell: bash
run: python -m pip install pybind11 scikit-build-core numpy
run: python -m pip install nanobind scikit-build-core
2 changes: 1 addition & 1 deletion .github/actions/verify-atlas4py/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ runs:
- name: Run pytest suite
shell: bash
run: |
python -m pip install pytest
python -m pip install pytest numpy
pytest -v tests
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
build-backend = 'scikit_build_core.build'
requires = [
'scikit-build-core>=0.10.7',
'pybind11>=2.11.1',
'nanobind>=2.11.0',
]

[project]
dependencies = [
'numpy>=1.23'
]
dependencies = []

description = 'Python bindings for Atlas: a ECMWF library for parallel data-structures'
name = 'atlas4py'
version = '0.41.1.dev3' # <major>.<minor>.<patch>.dev<dev> : <atlas.major>.<atlas.minor>.<atlas.patch>.dev<atlas4py.dev>
version = '0.41.1.dev4' # <major>.<minor>.<patch>.dev<dev> : <atlas.major>.<atlas.minor>.<atlas.patch>.dev<atlas4py.dev>
license = {text = "Apache License 2.0"}
readme = {file = 'README.md', content-type = 'text/markdown'}
authors = [{email = 'willem.deconinck@ecmwf.int'}, {name = 'Willem Deconinck'}]
Expand All @@ -35,7 +33,7 @@ classifiers = [
repository = 'https://github.com/GridTools/atlas4py'

[project.optional-dependencies]
test = ['pytest']
test = ['pytest','numpy>=1.23']

[tool.scikit-build]
minimum-version = '0.5'
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
black>=21.12b0
bump-my-version>=1.2.6
numpy>=1.17
numpy>=1.23
pytest>=6.1
tox>=4.0
build>=1.2.2
21 changes: 14 additions & 7 deletions src/atlas4py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (NOT SKBUILD)
following command that avoids a costly creation of a new virtual
environment at every compilation:
=====================================================================
$ pip install pybind11 scikit-build-core
$ pip install nanobind scikit-build-core
$ pip install --no-build-isolation -ve ${PROJECT_ROOT_DIR}
=====================================================================
You may optionally add -Ceditable.rebuild=true to auto-rebuild when
Expand Down Expand Up @@ -49,12 +49,19 @@ set(CMAKE_CXX_STANDARD 17)
include(cmake/atlas4py_add_atlas.cmake)
atlas4py_add_atlas()

### Find pybind11
### Find nanobind

message( STATUS "${PROJECT_NAME}: find_package(pybind11 CONFIG)..." )
find_package(pybind11 CONFIG)
if (NOT pybind11_FOUND)
message( FATAL_ERROR "pybind11 not found. Please install pybind11 or use pip to install this package." )
message( STATUS "${PROJECT_NAME}: find_package(Python 3.9 REQUIRED COMPONENTS Interpreter Development.Module)" )
find_package(Python 3.9 REQUIRED COMPONENTS Interpreter Development.Module)

execute_process(
COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE nanobind_ROOT)

message( STATUS "${PROJECT_NAME}: find_package(nanobind CONFIG)..." )
find_package(nanobind CONFIG)
if (NOT nanobind_FOUND)
message( FATAL_ERROR "nanobind not found. Please install nanobind or use pip to install this package." )
endif()

### RPATH handling
Expand All @@ -74,7 +81,7 @@ endif()

### Python bindings module atlas4py

pybind11_add_module(_atlas4py _atlas4py.cpp)
nanobind_add_module(_atlas4py _atlas4py.cpp)
target_link_libraries(_atlas4py PUBLIC atlas)
target_compile_definitions(_atlas4py PRIVATE ATLAS4PY_VERSION_STRING=${PROJECT_VERSION_FULL})

Expand Down
Loading
Loading