Skip to content

Commit

Permalink
Merge branch 'develop' into henryiii/feat/scikit-build-core
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Mar 30, 2024
2 parents fe68893 + c88b660 commit 650a831
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 54 deletions.
3 changes: 1 addition & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ end
- Finish merging open PRs that you want in the new version
- Add most recent changes to the `docs/CHANGELOG.md`
- Sync master with develop using `git checkout master; git merge develop --ff-only` and push
- Make sure the full wheel build runs on master without issues (will happen
automatically on push to master)
- Make sure the full wheel build runs on master without issues (manually trigger if needed)
- Make the GitHub release in the GitHub UI. Copy the changelog entries and
links for that version; this has to be done as part of the release and tag
procedure for archival tools (Zenodo) to pick them up correctly.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@main
- uses: actions/labeler@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
sync-labels: true
64 changes: 30 additions & 34 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ on:
inputs:
overrideVersion:
description: Manually force a version
pull_request:
branches:
- master
- main
push:
branches:
- master
- main
release:
types:
- published
Expand All @@ -35,19 +27,15 @@ jobs:
fetch-depth: 0
submodules: true

- name: Set version if needed
if: github.event.inputs.overrideVersion
run: echo "SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}" >> $GITHUB_ENV

- name: Build SDist
run: pipx run build --sdist

