Skip to content

Commit

Permalink
Merge pull request #105 from clEsperanto/patch-0.7.1
Browse files Browse the repository at this point in the history
post release debuging
  • Loading branch information
StRigaud authored Sep 1, 2023
2 parents 060d19c + a0717b4 commit 762c939
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 11 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Conda

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10"]

runs-on: ${{ matrix.platform }}

# The setup-miniconda action needs this to activate miniconda
defaults:
run:
shell: "bash -l {0}"

steps:
- uses: actions/checkout@v3

- name: Get conda
uses: conda-incubator/[email protected]
with:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge

- name: Prepare
run: conda install conda-build conda-verify pytest

- name: Build
run: conda build conda.recipe

- name: Install
run: conda install -c ${CONDA_PREFIX}/conda-bld/ pyclesperanto

- name: Test
run: pytest tests
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ project(
# enforce release build type if possible
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_DISABLE_AVAILABILITY")
# if(WIN32)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /d2FH4-")
# endif(WIN32)
Expand All @@ -37,7 +38,7 @@ option(BUILD_SHARED_LIBS OFF)
FetchContent_Declare(
CLIc
GIT_REPOSITORY https://github.com/clEsperanto/CLIc_prototype.git
GIT_TAG add-cuda-backend
GIT_TAG master
)
FetchContent_MakeAvailable(CLIc)

Expand Down Expand Up @@ -80,4 +81,4 @@ if(SKBUILD)
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_RPATH_USE_LINK_PATH TRUE
)
endif()
endif()
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ This package relies on the [CLIc] back-end for processing.
Get a conda/python environment, e.b. via [mini-conda](https://docs.conda.io/en/latest/miniconda.html). If you never used python/conda environments before, please follow the instructions [here](https://biapol.github.io/blog/johannes_mueller/anaconda_getting_started/) first.

```shell
conda create --name my_env python=3.10
conda activate my_env
mamba create --name my_env python=3.10
mamba activate my_env
```
~~Install pyclesperanto package using __conda__:~~ __(WIP, please use pip instead)__
```
Expand Down
63 changes: 63 additions & 0 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{% set name = "pyclesperanto" %}
{% set version = "0.7.1" %}
{% set sha256 = "5e4273fb1b89c2df6cbf850903512d0334945ae3c863b1b8da5d88e357700529" %}
{% set build_number = 0 %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
# fn: {{ name }}-{{ version }}.tar.gz
# url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
# sha256: {{ sha256 }}
path: ..

build:
number: {{ build_number }}
script: {{ PYTHON }} -m pip install . -vv

requirements:
build:
- python
- {{ compiler('cxx') }}
# - {{ compiler('m2w64_cxx') }} # [win and vc<14]
host:
- python
# - libpython # [win and vc<14]
- scikit-build-core
- pybind11
- cmake
- khronos-opencl-icd-loader # [win or osx]
- ocl-icd # [linux]
run:
- python
- numpy
- toolz
- matplotlib
- khronos-opencl-icd-loader # [win or osx]
- ocl-icd # [linux]

test:
imports:
- pyclesperanto
requires:
- pytest
source_files:
- tests
commands:
- pytest tests

about:
home: https://pypi.org/project/pyclesperanto/
doc_url: https://clesperanto.github.io/pyclesperanto/
dev_url: https://github.com/clEsperanto/pyclesperanto/
license: BSD-3-Clause
license_file: LICENSE
summary: GPU-accelerated Image Processing library using OpenCL
description: |
pyclesperanto is the python package of clEsperanto - a multi-language framework for GPU-accelerated image processing.
clEsperanto uses OpenCL kernels from CLIJ. This package relies on the CLIc back-end for processing.
extra:
recipe-maintainers:
- StRigaud
6 changes: 4 additions & 2 deletions pyclesperanto/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from ._core import (
gpu_info,
select_backend,
get_device,
select_device,
get_device,
wait_for_kernel_to_finish,
list_available_devices,
list_available_backends,
default_initialisation,
Device,
gpu_info,
)
from ._array import Image, is_image
from ._memory import create, create_like, push, pull
Expand All @@ -27,6 +28,7 @@
# Aliases - compatibility with prototype
from ._memory import push as asarray
from ._core import list_available_devices as available_device_names
from ._core import wait_for_kernel_to_finish as set_wait_for_kernel_to_finish
from ._core import gpu_info as cl_info
from ._tier5 import connected_components_labeling_box as label

Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ authors = [
{ name = "Stephane Rigaud", email = "[email protected]" },
{ name = "Robert Haase", email = "[email protected]" },
]
requires-python = ">=3.8"
requires-python = ">=3.7"
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
Expand All @@ -30,9 +30,9 @@ classifiers = [
"License :: OSI Approved :: BSD License",
]
dependencies = [
"numpy; python_version >='3.8'",
"toolz; python_version >='3.8'",
"matplotlib; python_version >='3.8'",
"numpy; python_version >='3.7'",
"toolz; python_version >='3.7'",
"matplotlib; python_version >='3.7'",
]

[project.urls]
Expand All @@ -46,7 +46,7 @@ addopts = "-ra -q"
testpaths = ["tests"]

[tool.cibuildwheel]
build = ["cp38-*", "cp39-*", "cp310-*", "cp311-*"]
build = ["cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"]
build-frontend = "build"
build-verbosity = 1
test-command = "pytest {project}/tests/test_import.py"
Expand Down

0 comments on commit 762c939

Please sign in to comment.