diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 03157925..7f2a2e08 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -385,6 +385,7 @@ jobs: CIBW_ENVIRONMENT_LINUX: > LD_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64:$LD_LIBRARY_PATH" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" + CMAKE_ARGS="-DREQUIRE_ALLEXTRAS=ON" CIBW_ARCHS: auto64 CIBW_TEST_REQUIRES: numpy pandas pyarrow pytest bfio imagecodecs CIBW_TEST_COMMAND: pytest -vv {project}/tests/python @@ -448,6 +449,7 @@ jobs: CIBW_ENVIRONMENT_LINUX: > LD_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64:$LD_LIBRARY_PATH" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" + CMAKE_ARGS="-DREQUIRE_ALLEXTRAS=ON" CIBW_ARCHS: auto64 CIBW_TEST_REQUIRES: numpy pandas pyarrow pytest bfio imagecodecs CIBW_TEST_COMMAND: pytest -vv {project}/tests/python @@ -506,7 +508,7 @@ jobs: CIBW_BUILD: ${{ matrix.cibw_build }}-* CIBW_BUILD_VERBOSITY: 3 CIBW_BEFORE_ALL_WINDOWS: xcopy /E /I /y local_install C:\TEMP\nyxus_bld\local_install - CIBW_ENVIRONMENT_WINDOWS: PATH="C:\\TEMP\\nyxus_bld\\local_install\\bin;$PATH" NYXUS_DEP_DIR="C:\\TEMP\\nyxus_bld\\local_install" + CIBW_ENVIRONMENT_WINDOWS: PATH="C:\\TEMP\\nyxus_bld\\local_install\\bin;$PATH" NYXUS_DEP_DIR="C:\\TEMP\\nyxus_bld\\local_install" CMAKE_ARGS="-DREQUIRE_ALLEXTRAS=ON" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" CIBW_ARCHS: auto64 CIBW_TEST_REQUIRES: numpy pandas pyarrow pytest bfio imagecodecs @@ -579,7 +581,7 @@ jobs: LDFLAGS="-isysroot $SDKROOT -lc++ -lc++abi -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" PIP_ONLY_BINARY="imagecodecs" ARROW_HAVE_LIBATOMIC=OFF - CMAKE_ARGS="-DUSE_STATIC_ARROW=ON" + CMAKE_ARGS="-DUSE_STATIC_ARROW=ON -DREQUIRE_ALLEXTRAS=ON" REPAIR_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" CIBW_REPAIR_WHEEL_COMMAND_MACOS: | @@ -655,7 +657,7 @@ jobs: CMAKE_C_COMPILER="$CC" CMAKE_CXX_COMPILER="$CXX" CXXFLAGS="-isysroot $SDKROOT -stdlib=libc++" LDFLAGS="-isysroot $SDKROOT -lc++ -lc++abi" - CMAKE_ARGS="-DUSE_STATIC_ARROW=ON" + CMAKE_ARGS="-DUSE_STATIC_ARROW=ON -DREQUIRE_ALLEXTRAS=ON" REPAIR_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" CIBW_REPAIR_WHEEL_COMMAND_MACOS: | diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index aef30e4d..f9037953 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -203,7 +203,7 @@ jobs: CIBW_BEFORE_ALL_LINUX: dnf -y install llvm libevent-devel openssl-devel && mkdir -p /tmp/nyxus_bld && cp -a local_install /tmp/nyxus_bld - CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64:$LD_LIBRARY_PATH" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" + CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64:$LD_LIBRARY_PATH" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" CMAKE_ARGS="-DREQUIRE_ALLEXTRAS=ON" CIBW_ARCHS: ${{ matrix.cibw_archs }} CIBW_TEST_REQUIRES: numpy pandas pyarrow pytest bfio imagecodecs CIBW_TEST_COMMAND: pytest {project}/tests/python @@ -271,7 +271,7 @@ jobs: CIBW_BEFORE_ALL_LINUX: dnf -y install llvm libevent-devel openssl-devel && mkdir -p /tmp/nyxus_bld && cp -a local_install /tmp/nyxus_bld - CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64:$LD_LIBRARY_PATH" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" + CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64:$LD_LIBRARY_PATH" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" CMAKE_ARGS="-DREQUIRE_ALLEXTRAS=ON" CIBW_ARCHS: ${{ matrix.cibw_archs }} CIBW_TEST_REQUIRES: numpy pandas pyarrow pytest bfio imagecodecs CIBW_TEST_COMMAND: pytest {project}/tests/python @@ -335,7 +335,7 @@ jobs: CIBW_BUILD: ${{ matrix.cibw_build }} CIBW_BUILD_VERBOSITY: 3 CIBW_BEFORE_ALL_WINDOWS: xcopy /E /I /y local_install C:\TEMP\nyxus_bld\local_install - CIBW_ENVIRONMENT_WINDOWS: PATH="C:\\TEMP\\nyxus_bld\\local_install\\bin;$PATH" NYXUS_DEP_DIR="C:\\TEMP\\nyxus_bld\\local_install" + CIBW_ENVIRONMENT_WINDOWS: PATH="C:\\TEMP\\nyxus_bld\\local_install\\bin;$PATH" NYXUS_DEP_DIR="C:\\TEMP\\nyxus_bld\\local_install" CMAKE_ARGS="-DREQUIRE_ALLEXTRAS=ON" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" CIBW_ARCHS: ${{ matrix.cibw_archs }} CIBW_TEST_REQUIRES: numpy pandas pyarrow pytest bfio imagecodecs @@ -416,7 +416,7 @@ jobs: LDFLAGS="-isysroot $SDKROOT -lc++ -lc++abi -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" PIP_ONLY_BINARY="imagecodecs" ARROW_HAVE_LIBATOMIC=OFF - CMAKE_ARGS="-DUSE_STATIC_ARROW=ON" + CMAKE_ARGS="-DUSE_STATIC_ARROW=ON -DREQUIRE_ALLEXTRAS=ON" REPAIR_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" CIBW_REPAIR_WHEEL_COMMAND_MACOS: | @@ -503,7 +503,7 @@ jobs: CXXFLAGS="-isysroot $SDKROOT -stdlib=libc++ -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" LDFLAGS="-isysroot $SDKROOT -lc++ -lc++abi -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" ARROW_HAVE_LIBATOMIC=OFF - CMAKE_ARGS="-DUSE_STATIC_ARROW=ON" + CMAKE_ARGS="-DUSE_STATIC_ARROW=ON -DREQUIRE_ALLEXTRAS=ON" REPAIR_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" CIBW_REPAIR_WHEEL_COMMAND_MACOS: | diff --git a/CMakeLists.txt b/CMakeLists.txt index b5db0a27..579ff77a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ option(USE_ARROW "Use Arrow" OFF) option(USE_STATIC_ARROW "Link Arrow/Parquet statically and keep their symbols private (macOS)" OFF) option(ALLEXTRAS "Building with all I/O support" OFF) option(NOEXTRAS "Building with Only Tiff and Pybind11(For Python package)" ON) +option(REQUIRE_ALLEXTRAS "Fail the configure when an ALLEXTRAS part is unavailable" OFF) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake-modules") @@ -502,6 +503,20 @@ message(STATUS "Z5 | ${Z5_REQUESTED} | ${USE_Z5}") message(STATUS "Arrow | ${ARROW_REQUESTED} | ${USE_ARROW}") message(STATUS "Dicom | ${DCMTK_REQUESTED} | ${USE_DCMTK}") message(STATUS "CUDA | ${CUDA_REQUESTED} | ${USEGPU}") + +# Release wheels set this, so that none of them can ship without a file format. +if(REQUIRE_ALLEXTRAS) + set(NYXUS_PARTS_OFF "") + foreach(part USE_Z5 USE_ARROW USE_DCMTK) + if(NOT ${part}) + list(APPEND NYXUS_PARTS_OFF ${part}) + endif() + endforeach() + if(NYXUS_PARTS_OFF) + message(FATAL_ERROR "REQUIRE_ALLEXTRAS is set and these parts are off: ${NYXUS_PARTS_OFF}") + endif() +endif() + ## Running Tests if (RUN_GTEST) # Download and unpack googletest at configure time diff --git a/README.md b/README.md index a01f8dd2..188d3fc7 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,9 @@ conda install nyxus -c conda-forge ``` The conda-forge package has no build for Apple Silicon Macs or Linux aarch64; use `pip` there. -On Windows, the PyPI wheels do not read OME-Zarr or compressed NIfTI (`.nii.gz`), and the -conda-forge packages of 0.11.0 need Visual Studio installed (they were built in Debug mode). +On Windows, the PyPI wheels older than 0.12.0 do not read OME-Zarr or compressed NIfTI +(`.nii.gz`), and the conda-forge packages of 0.11.0, 0.12.0 and 0.12.1 need Visual Studio installed +(they were built in Debug mode). GPU wheels, the Docker image and building from source are described in [Installation](https://nyxus.readthedocs.io/en/latest/installation.html). diff --git a/ci-utils/install_prereq_win.bat b/ci-utils/install_prereq_win.bat index f7d63469..5ae1fddf 100644 --- a/ci-utils/install_prereq_win.bat +++ b/ci-utils/install_prereq_win.bat @@ -59,21 +59,6 @@ popd popd if "%BUILD_Z5_DEP%" == "1" ( - for /l %%x in (1, 1, 5) do ( - curl -L https://archives.boost.io/release/1.79.0/source/boost_1_88_0.zip -o boost_1_88_0.zip - if exist boost_1_88_0.zip ( - goto :continue_boost - ) - ) - :continue_boost - tar -xf boost_1_88_0.zip - pushd boost_1_88_0 - call bootstrap.bat - .\b2 headers --prefix=../local_install - .\b2 -j %NUMBER_OF_PROCESSORS% variant=release link=shared runtime-link=shared threading=multi install --prefix=../local_install - xcopy /E /I /y boost ..\local_install\include\boost - popd - curl -L https://github.com/Blosc/c-blosc/archive/refs/tags/v1.21.6.zip -o v1.21.6.zip tar -xf v1.21.6.zip pushd c-blosc-1.21.6 @@ -106,7 +91,6 @@ if "%BUILD_Z5_DEP%" == "1" ( ) -set _ROOTDIR=%ROOTDIR:\=/% if "%BUILD_ARROW%" == "1" ( curl -L https://github.com/apache/arrow/archive/refs/tags/apache-arrow-20.0.0.zip -o arrow-apache-arrow-20.0.0.zip @@ -115,7 +99,7 @@ if "%BUILD_ARROW%" == "1" ( pushd cpp mkdir build pushd build - cmake .. -A x64 -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_INSTALL_PREFIX=../../../local_install/ -DCMAKE_PREFIX_PATH=%ABS_INSTALL% -DARROW_PARQUET=ON -DARROW_WITH_SNAPPY=ON -DARROW_BUILD_TESTS=OFF -DBOOST_ROOT=%_ROOTDIR%/boost_1_88_0 + cmake .. -A x64 -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_INSTALL_PREFIX=../../../local_install/ -DCMAKE_PREFIX_PATH=%ABS_INSTALL% -DARROW_PARQUET=ON -DARROW_WITH_SNAPPY=ON -DARROW_BUILD_TESTS=OFF cmake --build . --config Release --target install --parallel 4 popd popd diff --git a/docs/source/conf.py b/docs/source/conf.py index 1cc88f85..5776a420 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,6 +23,11 @@ for line in _f if line.startswith('version:')) version = '.'.join(release.split('.')[:2]) +# Read the Docs builds a tag from the release it names and every other version from a branch, +# which runs ahead of the latest release. The index page states which of the two it describes. +if os.environ.get('READTHEDOCS_VERSION_TYPE') == 'tag': + tags.add('release_docs') + # -- General configuration --------------------------------------------------- @@ -61,7 +66,7 @@ # -- Options for HTML output ------------------------------------------------- html_theme = 'pydata_sphinx_theme' -# The pages describe the development head, not a release, so the title carries no version number. +# The index page states the version the pages describe, so the title carries no version number. html_title = 'Nyxus' html_theme_options = { 'github_url': 'https://github.com/PolusAI/nyxus', diff --git a/docs/source/devguide.rst b/docs/source/devguide.rst index 9b740ba7..6e42e8ae 100644 --- a/docs/source/devguide.rst +++ b/docs/source/devguide.rst @@ -1214,8 +1214,11 @@ Documentation ------------- The documentation is a Sphinx site in ``docs/source``. It does not need the compiled module: -``conf.py`` mocks ``nyxus.backend``. The pages describe the development head, so their title -carries no version number. +``conf.py`` mocks ``nyxus.backend``. The title carries no version number; the index page states +the version instead. ``conf.py`` reads the latest release from ``CITATION.cff`` into ``|release|``. +A Read the Docs build of a tag (``READTHEDOCS_VERSION_TYPE=tag``) says it describes that release, +and every other build, a local one included, says it describes the development version newer than +it. Building ^^^^^^^^ diff --git a/docs/source/index.rst b/docs/source/index.rst index 0ea88ac2..94e8d52f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -7,6 +7,17 @@ volumes and 6 image quality features. It runs from the command line or from Pyth TIFF, OME-TIFF, OME-Zarr, NIfTI and DICOM files (OME-TIFF and OME-Zarr with up to five dimensions), and assembles ROIs that span several image tiles. +.. only:: release_docs + + This documentation describes Nyxus |release|. + +.. only:: not release_docs + + This documentation describes the development version of Nyxus on the ``main`` branch, which + is newer than the latest release, |release|. Features and options added since |release| are + not in the packages on PyPI and conda-forge until the next release; :doc:`release_notes` lists + what each release contains. + ROIs larger than the memory budget are processed out of core when they come from files; which features then keep their in-memory values is listed under :ref:`large-images`. diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 735b7349..753853f8 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -39,9 +39,6 @@ The PyPI wheels are built for CPython 3.10, 3.11, 3.12 and 3.13 on these platfor PyPI has no source distribution, so where no wheel fits, ``pip`` falls back to an older release without a warning, or stops with ``No matching distribution found for nyxus``: -* Release 0.11.0 has no wheel for CPython 3.13 on Linux x86_64, so ``pip install nyxus`` installs - 0.10.0 there. Use Python 3.10 to 3.12, conda-forge or a source build to get 0.11.0. This is a known - issue (`#525 `__). * On Linux with a glibc older than 2.28 (for example CentOS 7 or Ubuntu 18.04), ``pip`` installs 0.8.3, the last release built for ``manylinux2014``, on x86_64 with Python 3.8 to 3.12, and an even older release with Python 3.6 or 3.7. With Python 3.13 or on aarch64 it stops with ``No @@ -82,7 +79,7 @@ output, in addition to TIFF, OME-TIFF and NIfTI. They also read OME-Zarr and com * The Windows wheels on PyPI (``nyxus`` 0.9.3 and 0.11.0, and ``nyxus-cuda12x`` 0.9.3) were built without OME-Zarr support, and so without ``.nii.gz``: they refuse OME-Zarr and fail on - ``.nii.gz`` files. This is a known issue (`#527 `__). + ``.nii.gz`` files. The ``nyxus`` Windows wheels of 0.12.0 and later read both. * The first conda-forge Windows builds of 0.11.0 (build number 0, a build string ending in ``_0`` in ``conda list nyxus``) read none of OME-Zarr, ``.nii.gz`` and DICOM; conda installs one of them into an environment that holds ``libarrow`` 19 or 20. @@ -92,8 +89,8 @@ libraries it finds (see `Building from source`_). .. warning:: - The conda-forge Windows packages of 0.11.0 were built in Debug mode: their extension module - imports the Visual Studio debug runtime (``MSVCP140D.dll``, ``VCRUNTIME140D.dll``, + The conda-forge Windows packages of 0.11.0, 0.12.0 and 0.12.1 were built in Debug mode: their + extension module imports the Visual Studio debug runtime (``MSVCP140D.dll``, ``VCRUNTIME140D.dll``, ``ucrtbased.dll``), which only an installation of Visual Studio provides, not the Visual C++ redistributable. Without Visual Studio, ``import nyxus`` fails. This is a known issue (`#528 `__). @@ -337,10 +334,6 @@ Getting the dependencies uses for ``.zip`` files. The script does not stop when a step fails, so check its output for errors before building. - The script's Boost download, in its OME-Zarr part, currently fails: the URL returns HTTP - 404. The Windows release wheels built with the script since 0.9.3 have no OME-Zarr support. - This is a known issue (`#527 `__). - The dependency DLLs in ``local_install\bin`` must be on ``PATH`` when you run the command-line program. Python does not search ``PATH`` for an extension module's DLLs, so in Python call ``os.add_dll_directory(r"\local_install\bin")`` before @@ -403,6 +396,11 @@ CMake options - ``OFF`` - Turns ``USE_Z5``, ``USE_DCMTK`` and ``USE_ARROW`` on. It takes precedence over ``NOEXTRAS``. ``setup.py`` always passes it. + * - ``REQUIRE_ALLEXTRAS`` + - ``OFF`` + - Stops the configure with an error when ``USE_Z5``, ``USE_DCMTK`` or ``USE_ARROW`` is off. + Without it, a part whose libraries are missing is dropped with a warning. The ``nyxus`` + wheels on PyPI are built with it; the ``nyxus-cuda11x`` and ``nyxus-cuda12x`` wheels are not. * - ``USE_Z5`` - ``OFF`` - OME-Zarr input. Also enables compressed NIfTI (``.nii.gz``), which needs the zlib that this diff --git a/docs/source/supported_formats.rst b/docs/source/supported_formats.rst index 90708f66..e890b7a7 100644 --- a/docs/source/supported_formats.rst +++ b/docs/source/supported_formats.rst @@ -37,7 +37,7 @@ run with that error. OME-Zarr and DICOM support are optional parts of a source build (see the CMake options in :doc:`installation`). The PyPI and conda packages include both, except that the Windows wheels -on PyPI have no OME-Zarr support since 0.9.3, and the first conda-forge Windows builds of +on PyPI of 0.9.3 and 0.11.0 have no OME-Zarr support, and the first conda-forge Windows builds of 0.11.0 (build number 0) have neither. Reading ``.nii.gz`` needs zlib, which a build includes together with OME-Zarr support, so those packages do not read ``.nii.gz`` either. diff --git a/docs/source/troubleshooting.rst b/docs/source/troubleshooting.rst index f1591509..7cf4bc22 100644 --- a/docs/source/troubleshooting.rst +++ b/docs/source/troubleshooting.rst @@ -150,8 +150,8 @@ A build without an optional part refuses its files or outputs: available. Please install Nyxus with Arrow enabled to use this functionality.`` and the call raises ``RuntimeError``. -The PyPI and conda packages include all of them, except that the Windows wheels on PyPI have no -OME-Zarr support since 0.9.3 (see :doc:`installation`). The first conda-forge Windows builds of +The PyPI and conda packages include all of them, except that the Windows wheels on PyPI of 0.9.3 +and 0.11.0 have no OME-Zarr support (see :doc:`installation`). The first conda-forge Windows builds of 0.11.0 (build number 0) also lack OME-Zarr, ``.nii.gz`` and DICOM; conda installs one of them into an environment that holds ``libarrow`` 19 or 20. :ref:`installation-check` shows how to check a build.