diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fc18d065..48c2c059 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -87,7 +87,7 @@ jobs: - name: Install NumPy pre-release if: matrix.python-version == '3.13' - run: uv pip install --system numpy --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --prerelease=allow + run: uv pip install --system "numpy>=2.1.0rc1" - name: Install python tools run: uv pip install --system -r dev-requirements.txt pytest-github-actions-annotate-failures @@ -105,22 +105,24 @@ jobs: run: python -m pytest -ra build_wheels: - name: ${{ matrix.build }} + name: ${{ matrix.only }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - os: ubuntu-latest - build: cp313-manylinux_x86_64 + only: cp313t-manylinux_x86_64 + - os: ubuntu-latest + only: cp313-manylinux_x86_64 - os: windows-2019 - build: cp38-win32 + only: cp38-win32 - os: windows-2019 - build: cp37-win_amd64 + only: cp37-win_amd64 - os: macos-13 - build: cp39-macosx_x86_64 + only: cp39-macosx_x86_64 - os: macos-14 - build: cp39-macosx_arm64 + only: cp39-macosx_arm64 steps: - uses: actions/checkout@v4 @@ -131,8 +133,9 @@ jobs: - uses: yezz123/setup-uv@v4 - uses: pypa/cibuildwheel@v2.20 + with: + only: "${{ matrix.only }}" env: - CIBW_BUILD: "${{ matrix.build }}" CIBW_BUILD_VERBOSITY: 1 - uses: actions/upload-artifact@v4 diff --git a/.gitignore b/.gitignore index 887f921c..a96024e5 100644 --- a/.gitignore +++ b/.gitignore @@ -87,3 +87,5 @@ compile_commands.json # Nox .nox/* +/*venv* +/build diff --git a/CMakeLists.txt b/CMakeLists.txt index cc27945e..bb1b832a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ set(Python_ARTIFACTS_INTERACTIVE TRUE) FetchContent_Declare( pybind11 GIT_REPOSITORY https://github.com/pybind/pybind11.git - GIT_TAG 3e9dfa2866941655c56877882565e7577de6fc7b # v2.12.0 + GIT_TAG bd67643652d3800837f1f41549a2a5adbaa3fafe # v2.13.3 FIND_PACKAGE_ARGS NAMES pybind11) FetchContent_MakeAvailable(pybind11) diff --git a/pyproject.toml b/pyproject.toml index 277e6a33..eaff9138 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["scikit-build-core>=0.10", "pybind11>=2.12"] +requires = ["scikit-build-core>=0.10", "pybind11>=2.13.3"] build-backend = "scikit_build_core.build" [project] @@ -116,7 +116,7 @@ sdist.exclude = [ [[tool.scikit-build.generate]] path = "boost_histogram/version.py" template = ''' -__version__ = version = '$version' +__version__ = version = "$version" ''' @@ -164,31 +164,27 @@ ignore_missing_imports = true build-frontend = "build[uv]" test-extras = "test" test-command = "pytest --benchmark-disable {project}/tests" -test-skip = [ - "pp310-*", - "*universal2:arm64", - "cp*-*musllinux*", # segfault - "cp313*linux_aarch64", # No NumPy available yet -] skip = [ - "pp37-*", - "pp38-*", + "pp3[78]-*", + "cp313t-*win*" ] -environment-pass = ["SETUPTOOLS_SCM_PRETEND_VERSION", "PIP_EXTRA_INDEX_URL"] +test-skip = [ + "cp*-musllinux_*", # Segfaults + "pp310-macosx_arm64", # No binary (numpy 2.1.0 rc 1) +] +free-threaded-support = true +environment-pass = ["SETUPTOOLS_SCM_PRETEND_VERSION"] environment.PIP_ONLY_BINARY = "numpy" environment.PIP_PREFER_BINARY = "1" [[tool.cibuildwheel.overrides]] select = "*pyodide*" inherit.environment = "append" -environment.CFLAGS = "-fexceptions" -environment.LDFLAGS = "-fexceptions" build-frontend = {name = "build", args = ["--exports", "whole_archive"]} [[tool.cibuildwheel.overrides]] -select = "cp313*" -inherit.environment = "append" -before-test = "uv pip install --index-url=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --prerelease=allow numpy" +select = ["cp313*", "pp310*"] +before-test = 'uv pip install --only-binary=:all: "numpy>=2.1.0rc1"' [tool.pylint] diff --git a/src/module.cpp b/src/module.cpp index 075f4b6a..7a6bbe20 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -12,7 +12,7 @@ void register_histograms(py::module&); void register_accumulators(py::module&); void register_transforms(py::module&); -PYBIND11_MODULE(_core, m) { +PYBIND11_MODULE(_core, m, py::mod_gil_not_used()) { py::module storage = m.def_submodule("storage"); register_storages(storage);