Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0cd2ef3
update ci runners
calladoum-elastic Feb 12, 2026
bfedb2a
deprecated py39 and py310
calladoum-elastic Feb 12, 2026
68b62fd
setup as uv project, added py314 support to ci
calladoum-elastic Feb 12, 2026
78b665e
Merge branch 'main' of https://github.com/elastic/die-python into cal…
calladoum-elastic Feb 12, 2026
0a29779
update actions
calladoum-elastic Feb 12, 2026
9ac2aee
typo
calladoum-elastic Feb 12, 2026
9d2c37d
another typo
calladoum-elastic Feb 12, 2026
9e0e1d7
updated FindDieLibrary to support woa64
calladoum-elastic Feb 12, 2026
b6a0009
test
calladoum-elastic Feb 12, 2026
6fd1f48
fix: update processor check for Windows to use AMD64 instead of x86_64
calladoum-elastic Feb 18, 2026
b68d986
fix: update cache action version from v4 to v5 in build workflow
calladoum-elastic Feb 18, 2026
a5af87e
Qt6 ARM64 also requires x64 build
calladoum-elastic Feb 18, 2026
6d4b1dd
WoA only - set cross-compile path
calladoum-elastic Feb 18, 2026
ecba14b
fix: correct conditional check for Windows ARM64 Qt setup
calladoum-elastic Feb 18, 2026
aa554fb
fix: simplify conditional for Windows ARM64 Qt setup
calladoum-elastic Feb 18, 2026
62022e9
ty - fixed typing
calladoum-elastic Feb 18, 2026
0358486
fix: update Python version requirement to 3.11+ in README
calladoum-elastic Feb 18, 2026
68976cd
fix: update version to 0.5.0 in CMakeLists and Python bindings
calladoum-elastic Feb 18, 2026
3389f5e
in FindDieLibrary.cmake - use `FATAL_ERROR` (not `FATAL`) for critic…
calladoum-elastic Feb 18, 2026
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
77 changes: 41 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,41 @@ jobs:
matrix:
variant:
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
- {runner: macos-13, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.9' }
- {runner: macos-13, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.10' }
- {runner: macos-13, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.11' }
- {runner: macos-13, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.12' }
- {runner: macos-13, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.13' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.9' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.10' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.12' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.9' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.10' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.12' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: ubuntu-24.04-arm, qt-os: linux_arm64, arch: arm64, py-arch: arm64, qt-compiler: gcc_arm64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.9' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.10' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.12' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: macos-14-large, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.11' }
- {runner: macos-14-large, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.12' }
- {runner: macos-14-large, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.13' }
- {runner: macos-14-large, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.14' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.12' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.14' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.12' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.14' }
- {runner: ubuntu-24.04-arm, qt-os: linux_arm64, arch: arm64, py-arch: arm64, qt-compiler: gcc_arm64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: ubuntu-24.04-arm, qt-os: linux_arm64, arch: arm64, py-arch: arm64, qt-compiler: gcc_arm64, config: RelWithDebInfo, py-version: '3.14' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.12' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.14' }
- {runner: windows-2025, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: windows-2025, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.12' }
- {runner: windows-2025, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: windows-2025, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.14' }
- {runner: windows-11-arm, qt-os: windows, arch: x64, py-arch: arm64, qt-compiler: msvc2019_arm64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: windows-11-arm, qt-os: windows, arch: x64, py-arch: arm64, qt-compiler: msvc2019_arm64, config: RelWithDebInfo, py-version: '3.14' }
Comment thread
calladoum-elastic marked this conversation as resolved.
runs-on: ${{ matrix.variant.runner }}
name: python${{ matrix.variant.py-version }} / ${{ matrix.variant.runner }} / ${{ matrix.variant.config }}
env:
CMAKE_FLAGS: ""
QT_VERSION: 6.7.3 # arm64 support in aqt appears from >= 6.7.0 - and almalinux ships an old libc incompat with >= 6.8.x
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.variant.py-version }}
architecture: ${{ matrix.variant.py-arch }}
Expand All @@ -80,7 +83,7 @@ jobs:

- name: Cache Artifacts
id: cache-artifacts
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: build/${{ env.QT_VERSION }}
key: aqt-install-${{ matrix.variant.runner }}-${{ matrix.variant.arch }}-${{ env.QT_VERSION }}-${{ matrix.variant.qt-compiler }}
Expand All @@ -91,6 +94,11 @@ jobs:
python -m pip install aqtinstall --user --upgrade
python -m aqt install-qt -O build/ ${{ matrix.variant.qt-os }} desktop ${{ env.QT_VERSION }} win64_${{ matrix.variant.qt-compiler }}

- name: Setup Qt (Windows/ARM64)
if: steps.cache-artifacts.outputs.cache-hit != 'true' && matrix.variant.qt-compiler == 'msvc2019_arm64'
run: |
python -m aqt install-qt -O build/ ${{ matrix.variant.qt-os }} desktop ${{ env.QT_VERSION }} win64_msvc2019_64

- name: Setup Qt (macOS)
if: steps.cache-artifacts.outputs.cache-hit != 'true' && startsWith(matrix.variant.runner, 'macos-')
run: |
Expand All @@ -113,15 +121,15 @@ jobs:
python -m pytest -v python/tests

- name: Build wheels (Linux arm64)
if: matrix.variant.runner == 'ubuntu-24.04-arm' && matrix.variant.py-version == '3.13'
if: matrix.variant.runner == 'ubuntu-24.04-arm' && matrix.variant.py-version == '3.14'
run: |
python -m pip uninstall --quiet --yes die-python
rm -fr -- build/cp*
python -m pip install cibuildwheel==2.23.0
python -m cibuildwheel --output-dir wheelhouse --archs aarch64

- name: Build wheels (Linux x64)
if: matrix.variant.runner == 'ubuntu-24.04' && matrix.variant.py-version == '3.13'
if: matrix.variant.runner == 'ubuntu-24.04' && matrix.variant.py-version == '3.14'
run: |
python -m pip uninstall --quiet --yes die-python
rm -fr -- build/cp*
Expand Down Expand Up @@ -150,19 +158,16 @@ jobs:
matrix:
variant:
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
- {runner: macos-13, config: Release, py-version: '3.9' }
- {runner: macos-13, config: Release, py-version: '3.10' }
- {runner: macos-13, config: Release, py-version: '3.11' }
- {runner: macos-13, config: Release, py-version: '3.12' }
- {runner: macos-13, config: Release, py-version: '3.13' }
# - {runner: ubuntu-24.04, config: RelWithDebInfo, py-version: '3.12' }
- {runner: ubuntu-24.04, config: RelWithDebInfo, py-version: '3.13' }
- {runner: ubuntu-24.04-arm, config: RelWithDebInfo, py-version: '3.13' }
- {runner: windows-2022, config: RelWithDebInfo, py-version: '3.9' }
- {runner: windows-2022, config: RelWithDebInfo, py-version: '3.10' }
- {runner: macos-15-large, config: Release, py-version: '3.11' }
- {runner: macos-15-large, config: Release, py-version: '3.12' }
- {runner: macos-15-large, config: Release, py-version: '3.13' }
- {runner: macos-15-large, config: Release, py-version: '3.14' }
- {runner: ubuntu-24.04, config: RelWithDebInfo, py-version: '3.14' }
- {runner: ubuntu-24.04-arm, config: RelWithDebInfo, py-version: '3.14' }
- {runner: windows-2022, config: RelWithDebInfo, py-version: '3.11' }
- {runner: windows-2022, config: RelWithDebInfo, py-version: '3.12' }
- {runner: windows-2022, config: RelWithDebInfo, py-version: '3.13' }
- {runner: windows-2022, config: RelWithDebInfo, py-version: '3.14' }
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: PyPI upload of ${{ matrix.variant.runner }}/${{ matrix.variant.config }}/py${{ matrix.variant.py-version }}
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.26)

project(
DIE
VERSION 0.5.1
VERSION 0.5.0
LANGUAGES CXX
DESCRIPTION "DIE Library implementation"
)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# DetectItEasy-Python

[![Python 3.8+](https://img.shields.io/pypi/v/die-python.svg)](https://pypi.org/project/die-python/)
[![Python 3.11+](https://img.shields.io/pypi/v/die-python.svg)](https://pypi.org/project/die-python/)
[![Downloads](https://static.pepy.tech/badge/die-python)](https://pepy.tech/project/die-python)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Licence Apache2](https://img.shields.io/badge/License-Apache_2-blue)](https://github.com/elastic/die-python/blob/main/LICENSE)
[![Build](https://github.com/elastic/die-python/actions/workflows/build.yml/badge.svg)](https://github.com/elastic/die-python/actions/workflows/build.yml)

Native Python 3.8+ bindings for [@horsicq](https://github.com/horsicq/)'s [Detect-It-Easy](https://github.com/horsicq/Detect-It-Easy)
Native Python 3.11+ bindings for [@horsicq](https://github.com/horsicq/)'s [Detect-It-Easy](https://github.com/horsicq/Detect-It-Easy)


## Install
Expand All @@ -33,6 +33,7 @@ python -m pip install aqtinstall --user -U
python -m aqt install-qt -O ./build linux desktop 6.7.3 linux_gcc_64 # linux x64 only
python -m aqt install-qt -O ./build linux_arm64 desktop 6.7.3 linux_gcc_arm64 # linux arm64 only
python -m aqt install-qt -O ./build windows desktop 6.7.3 win64_msvc2019_64 # windows x64 only
python -m aqt install-qt -O ./build windows desktop 6.7.3 win64_msvc2019_arm64 # windows arm64 only (will requires `win64_msvc2019_64`)
python -m aqt install-qt -O ./build mac desktop 6.7.3 clang_64 # mac only
```

Expand Down
19 changes: 17 additions & 2 deletions cmake/FindDieLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ set(QT_BUILD_VERSION "6.7.3")
# TODO (calladoum) : here we oversimplify by assuming that compilation HOST and TARGET have same architecture

if(WIN32)
# python -m aqt install-qt -O build windows desktop ${QT_BUILD_VERSION} win64_msvc2019_64
set(QT_BUILD_COMPILER "msvc2019_64")
if (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "AMD64")
# python -m aqt install-qt -O build windows desktop ${QT_BUILD_VERSION} win64_msvc2019_64
set(QT_BUILD_COMPILER "msvc2019_64")
elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "ARM64")
# python -m aqt install-qt -O build windows desktop ${QT_BUILD_VERSION} win64_msvc2019_64
# python -m aqt install-qt -O build windows desktop ${QT_BUILD_VERSION} win64_msvc2019_arm64
set(QT_BUILD_COMPILER "msvc2019_arm64")
else()
message(FATAL_ERROR, "Unsupported processor ${CMAKE_HOST_SYSTEM_PROCESSOR}")
endif()

elseif(LINUX)
if (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
Expand All @@ -26,6 +34,8 @@ elseif(LINUX)
elseif(APPLE)
# python -m aqt install-qt -O build mac desktop ${QT_BUILD_VERSION} clang_64
set(QT_BUILD_COMPILER "macos")
else()
message(FATAL_ERROR, "Unsupported OS")
endif()

if(NOT QT_BUILD_COMPILER)
Expand All @@ -40,6 +50,11 @@ set(Qt6_CMAKE_ROOT "${ROOT_DIR}/build/${QT_BUILD_VERSION}/${QT_BUILD_COMPILER}/l
set(Qt6_DIR ${Qt6_CMAKE_ROOT}/Qt6)
set(QT_DIR ${Qt6_DIR})

if(WIN32 AND ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "ARM64")
# WoA only - set cross-compile path
set(QT_HOST_PATH "${ROOT_DIR}/build/${QT_BUILD_VERSION}/msvc2019_64")
endif()

message(STATUS "Qt6_CMAKE_ROOT: ${Qt6_CMAKE_ROOT}")
message(STATUS "Qt6_DIR: ${Qt6_DIR}")

Expand Down
22 changes: 17 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,36 @@ build-backend = "scikit_build_core.build"

[project]
name = "die_python"
version = "0.5.1"
version = "0.5.0"
description = "Python bindings for Detect It Easy (DIE)."
readme = "./README.md"
license.file = "./LICENSE"
requires-python = ">=3.9"
requires-python = ">=3.11"
authors = [{ name = "@calladoum-elastic" }]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Natural Language :: English",
]
dependencies = ["setuptools", "wheel", "nanobind"]

[project.optional-dependencies]
tests = ["pytest", "black", "beautifulsoup4", "lxml"]

[dependency-groups]
tests = ["pytest"]
Comment thread
calladoum-elastic marked this conversation as resolved.
dev = [
{ include-group = "tests" },
"black",
"beautifulsoup4",
"lxml",
"aqtinstall",
]

[project.urls]
Homepage = "https://github.com/elastic/die-python"

Expand All @@ -37,6 +46,9 @@ minimum-version = "0.4"
build-dir = "build/{wheel_tag}"
cmake.minimum-version = "3.20"

[tool.uv]
default-groups = ["dev"]

# Note: VS2022 throws a compiler crash when building nanobind, forcing VS2019 for now
# cmake.args = ["-G", "Visual Studio 16 2019"]

Expand All @@ -48,7 +60,7 @@ cmake.minimum-version = "3.20"
[tool.cibuildwheel]
before-build = "dnf install libstdc++ glibc -y && ldconfig"
build = ""
skip = "cp27-* cp35-* cp36-* cp37-* cp38-* pp* *musllinux*"
skip = "cp27-* cp35-* cp36-* cp37-* cp38-* cp39-* cp310-* pp* *musllinux*"
test-skip = ""
free-threaded-support = false
# use images from https://github.com/pypa/manylinux
Expand Down
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(
die-python
LANGUAGES CXX
VERSION 0.5.1
VERSION 0.5.0
)

find_package(Python 3
Expand Down
Loading
Loading