Skip to content
Draft
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
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ jobs:
matrix:
os:
- ubuntu-24.04 # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
- ubuntu-24.04-arm # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Arm64-Readme.md
- macos-14 # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
- windows-2022 # https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
python-version:
Expand Down Expand Up @@ -223,6 +224,19 @@ jobs:
os: windows-2022
cibuildwheel: "cp312"

# avoid unnecessary use of arm resources
- is-full-run: false
os: ubuntu-24.04-arm
cibuildwheel: "cp310"

- is-full-run: false
os: ubuntu-24.04-arm
cibuildwheel: "cp311"

- is-full-run: false
os: ubuntu-24.04-arm
cibuildwheel: "cp312"

# avoid unnecessary use of mac resources
- is-full-run: false
os: macos-14
Expand Down Expand Up @@ -412,6 +426,7 @@ jobs:
matrix:
os:
- ubuntu-24.04
- ubuntu-24.04-arm
- macos-14
- windows-2022
python-version:
Expand Down Expand Up @@ -440,6 +455,19 @@ jobs:
os: windows-2022
python-version: "3.12"

# avoid unnecessary use of arm resources
- is-full-run: false
os: ubuntu-24.04-arm
python-version: "3.10"

- is-full-run: false
os: ubuntu-24.04-arm
python-version: "3.11"

- is-full-run: false
os: ubuntu-24.04-arm
python-version: "3.12"

# avoid unnecessary use of mac resources
- is-full-run: false
os: macos-14
Expand Down
4 changes: 2 additions & 2 deletions cpp/csp/python/NumpyInputAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ void NumpyInputAdapter<int64_t>::setValue( int64_t & value, void * data )
{
case NPY_BYTELTR:
{
const char * const val = (const char *) data;
const int8_t * const val = (const int8_t *) data;
value = static_cast<int64_t>(*val);
break;
}
case NPY_UBYTELTR:
{
const unsigned char * const val = (const unsigned char *) data;
const uint8_t * const val = (const uint8_t *) data;
value = static_cast<int64_t>(*val);
break;
}
Expand Down
27 changes: 27 additions & 0 deletions csp/tests/test_build.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
import runpy
import subprocess
import sys
import unittest
from pathlib import Path
from types import ModuleType
from unittest.mock import Mock, patch


class TestBuild(unittest.TestCase):
def test_arm64_linux_uses_arm64_vcpkg_triplet(self):
skbuild = ModuleType("skbuild")
skbuild.setup = Mock()
setup_path = Path(__file__).parents[2] / "setup.py"

with (
patch.dict(sys.modules, {"skbuild": skbuild}),
patch.object(sys, "platform", "linux"),
patch("platform.machine", return_value="aarch64"),
patch("platform.system", return_value="Linux"),
patch.object(
subprocess,
"check_output",
return_value=b"9c5c2a0ab75aff5bcd08142525f6ff7f6f7ddeee\n",
),
):
runpy.run_path(setup_path, run_name="csp_setup_test")

cmake_args = skbuild.setup.call_args.kwargs["cmake_args"]
self.assertIn("-DVCPKG_TARGET_TRIPLET=arm64-linux", cmake_args)

def test_init_helpers(self):
"""was a build issue where InitHelpers ran on a single instance across all libraries linking _cspimpl"""
# Take a sample of libraries
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
)

if sys.platform == "linux":
VCPKG_TRIPLET = "x64-linux"
VCPKG_TRIPLET = "arm64-linux" if platform.machine().lower() in ("aarch64", "arm64") else "x64-linux"
elif sys.platform == "win32":
VCPKG_TRIPLET = "x64-windows-static-md"
else:
Expand Down
Loading