diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 903cafc8e..e2a0748af 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -8,43 +8,45 @@ on: - master jobs: build-docs: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 + - name: Fetch release tags from GitHub # Workaround for https://github.com/actions/checkout/issues/290 run: git fetch --tags --force - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y build-essential libeigen3-dev libyaml-dev libfftw3-dev libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libsamplerate0-dev libtag1-dev libchromaprint-dev python3-dev python3-numpy-dev python3-numpy python3-yaml python3-six - sudo apt-get install -y doxygen python3-pip pandoc - pip3 install sphinx pyparsing sphinxcontrib-doxylink docutils jupyter sphinx-toolbox nbformat gitpython sphinx-copybutton - # Install TensorFlow - sudo sh src/3rdparty/tensorflow/setup_from_libtensorflow.sh - # Install Gaia dependencies - sudo apt-get install qtbase5-dev swig pkg-config - - name: Build Gaia + + - name: Build Essentia and documentation + # Run inside the same image used by cibuildwheel.toml so the + # docs are generated against the same toolchain and static deps as the + # published wheels. We invoke Docker manually (rather than via the job's + # `container:`) because manylinux2014 ships glibc 2.17, which is too old + # for the Node 20 runtime that GitHub Actions injects into containers. run: | - git clone https://github.com/MTG/gaia.git - cd gaia - python3 waf configure --with-python-bindings - python3 waf - sudo python3 waf install + docker run --rm \ + -v "${PWD}:/project" \ + -w /project \ + mtgupf/essentia-builds:manylinux2014_x86_64 \ + bash -euxc ' + # Repo is bind-mounted from the host runner; container runs as + # root, so git refuses to touch it without this exception. + git config --global --add safe.directory /project - - name: Build Essentia - run: | - python3 waf configure --with-python --with-gaia --with-tensorflow - python3 waf + python3 -m pip install --upgrade pip + python3 -m pip install sphinx pyparsing sphinxcontrib-doxylink docutils jupyter sphinx-toolbox nbformat gitpython sphinx-copybutton + yum install -y doxygen pandoc + + python3 waf configure --with-python --with-gaia --with-tensorflow --build-static --static-dependencies --pkg-config-path="${PKG_CONFIG_PATH}" + python3 waf + python3 waf install + python3 waf doc + ' - - name: Build documentation - run: | - python3 waf doc - name: Upload built documentation - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: essentia-docs path: | diff --git a/.github/workflows/build-wheels-cibuildwheel.yml b/.github/workflows/build-wheels-cibuildwheel.yml index 117c88364..88327885c 100644 --- a/.github/workflows/build-wheels-cibuildwheel.yml +++ b/.github/workflows/build-wheels-cibuildwheel.yml @@ -8,11 +8,11 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, macos-13, macos-15] + os: [ubuntu-24.04, macos-15-intel, macos-15] config: [cibuildwheel, cibuildwheel-tensorflow] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -21,11 +21,11 @@ jobs: run: git fetch --tags --force - name: Build wheels - uses: pypa/cibuildwheel@v2.23.2 + uses: pypa/cibuildwheel@v3.2.1 with: config-file: ${{ matrix.config }}.toml - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v6 with: path: ./wheelhouse/*.whl name: artifact-${{ matrix.os }}-${{ matrix.config }} diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 6f7ddbe57..438d0c9e6 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -32,16 +32,16 @@ jobs: PRE_CMD: ${{ matrix.PRE_CMD }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Fetch release tags from GitHub # Workaround for https://github.com/actions/checkout/issues/290 run: git fetch --tags --force - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: - python-version: 3.8 + python-version: '3.12' - name: Build wheels in a Docker image run: | docker pull $DOCKER_IMAGE > /dev/null @@ -51,7 +51,7 @@ jobs: ls wheelhouse/ sudo python setup.py sdist - name: Upload wheels and sdist - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: essentia-python-wheels path: | diff --git a/cibuildwheel-tensorflow.toml b/cibuildwheel-tensorflow.toml index 1fc9bff57..c58176cf8 100644 --- a/cibuildwheel-tensorflow.toml +++ b/cibuildwheel-tensorflow.toml @@ -5,15 +5,22 @@ manylinux-x86_64-image = "mtgupf/essentia-builds:manylinux2014_x86_64" # Only support x86_64 for essentia-tensorflow. build = "cp**-manylinux_x86_64" -skip = ["pp*", "*-musllinux*", "*i686", "*cp36*", "*cp37*", "*cp38*"] +# Skip selectors: +# - cp38: project does not target Python 3.8. +# - *t-*: free-threaded (no-GIL) builds. The Essentia C bindings rely on +# legacy PyTypeObject definitions that fail to instantiate under +# cp313t/cp314t ("Type does not define the tp_name field"). Re-enable +# once the bindings are audited for free-threading compatibility. +# - *-musllinux*, *i686: not supported by our manylinux2014 build images. +skip = ["*cp38*", "*t-*", "*-musllinux*", "*i686"] environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1 } +# Use system's Python3 to build Essentia. before-all = [ - "PYBIN=/opt/python/cp36-cp36m/bin/", - "\"${PYBIN}/python\" waf configure --with-gaia --with-tensorflow --build-static --static-dependencies --pkg-config-path=\"${PKG_CONFIG_PATH}\"", - "\"${PYBIN}/python\" waf", - "\"${PYBIN}/python\" waf install", + "python3 waf configure --with-gaia --with-tensorflow --build-static --static-dependencies --pkg-config-path=\"${PKG_CONFIG_PATH}\"", + "python3 waf", + "python3 waf install", # Monkey-patch package name. # We could have a separate pyproject.toml configuration, but the build backend does not accept custom configuration filepaths. "sed 's/^name *= *\"essentia\"$/name = \"essentia-tensorflow\"/' pyproject.toml > pyproject.toml.patched && mv pyproject.toml.patched pyproject.toml" @@ -24,18 +31,17 @@ test-command = "python -c 'import essentia; import essentia.standard; import ess [tool.cibuildwheel.macos] -skip = ["pp*", "*cp36*", "*cp37*", "*cp38*"] +# See linux section for skip rationale. +skip = ["*cp38*", "*t-*"] -environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, MACOSX_DEPLOYMENT_TARGET=14.2 } +environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, MACOSX_DEPLOYMENT_TARGET=15.2 } before-all = [ "brew install pkg-config gcc readline sqlite gdbm freetype libpng", - "brew install eigen libyaml fftw ffmpeg@2.8 libsamplerate libtag", - "brew link --force ffmpeg@2.8", + "brew install eigen libyaml fftw ffmpeg libsamplerate libtag", "brew install chromaprint", - "brew link --overwrite ffmpeg@2.8", # Delocate checks for the min OS version (LC_BUILD_VERSION or C_VERSION_MIN_MACOSX). - # Tensorflow bottle a has minimum target of 14.2 which is too new. + # Tensorflow bottle has a minimum target of 15.2 which is too new. # We could build from source as a workaround, however, it takes too much time on the CI worker. # To keep it simple, just use the bottles available for tensorflow. "brew install tensorflow", @@ -61,18 +67,17 @@ before-all = [ [[tool.cibuildwheel.overrides]] select = "*macosx_arm64*" -skip = ["pp*", "*cp36*", "*cp37*", "*cp38*"] +# See linux section for skip rationale. +skip = ["*cp38*", "*t-*"] -environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, ESSENTIA_MACOSX_ARM64=1, MACOSX_DEPLOYMENT_TARGET=15.2 } +environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, ESSENTIA_MACOSX_ARM64=1, MACOSX_DEPLOYMENT_TARGET=15.4 } before-all = [ "brew install pkg-config gcc readline sqlite gdbm libpng", - "brew install eigen libyaml fftw ffmpeg@2.8 libsamplerate libtag", - "brew link --force ffmpeg@2.8", + "brew install eigen libyaml fftw ffmpeg libsamplerate libtag", "brew install chromaprint", - "brew link --overwrite ffmpeg@2.8", # Delocate checks for the min OS version (LC_BUILD_VERSION or C_VERSION_MIN_MACOSX). - # Tensorflow bottle a has minimum target of 15.2 which is too new. + # Tensorflow bottle has a minimum target of 15.4 which is too new. # We could build from source as a workaround, however, it takes too much time on the CI worker. # To keep it simple, just use the bottles available for tensorflow. "brew install tensorflow", diff --git a/cibuildwheel.toml b/cibuildwheel.toml index 6c2c28791..b51717c56 100644 --- a/cibuildwheel.toml +++ b/cibuildwheel.toml @@ -4,15 +4,22 @@ manylinux-x86_64-image = "mtgupf/essentia-builds:manylinux2014_x86_64" manylinux-i686-image = "mtgupf/essentia-builds:manylinux2014_i686" -skip = ["pp*", "*-musllinux*", "*i686", "*cp36*", "*cp37*", "*cp38*"] +# Skip selectors: +# - cp38: project does not target Python 3.8. +# - *t-*: free-threaded (no-GIL) builds. The Essentia C bindings rely on +# legacy PyTypeObject definitions that fail to instantiate under +# cp313t/cp314t ("Type does not define the tp_name field"). Re-enable +# once the bindings are audited for free-threading compatibility. +# - *-musllinux*, *i686: not supported by our manylinux2014 build images. +skip = ["*cp38*", "*t-*", "*-musllinux*", "*i686"] environment = { PROJECT_NAME="essentia", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1 } +# Use system's Python3 to build Essentia. before-all = [ - "PYBIN=/opt/python/cp36-cp36m/bin/", - "\"${PYBIN}/python\" waf configure --with-gaia --build-static --static-dependencies --pkg-config-path=\"${PKG_CONFIG_PATH}\"", - "\"${PYBIN}/python\" waf", - "\"${PYBIN}/python\" waf install" + "python3 waf configure --with-gaia --build-static --static-dependencies --pkg-config-path=\"${PKG_CONFIG_PATH}\"", + "python3 waf", + "python3 waf install", ] test-command = "python -c 'import essentia; import essentia.standard; import essentia.streaming; from essentia.standard import MonoLoader, MetadataReader, YamlInput, Chromaprinter'" @@ -20,16 +27,14 @@ test-command = "python -c 'import essentia; import essentia.standard; import ess [tool.cibuildwheel.macos] -skip = ["pp*", "*cp36*", "*cp37*", "*cp38*"] +# See linux section for skip rationale. +skip = ["*cp38*", "*t-*"] -environment = { PROJECT_NAME="essentia", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, MACOSX_DEPLOYMENT_TARGET=13.0 } +environment = { PROJECT_NAME="essentia", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, MACOSX_DEPLOYMENT_TARGET=15.0 } before-all = [ "brew install pkg-config gcc readline sqlite gdbm freetype libpng", - "brew install eigen libyaml fftw ffmpeg@2.8 libsamplerate libtag", - "brew link --force ffmpeg@2.8", - "brew install chromaprint", - "brew link --overwrite ffmpeg@2.8", + "brew install eigen libyaml fftw ffmpeg libsamplerate libtag chromaprint", #"brew tap MTG/essentia", #"brew install gaia --HEAD", # Override VIRTUAL_ENV set by cibuildwheel to ensure global install @@ -43,16 +48,14 @@ test-command = "python -c 'import essentia; import essentia.standard; import ess [[tool.cibuildwheel.overrides]] select = "*macosx_arm64*" -skip = ["pp*", "*cp36*", "*cp37*", "*cp38*"] +# See linux section for skip rationale. +skip = ["*cp38*", "*t-*"] environment = { PROJECT_NAME="essentia", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, ESSENTIA_MACOSX_ARM64=1, MACOSX_DEPLOYMENT_TARGET=15.0 } before-all = [ "brew install pkg-config gcc readline sqlite gdbm libpng", - "brew install eigen libyaml fftw ffmpeg@2.8 libsamplerate libtag", - "brew link --force ffmpeg@2.8", - "brew install chromaprint", - "brew link --overwrite ffmpeg@2.8", + "brew install eigen libyaml fftw ffmpeg libsamplerate libtag chromaprint", # Override VIRTUAL_ENV set by cibuildwheel to ensure global install "VIRTUAL_ENV=/usr/local python waf configure --pkg-config-path=\"${PKG_CONFIG_PATH}\" --arch arm64 --no-msse", "python waf", diff --git a/wscript b/wscript index a48d304c8..5cb65d590 100644 --- a/wscript +++ b/wscript @@ -47,7 +47,7 @@ def options(ctx): help='debug, release or default') ctx.add_option('--std', action='store', - dest='STD', default='c++11', + dest='STD', default='c++14', help='C++ standard to compile for [c++11 c++14 c++17 ...]') ctx.add_option('--arch', action='store',