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
7 changes: 1 addition & 6 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ jobs:
- uses: ilammy/msvc-dev-cmd@v1
- uses: lukka/[email protected]

- uses: actions/setup-python@v5
with:
python-version: 3.8
if: runner.os == 'macOS' && runner.arch == 'ARM64'

########################################################################
# flatbuffers
########################################################################
Expand Down Expand Up @@ -214,7 +209,7 @@ jobs:
uses: pypa/[email protected]
env:
CIBW_BUILD: "cp3*-${{ matrix.platform_tag }}"
CIBW_SKIP: "cp3{5,6,7}*"
CIBW_SKIP: "cp3{5,6,7,8}*"
CIBW_ENVIRONMENT_MACOS: >
CMAKE_PREFIX_PATH='${{ github.workspace }}/opt'
Python_ROOT_DIR=''
Expand Down
21 changes: 19 additions & 2 deletions cmake/FindHalide_LLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,29 @@ set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL MinSizeRel Release RelWithDebInfo "")
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release MinSizeRel "")
set(CMAKE_MAP_IMPORTED_CONFIG_RELEASE Release MinSizeRel RelWithDebInfo "")

find_package(LLVM CONFIG)
set(llvm_paths "")
foreach (
template IN ITEMS
"/opt/homebrew/opt/llvm@@VERSION@" # Homebrew on macOS
"/usr/lib/llvm-@VERSION@" # Debian/Ubuntu packages
"/usr/local/lib/llvm-@VERSION@" # Third-party packages
"/opt/llvm-@VERSION@" # Third-party packages
)
foreach (VERSION RANGE 18 21) # inclusive!
string(CONFIGURE "${template}" path @ONLY)
list(APPEND llvm_paths "${path}")
endforeach ()
endforeach ()
list(REVERSE llvm_paths) # search more recent versions first

find_package(LLVM PATHS ${llvm_paths})

# Neither LLVM_VERSION nor LLVM_PACKAGE_VERSION work as find_package arguments
# in git/development builds as they include a "git" suffix. This applies at
# time of writing to versions 18-21, inclusive.
set(Halide_LLVM_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
if (LLVM_FOUND)
set(Halide_LLVM_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
endif ()

if (NOT DEFINED Halide_LLVM_SHARED_LIBS)
# Normally, we don't like making decisions for our users. However,
Expand Down
2 changes: 1 addition & 1 deletion doc/BuildingHalideWithCMake.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ building the core pieces of Halide.
| [flatbuffers] | `~=23.5.26` | `WITH_SERIALIZATION=ON` | |
| [wabt] | `==1.0.36` | `Halide_WASM_BACKEND=wabt` | Does not have a stable API; exact version required. |
| [V8] | trunk | `Halide_WASM_BACKEND=V8` | Difficult to build. See [WebAssembly.md] |
| [Python] | `>=3.8` | `WITH_PYTHON_BINDINGS=ON` | |
| [Python] | `>=3.9` | `WITH_PYTHON_BINDINGS=ON` | |
| [pybind11] | `~=2.11.1` | `WITH_PYTHON_BINDINGS=ON` | |

Halide maintains the following compatibility policy with LLVM: Halide version
Expand Down
6 changes: 2 additions & 4 deletions doc/Python.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* [License](#license)
<!-- TOC -->

Halide provides Python bindings for most of its public API. Python 3.8 (or
Halide provides Python bindings for most of its public API. Python 3.9 (or
higher) is required. The Python bindings are supported on 64-bit Linux, OSX, and
Windows systems.

Expand Down Expand Up @@ -88,9 +88,7 @@ $ python3 -m pip install -r requirements.txt
Then build and install Halide:

```shell
$ cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_PYTHON_BINDINGS=ON
$ cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Release
$ cmake --build build
$ cmake --install build --prefix .local
```
Expand Down
20 changes: 13 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
requires = [
"scikit-build-core==0.10.5",
"pybind11==2.11.1",
"scikit-build-core==0.11.5",
"pybind11>=2.11.1",
]
build-backend = "scikit_build_core.build"

Expand All @@ -12,10 +12,10 @@ maintainers = [{ name = "Alex Reinking", email = "[email protected]" }]
description = "Halide is a programming language designed to make it easier to write high-performance image and array processing code."
license = { file = "LICENSE.txt" }
readme = "./packaging/pip/README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = [
"numpy",
"imageio",
"numpy>=2",
"imageio>=2",
]
dynamic = ['version']
keywords = [
Expand Down Expand Up @@ -45,7 +45,6 @@ classifiers = [
"Programming Language :: C++",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -61,6 +60,13 @@ classifiers = [
"Topic :: Software Development :: Libraries",
]

[project.optional-dependencies]
dev = [
"pillow>=11.3",
"scipy>=1.12",
"tbump>=6.11",
]

[project.urls]
Homepage = "https://halide-lang.org"
Documentation = "https://github.com/halide/Halide/blob/main/doc/Python.md"
Expand All @@ -72,7 +78,7 @@ Repository = "https://github.com/halide/Halide.git"
cmake.version = ">=3.28"
wheel.install-dir = "halide"
sdist.include = ["dependencies/"]
sdist.exclude = [".github/", "apps/", "test/", "tutorial/"]
sdist.exclude = [".github/", "apps/", "test/", "tutorial/", "dependencies/update-*.sh"]
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"

[tool.scikit-build.cmake.define]
Expand Down
2 changes: 1 addition & 1 deletion python_bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ cmake_dependent_option(
# Development.Module and Development.Embed. We don't need the Embed
# part, so only requesting Module avoids failures when Embed is not
# available, as is the case in the manylinux Docker images.
find_package(Python 3.8 REQUIRED Interpreter Development.Module)
find_package(Python 3.9 REQUIRED Interpreter Development.Module)

if (WITH_PYTHON_BINDINGS)
find_package(pybind11 2.11.1 REQUIRED)
Expand Down
41 changes: 30 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
build
cmake>=3.28
imageio
ninja
numpy
pillow
pybind11==2.11.1
scikit-build-core==0.10.5
scipy
setuptools>=43
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml --extra dev -o requirements.txt
cli-ui==0.19.0
# via tbump
colorama==0.4.6
# via cli-ui
docopt==0.6.2
# via tbump
imageio==2.37.0
# via halide (pyproject.toml)
numpy==2.3.1
# via
# halide (pyproject.toml)
# imageio
# scipy
pillow==11.3.0
# via
# halide (pyproject.toml)
# imageio
schema==0.7.7
# via tbump
scipy==1.16.0
# via halide (pyproject.toml)
tabulate==0.9.0
# via cli-ui
tbump==6.11.0
wheel
# via halide (pyproject.toml)
tomlkit==0.11.8
# via tbump
unidecode==1.4.0
# via cli-ui
2 changes: 1 addition & 1 deletion test/autoschedulers/li2018/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (WITH_PYTHON_BINDINGS)
if (Halide_TARGET MATCHES "webgpu")
message(WARNING "li2018_gradient_autoscheduler_test_py is not supported with WebGPU.")
else()
find_package(Python 3.8 REQUIRED COMPONENTS Interpreter Development.Module)
find_package(Python 3.9 REQUIRED COMPONENTS Interpreter Development.Module)

add_test(
NAME li2018_gradient_autoscheduler_test_py
Expand Down