-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
14 changed files
with
1,114 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ on: | |
push: | ||
branches: | ||
- "main" | ||
pull_request: # TODO (aliddell): remove this | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
windows-and-linux-build: | ||
|
@@ -93,12 +96,12 @@ jobs: | |
|
||
- name: Build for x64 | ||
run: | | ||
cmake --preset=default -DVCPKG_TARGET_TRIPLET=x64-osx -DVCPKG_INSTALLED_DIR=${{github.workspace}}/vcpkg-x64 -B ${{github.workspace}}/build-x64 -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_OSX_ARCHITECTURES="x86_64" -DNOTEST=1 | ||
cmake --preset=default -DVCPKG_TARGET_TRIPLET=x64-osx -DVCPKG_INSTALLED_DIR=${{github.workspace}}/vcpkg-x64 -B ${{github.workspace}}/build-x64 -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_OSX_ARCHITECTURES="x86_64" -DBUILD_TESTING=OFF | ||
cmake --build ${{github.workspace}}/build-x64 --config ${{matrix.build_type}} | ||
- name: Build for arm64 | ||
run: | | ||
cmake --preset=default -DVCPKG_TARGET_TRIPLET=arm64-osx -DVCPKG_INSTALLED_DIR=${{github.workspace}}/vcpkg-arm64 -B ${{github.workspace}}/build-arm64 -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_OSX_ARCHITECTURES="arm64" -DNOTEST=1 | ||
cmake --preset=default -DVCPKG_TARGET_TRIPLET=arm64-osx -DVCPKG_INSTALLED_DIR=${{github.workspace}}/vcpkg-arm64 -B ${{github.workspace}}/build-arm64 -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_OSX_ARCHITECTURES="arm64" -DBUILD_TESTING=OFF | ||
cmake --build ${{github.workspace}}/build-arm64 --config ${{matrix.build_type}} | ||
- name: Create a universal binary | ||
|
@@ -114,4 +117,52 @@ jobs: | |
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: macos-latest ${{matrix.build_type}} binaries | ||
path: ${{github.workspace}}/*.zip | ||
path: ${{github.workspace}}/*.zip | ||
|
||
build-wheel: | ||
strategy: | ||
matrix: | ||
platform: | ||
- "windows-latest" | ||
- "ubuntu-latest" | ||
- "macos-latest" # TODO (aliddell): universal binary? | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
permissions: | ||
actions: write | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install vcpkg | ||
run: | | ||
git clone https://github.com/microsoft/vcpkg.git | ||
cd vcpkg && ./bootstrap-vcpkg.sh | ||
echo "VCPKG_ROOT=${{github.workspace}}/vcpkg" >> $GITHUB_ENV | ||
echo "${{github.workspace}}/vcpkg" >> $GITHUB_PATH | ||
./vcpkg integrate install | ||
shell: bash | ||
|
||
- name: Install dependencies | ||
run: python -m pip install -U pip "pybind11[global]" cmake build | ||
|
||
- name: Build | ||
run: python -m build | ||
|
||
- name: Upload wheel | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: ${{github.workspace}}/dist/*.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,11 +88,6 @@ jobs: | |
submodules: true | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install minio and mcli | ||
run: | | ||
apt update && apt install -y tmux wget | ||
|
@@ -137,4 +132,51 @@ jobs: | |
ZARR_S3_BUCKET_NAME: ${{ env.MINIO_BUCKET }} | ||
ZARR_S3_ACCESS_KEY_ID: ${{ env.MINIO_ACCESS_KEY }} | ||
ZARR_S3_SECRET_ACCESS_KEY: ${{ env.MINIO_SECRET_KEY }} | ||
run: ctest -C ${{env.BUILD_TYPE}} -L s3 --output-on-failure | ||
run: ctest -C ${{env.BUILD_TYPE}} -L s3 --output-on-failure | ||
|
||
test_python: | ||
name: Test on ${{ matrix.platform }} | ||
runs-on: ${{ matrix.platform }} | ||
timeout-minutes: 20 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- "ubuntu-latest" | ||
- "windows-latest" | ||
- "macos-latest" | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install vcpkg | ||
run: | | ||
git clone https://github.com/microsoft/vcpkg.git | ||
cd vcpkg && ./bootstrap-vcpkg.sh | ||
echo "VCPKG_ROOT=${{github.workspace}}/vcpkg" >> $GITHUB_ENV | ||
echo "${{github.workspace}}/vcpkg" >> $GITHUB_PATH | ||
./vcpkg integrate install | ||
shell: bash | ||
|
||
- name: Install dependencies | ||
run: python -m pip install -U pip "pybind11[global]" cmake build numpy pytest | ||
|
||
- name: Build and install Python bindings | ||
run: python -m pip install . | ||
|
||
- name: Run tests | ||
run: python -m pytest -v | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,72 @@ | ||
.idea | ||
build*/ | ||
install | ||
.vscode | ||
.cache | ||
CMakeSettings.json | ||
.vs | ||
TestResults | ||
cmake-build* | ||
.DS_Store | ||
*.zip | ||
_CPack_Packages/ | ||
.PVS-Studio | ||
|
||
# IDE | ||
.idea | ||
.vscode | ||
.vs | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build*/ | ||
cmake-build*/ | ||
_CPack_Packages/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
include CMakeLists.txt | ||
include CMakePresets.json | ||
include vcpkg.json | ||
include vcpkg-configuration.json | ||
include cmake/*.cmake | ||
recursive-include src * | ||
recursive-include include * | ||
recursive-include python * | ||
include LICENSE | ||
include README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"wheel", | ||
"ninja", | ||
"cmake>=3.12", | ||
"pybind11[global]", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
addopts = "-ra -q --color=yes" | ||
log_cli = true # when true, messages are printed immediately | ||
testpaths = [ | ||
"python/tests", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
project(acquire-zarr-py) | ||
|
||
execute_process(COMMAND python3 -m pybind11 --cmakedir | ||
RESULT_VARIABLE pybind11_NOT_FOUND | ||
OUTPUT_VARIABLE pybind11_DIR | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
if (pybind11_NOT_FOUND) | ||
message(FATAL_ERROR "pybind11 not found in the current environment. Please install pybind11 via pip.") | ||
else () | ||
LIST(APPEND CMAKE_MODULE_PATH ${pybind11_DIR}) | ||
cmake_path(CONVERT CMAKE_MODULE_PATH TO_CMAKE_PATH_LIST CMAKE_MODULE_PATH) | ||
endif () | ||
|
||
find_package(Python3 REQUIRED COMPONENTS Interpreter Development) | ||
find_package(pybind11 REQUIRED) | ||
|
||
pybind11_add_module(acquire_zarr acquire-zarr-py.cpp) | ||
|
||
target_include_directories(acquire_zarr PRIVATE ${CMAKE_SOURCE_DIR}/include) | ||
target_link_libraries(acquire_zarr PRIVATE acquire-zarr) | ||
|
||
set_target_properties(acquire_zarr PROPERTIES | ||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" | ||
) |
Oops, something went wrong.