- name: Check metadata
run: pipx run twine check --strict dist/*
run: pipx run twine check --strict dist/*.tar.gz

- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
path: dist/*
name: wheels-sdist

build_arch_wheels:
Expand All @@ -63,11 +51,6 @@ jobs:
fetch-depth: 0
submodules: true

- name: Set version if needed
if: github.event.inputs.overrideVersion
shell: bash
run: echo "SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}" >> $GITHUB_ENV

- uses: docker/setup-qemu-action@v3.0.0
with:
platforms: all
Expand All @@ -84,40 +67,50 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl
path: wheelhouse/*
name: wheel-aarch-${{ strategy.job-index }}

build_wheels:
name: ${{ matrix.type }} ${{ matrix.arch }} on ${{ matrix.os }}
name: ${{ matrix.build }} ${{ matrix.arch }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2019, ubuntu-latest]
arch: [auto64]

include:
- os: windows-2019
arch: auto64
build: "cp*"

- os: windows-2019
arch: auto64
build: "pp*"

- os: macos-latest
arch: universal2
build: "*"

- os: macos-latest
arch: auto64
build: cp37*

- os: windows-2019
arch: auto32
build: "*"

- os: macos-latest
- os: ubuntu-latest
arch: auto64
build: cp37*
build: "*manylinux*"

- os: ubuntu-latest
arch: auto64
build: "*musllinux*"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true

- name: Set version if needed
if: github.event.inputs.overrideVersion
shell: bash
run: echo "SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}" >> $GITHUB_ENV

- uses: pypa/cibuildwheel@v2.17
env:
CIBW_BUILD: ${{ matrix.build }}
Expand All @@ -137,6 +130,12 @@ jobs:
name: Upload if release
needs: [build_wheels, build_arch_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
environment:
name: pypi
url: https://pypi.org/p/boost-histogram
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v4
Expand All @@ -149,6 +148,3 @@ jobs:
run: ls -lh dist

- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release' && github.event.action == 'published'
with:
password: ${{ secrets.pypi_password }}
13 changes: 9 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,13 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
- id: shellcheck
exclude: ^docs/notebooks/conf.sh$
- id: check-readthedocs
- id: check-github-workflows

- repo: https://github.com/henryiii/validate-pyproject-schema-store
rev: 2024.03.25
hooks:
- id: validate-pyproject
23 changes: 23 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

## Version 1.4

### Version 1.4.1

#### Features

- NumPy 2 support. [#918][]
- 32-bit Windows Python 3.12 wheel added (matching NumPy). [#920][]

#### Bugfixes

- Support filling Integer axes with unsigned integers [#917][]
- Avoid triggering NumPy 2 dev release install on Python 3.12. [#914][]

#### Backend and docs

- Add missing API docs [#909][]
- Use boost 1.84 [#920][]

[#909]: https://github.com/scikit-hep/boost-histogram/pull/909
[#914]: https://github.com/scikit-hep/boost-histogram/pull/914
[#917]: https://github.com/scikit-hep/boost-histogram/pull/917
[#918]: https://github.com/scikit-hep/boost-histogram/pull/918
[#920]: https://github.com/scikit-hep/boost-histogram/pull/920

### Version 1.4.0

#### Features
Expand Down
2 changes: 1 addition & 1 deletion extern/config
Submodule config updated 203 files
2 changes: 1 addition & 1 deletion extern/core
Submodule core updated 37 files
+37 −3 .github/workflows/ci.yml
+18 −1 doc/changes.qbk
+19 −16 doc/swap.qbk
+1 −1 include/boost/core/detail/sp_thread_pause.hpp
+93 −0 include/boost/core/invoke_swap.hpp
+6 −55 include/boost/core/swap.hpp
+4 −1 include/boost/swap.hpp
+4 −1 include/boost/utility/swap.hpp
+27 −25 test/Jamfile.v2
+0 −4 test/swap/Jamfile.v2
+3 −3 test/swap/swap_array_of_array_of_class.cpp
+3 −3 test/swap/swap_array_of_array_of_int.cpp
+3 −3 test/swap/swap_array_of_class.cpp
+3 −3 test/swap/swap_array_of_int.cpp
+3 −3 test/swap/swap_array_of_template.cpp
+3 −3 test/swap/swap_const_wrapper_fail.cpp
+1 −1 test/swap/swap_lib_header_1.cpp
+2 −2 test/swap/swap_lib_header_2.cpp
+0 −11 test/swap/swap_mixed_headers_1.cpp
+0 −12 test/swap/swap_mixed_headers_2.cpp
+6 −6 test/swap/swap_no_ambiguity_in_boost.cpp
+6 −6 test/swap/swap_noexcept.cpp
+2 −2 test/swap/swap_primitive.cpp
+0 −10 test/swap/swap_root_header_1.cpp
+0 −11 test/swap/swap_root_header_2.cpp
+2 −2 test/swap/swap_specialized_in_boost.cpp
+6 −6 test/swap/swap_specialized_in_boost_and_other.cpp
+2 −2 test/swap/swap_specialized_in_global.cpp
+2 −2 test/swap/swap_specialized_in_other.cpp
+2 −2 test/swap/swap_specialized_in_std.cpp
+3 −3 test/swap/swap_std_bitset.cpp
+3 −3 test/swap/swap_std_dateorder.cpp
+3 −3 test/swap/swap_std_string.cpp
+3 −3 test/swap/swap_std_typeinfo_ptr.cpp
+3 −3 test/swap/swap_std_vector_of_boost.cpp
+3 −3 test/swap/swap_std_vector_of_global.cpp
+3 −3 test/swap/swap_std_vector_of_other.cpp
2 changes: 1 addition & 1 deletion extern/mp11
2 changes: 1 addition & 1 deletion extern/throw_exception
2 changes: 1 addition & 1 deletion extern/variant2
4 changes: 3 additions & 1 deletion include/bh_python/fill.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ inline decltype(auto) special_cast<c_array_t<int>>(py::handle x) {
auto dtype = py::cast<py::array>(x).dtype();
if(dtype.equal(np.attr("bool_")) || dtype.equal(np.attr("int8"))
|| dtype.equal(np.attr("int16")) || dtype.equal(np.attr("int32"))
|| dtype.equal(np.attr("int64")))
|| dtype.equal(np.attr("int64")) || dtype.equal(np.attr("uint8"))
|| dtype.equal(np.attr("uint16")) || dtype.equal(np.attr("uint32"))
|| dtype.equal(np.attr("uint64")))
return py::cast<c_array_t<int>>(x);
throw py::type_error("Only integer arrays supported when targeting integer axes");
}
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,19 @@ ignore = [
"tests/.pytest_cache/**",
]


[tool.cibuildwheel]
test-extras = "test"
test-command = "pytest --benchmark-disable {project}/tests"
test-skip = [
"pp*", # requires correct version to get binary
"pp37-*",
"pp38-*",
"pp310-*",
"*universal2:arm64",
"*musllinux*",
"cp312-win_amd64", # NumPy segfaults
"cp*-*musllinux*", # segfault
]
skip = ["pp*-manylinux_i686", "cp312-win32"] # not supported by NumPy
environment-pass = ["SETUPTOOLS_SCM_PRETEND_VERSION"]
environment = { PIP_ONLY_BINARY = "numpy" }
macos.archs = ["universal2"]
environment.PIP_ONLY_BINARY = "numpy"


[tool.pylint]
Expand Down
11 changes: 11 additions & 0 deletions tests/test_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,17 @@ def test_numpy_conversion_5():
assert a1[2, 1] == 5


@pytest.mark.parametrize(
"dtype",
[np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, np.uint32, np.uint64],
)
def test_fill_dtypes(dtype):
a = bh.Histogram(bh.axis.Integer(0, 2), storage=bh.storage.Int64())
a.fill(np.array([0, 0, 0, 1, 1, 2], dtype=dtype))
a.fill(dtype(0))
assert list(a.values()) == [4, 2]


def test_fill_with_sequence_0():
def fa(*args):
return np.array(args, dtype=float)
Expand Down

0 comments on commit 650a831

Please sign in to comment.