Skip to content

Commit

Permalink
chore(deps): bump pypa/cibuildwheel from 2.19 to 2.20 in the actions …
Browse files Browse the repository at this point in the history
…group (#949)

* chore(deps): bump pypa/cibuildwheel in the actions group

Bumps the actions group with 1 update: [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel).


Updates `pypa/cibuildwheel` from 2.19 to 2.20
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](pypa/cibuildwheel@v2.19...v2.20)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <[email protected]>

* ci: add 3.13 wheels

* fix: require dev NumPy

* fix: try again

* style: pre-commit fixes

* ci: try PYO3_USE_ABI3_FORWARD_COMPATIBILITY for Python 3.13

Signed-off-by: Henry Schreiner <[email protected]>

* ci: fix several issues with config

Signed-off-by: Henry Schreiner <[email protected]>

* fix: support NumPy 2.2

Signed-off-by: Henry Schreiner <[email protected]>

* fix: support NumPy <2 again

Signed-off-by: Henry Schreiner <[email protected]>

* style: ignore pylint warning

Signed-off-by: Henry Schreiner <[email protected]>

* ci: skip tests on 3,13 ARM

Signed-off-by: Henry Schreiner <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 9, 2024
1 parent 5806d51 commit 8ded2db
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/emscripten.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
submodules: true
fetch-depth: 0

- uses: pypa/cibuildwheel@v2.19
- uses: pypa/cibuildwheel@v2.20
env:
CIBW_PLATFORM: pyodide

Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.12", "pypy3.9"]
python-version: ["3.9", "3.13", "pypy3.9"]
include:
- python-version: "3.8"
cmake-extras: "-DCMAKE_CXX_STANDARD=17"
Expand All @@ -85,8 +85,14 @@ jobs:
key: ${{ matrix.python-version }}
create-symlink: true

- 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

- name: Install python tools
run: uv pip install --system -r dev-requirements.txt pytest-github-actions-annotate-failures
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1

- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DBOOST_HISTOGRAM_ERRORS=ON ${{ matrix.cmake-extras }}
Expand All @@ -106,7 +112,7 @@ jobs:
matrix:
include:
- os: ubuntu-latest
build: cp312-manylinux_x86_64
build: cp313-manylinux_x86_64
- os: windows-2019
build: cp38-win32
- os: windows-2019
Expand All @@ -124,7 +130,7 @@ jobs:

- uses: yezz123/setup-uv@v4

- uses: pypa/cibuildwheel@v2.19
- uses: pypa/cibuildwheel@v2.20
env:
CIBW_BUILD: "${{ matrix.build }}"
CIBW_BUILD_VERBOSITY: 1
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python: [37, 38, 39, 310, 311, 312]
python: [37, 38, 39, 310, 311, 312, 313]
arch: [aarch64]
steps:
- uses: actions/checkout@v4
Expand All @@ -57,7 +57,7 @@ jobs:
with:
platforms: all

- uses: pypa/cibuildwheel@v2.19
- uses: pypa/cibuildwheel@v2.20
env:
CIBW_BUILD: cp${{ matrix.python }}-manylinux_*
CIBW_ARCHS: ${{ matrix.arch }}
Expand Down Expand Up @@ -115,7 +115,12 @@ jobs:

- uses: yezz123/setup-uv@v4

- uses: pypa/[email protected]
- uses: actions/setup-python@v4
if: matrix.os == 'macos-14'
with:
python-version: 3.8

- uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.build }}
CIBW_ARCHS: ${{ matrix.arch }}
Expand Down
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python",
Expand Down Expand Up @@ -166,14 +167,14 @@ test-command = "pytest --benchmark-disable {project}/tests"
test-skip = [
"pp310-*",
"*universal2:arm64",
"cp38-macosx_*:arm64",
"cp*-*musllinux*", # segfault
"cp313*linux_aarch64", # No NumPy available yet
]
skip = [
"pp37-*",
"pp38-*",
]
environment-pass = ["SETUPTOOLS_SCM_PRETEND_VERSION"]
environment-pass = ["SETUPTOOLS_SCM_PRETEND_VERSION", "PIP_EXTRA_INDEX_URL"]
environment.PIP_ONLY_BINARY = "numpy"
environment.PIP_PREFER_BINARY = "1"

Expand All @@ -184,6 +185,11 @@ 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"


[tool.pylint]
py-version = "3.7"
Expand Down
14 changes: 12 additions & 2 deletions src/boost_histogram/_internal/hist.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,18 @@ def view(
"""
return _to_view(self._hist.view(flow))

def __array__(self) -> np.typing.NDArray[Any]:
return self.view(False)
def __array__(
self,
dtype: np.typing.DTypeLike | None = None,
*,
# pylint: disable-next=redefined-outer-name
copy: bool | None = None,
) -> np.typing.NDArray[Any]:
# The copy kw is new in NumPy 2.0
kwargs = {}
if copy is not None:
kwargs["copy"] = copy
return np.asarray(self.view(False), dtype=dtype, **kwargs) # type: ignore[no-any-return, call-overload]

def __eq__(self, other: Any) -> bool:
return hasattr(other, "_hist") and self._hist == other._hist
Expand Down
8 changes: 6 additions & 2 deletions tests/test_pandaslike.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ class Seriesish:
def __init__(self, array):
self.array = np.asarray(array)

def __array__(self):
return self.array
def __array__(self, dtype=None, *, copy=None):
# Copy is new in NumPy 2.0
kw = {}
if copy is not None:
kw["copy"] = copy
return np.asarray(self.array, dtype=dtype, **kw)


def test_setting_weighted_profile_convertable():
Expand Down

0 comments on commit 8ded2db

Please sign in to comment.