Skip to content

Commit ab2d3e5

Browse files
Merge branch 'MTG:master' into master
2 parents c22afe7 + 17484ff commit ab2d3e5

File tree

66 files changed

+1546
-727
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1546
-727
lines changed

.github/workflows/build-wheels-cibuildwheel.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ jobs:
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
os: [ubuntu-20.04, macos-12, macos-14]
12-
config: [pyproject, pyproject-tensorflow]
11+
os: [ubuntu-22.04, macos-13, macos-15]
12+
config: [cibuildwheel, cibuildwheel-tensorflow]
1313

1414
steps:
1515
- uses: actions/checkout@v4
@@ -21,7 +21,7 @@ jobs:
2121
run: git fetch --tags --force
2222

2323
- name: Build wheels
24-
uses: pypa/cibuildwheel@v2.16.5
24+
uses: pypa/cibuildwheel@v2.23.2
2525
with:
2626
config-file: ${{ matrix.config }}.toml
2727

FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ The most important test is the basetest, it should never fail:
230230
./build/basetest
231231
```
232232

233-
Run all Python tests:
233+
Run all Python tests (all Essentia algorithms, including based on TensorFlow):
234234
```
235235
python3 waf run_python_tests
236236
```

cibuildwheel-tensorflow.toml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
[tool.cibuildwheel.linux]
2+
3+
manylinux-x86_64-image = "mtgupf/essentia-builds:manylinux2014_x86_64"
4+
5+
# Only support x86_64 for essentia-tensorflow.
6+
build = "cp**-manylinux_x86_64"
7+
8+
skip = ["pp*", "*-musllinux*", "*i686", "*cp36*", "*cp37*", "*cp38*"]
9+
10+
environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1 }
11+
12+
before-all = [
13+
"PYBIN=/opt/python/cp36-cp36m/bin/",
14+
"\"${PYBIN}/python\" waf configure --with-gaia --with-tensorflow --build-static --static-dependencies --pkg-config-path=\"${PKG_CONFIG_PATH}\"",
15+
"\"${PYBIN}/python\" waf",
16+
"\"${PYBIN}/python\" waf install",
17+
# Monkey-patch package name.
18+
# We could have a separate pyproject.toml configuration, but the build backend does not accept custom configuration filepaths.
19+
"sed 's/^name *= *\"essentia\"$/name = \"essentia-tensorflow\"/' pyproject.toml > pyproject.toml.patched && mv pyproject.toml.patched pyproject.toml"
20+
]
21+
22+
test-command = "python -c 'import essentia; import essentia.standard; import essentia.streaming; from essentia.standard import MonoLoader, MetadataReader, YamlInput, Chromaprinter, TensorflowPredict'"
23+
24+
25+
[tool.cibuildwheel.macos]
26+
27+
skip = ["pp*", "*cp36*", "*cp37*", "*cp38*"]
28+
29+
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 }
30+
31+
before-all = [
32+
"brew install pkg-config gcc readline sqlite gdbm freetype libpng",
33+
"brew install eigen libyaml fftw ffmpeg@2.8 libsamplerate libtag",
34+
"brew link --force ffmpeg@2.8",
35+
"brew install chromaprint",
36+
"brew link --overwrite ffmpeg@2.8",
37+
# Delocate checks for the min OS version (LC_BUILD_VERSION or C_VERSION_MIN_MACOSX).
38+
# Tensorflow bottle a has minimum target of 14.2 which is too new.
39+
# We could build from source as a workaround, however, it takes too much time on the CI worker.
40+
# To keep it simple, just use the bottles available for tensorflow.
41+
"brew install tensorflow",
42+
# ---
43+
# Building tensorflow from source:
44+
#"echo Checking available SDKs:",
45+
#"xcodebuild -showsdks",
46+
#"SDKROOT=$(xcrun --sdk macosx13.0 --show-sdk-path) brew install --build-from-source tensorflow",
47+
# ---
48+
# Override VIRTUAL_ENV set by cibuildwheel to ensure global install
49+
"VIRTUAL_ENV=/usr/local python waf configure --with-tensorflow --pkg-config-path=\"${PKG_CONFIG_PATH}\"",
50+
"python waf",
51+
"python waf install",
52+
# Monkey-patch package name.
53+
# We could have a separate pyproject.toml configuration, but the build backend does not accept custom configuration filepaths.
54+
"sed 's/^name *= *\"essentia\"$/name = \"essentia-tensorflow\"/' pyproject.toml > pyproject.toml.patched && mv pyproject.toml.patched pyproject.toml"
55+
]
56+
57+
# FIXME Temporarily disable testing on macos-13 runner. The wheel is tagged as macosx_14_2 due to the Tensorflow dependency, so it can't be installed by pip ("not a supported wheel on this platform").
58+
#test-command = "python -c 'import essentia; import essentia.standard; import essentia.streaming; from essentia.standard import MonoLoader, MetadataReader, YamlInput, Chromaprinter, TensorflowPredict'"
59+
60+
61+
[[tool.cibuildwheel.overrides]]
62+
select = "*macosx_arm64*"
63+
64+
skip = ["pp*", "*cp36*", "*cp37*", "*cp38*"]
65+
66+
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 }
67+
68+
before-all = [
69+
"brew install pkg-config gcc readline sqlite gdbm libpng",
70+
"brew install eigen libyaml fftw ffmpeg@2.8 libsamplerate libtag",
71+
"brew link --force ffmpeg@2.8",
72+
"brew install chromaprint",
73+
"brew link --overwrite ffmpeg@2.8",
74+
# Delocate checks for the min OS version (LC_BUILD_VERSION or C_VERSION_MIN_MACOSX).
75+
# Tensorflow bottle a has minimum target of 15.2 which is too new.
76+
# We could build from source as a workaround, however, it takes too much time on the CI worker.
77+
# To keep it simple, just use the bottles available for tensorflow.
78+
"brew install tensorflow",
79+
# ---
80+
# Building tensorflow from source:
81+
#"echo Checking available SDKs:",
82+
#"xcodebuild -showsdks",
83+
#"SDKROOT=$(xcrun --sdk macosx14.0 --show-sdk-path) brew install --build-from-source tensorflow",
84+
# ---
85+
# Override VIRTUAL_ENV set by cibuildwheel to ensure global install
86+
"VIRTUAL_ENV=/usr/local python waf configure --with-tensorflow --pkg-config-path=\"${PKG_CONFIG_PATH}\" --arch arm64 --no-msse",
87+
"python waf",
88+
"sudo python waf install",
89+
# Monkey-patch package name.
90+
# We could have a separate pyproject.toml configuration, but the build backend does not accept custom configuration filepaths.
91+
"sed 's/^name *= *\"essentia\"$/name = \"essentia-tensorflow\"/' pyproject.toml > pyproject.toml.patched && mv pyproject.toml.patched pyproject.toml"
92+
]
93+
94+
# On Mac arm64, libavcodec.56.60.100, libavformat.56.40.101 and
95+
# libavutil.54.31.100, depend on libSDL1.2-compat, which is a compatibility
96+
# layer for SDL2. libSDL1.2-compat expects SDL2 to be installed in the default
97+
# brew location (i.e., /opt/homebrew/opt/sdl2/lib), so the user would need to
98+
# install it via brew manually. Alternativelly, we can manualy copy the SDL2
99+
# libs into the wheel. This is a temporary solution, and in the long term we
100+
# should move to FFmpeg > 2.X.
101+
repair-wheel-command = [
102+
"delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}",
103+
"mkdir -p {dest_dir}/essentia/.dylibs",
104+
"cp /opt/homebrew/opt/sdl2/lib/libSDL2*.dylib {dest_dir}/essentia/.dylibs",
105+
"wheel_rel=$(echo {wheel} | grep -o '[^/]*$')",
106+
"cd {dest_dir} && zip -u {dest_dir}/$wheel_rel essentia/.dylibs/*"
107+
]
Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,60 @@
1-
[tool.cibuildwheel.linux]
1+
[tool.cibuildwheel]
22

3+
[tool.cibuildwheel.linux]
34
manylinux-x86_64-image = "mtgupf/essentia-builds:manylinux2014_x86_64"
5+
manylinux-i686-image = "mtgupf/essentia-builds:manylinux2014_i686"
46

5-
# Only support x86_64 for essentia-tensorflow
6-
build = "cp**-manylinux_x86_64"
7-
# TODO: skipping Python 3.12 for now until we create manylinux images supporting this version.
8-
skip = ["pp*", "*-musllinux*", "*i686", "*cp312*"]
7+
skip = ["pp*", "*-musllinux*", "*i686", "*cp36*", "*cp37*", "*cp38*"]
98

10-
environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1 }
9+
environment = { PROJECT_NAME="essentia", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1 }
1110

12-
before-build = [
11+
before-all = [
1312
"PYBIN=/opt/python/cp36-cp36m/bin/",
14-
"\"${PYBIN}/python\" waf configure --with-gaia --with-tensorflow --build-static --static-dependencies --pkg-config-path=\"${PKG_CONFIG_PATH}\"",
13+
"\"${PYBIN}/python\" waf configure --with-gaia --build-static --static-dependencies --pkg-config-path=\"${PKG_CONFIG_PATH}\"",
1514
"\"${PYBIN}/python\" waf",
1615
"\"${PYBIN}/python\" waf install"
1716
]
1817

19-
test-command = "python -c 'import essentia; import essentia.standard; import essentia.streaming; from essentia.standard import MonoLoader, MetadataReader, YamlInput, Chromaprinter, TensorflowPredict'"
18+
test-command = "python -c 'import essentia; import essentia.standard; import essentia.streaming; from essentia.standard import MonoLoader, MetadataReader, YamlInput, Chromaprinter'"
2019

2120

2221
[tool.cibuildwheel.macos]
2322

24-
skip = ["pp*"]
23+
skip = ["pp*", "*cp36*", "*cp37*", "*cp38*"]
2524

26-
environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1 }
25+
environment = { PROJECT_NAME="essentia", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, MACOSX_DEPLOYMENT_TARGET=13.0 }
2726

28-
before-build = [
27+
before-all = [
2928
"brew install pkg-config gcc readline sqlite gdbm freetype libpng",
3029
"brew install eigen libyaml fftw ffmpeg@2.8 libsamplerate libtag",
3130
"brew link --force ffmpeg@2.8",
3231
"brew install chromaprint",
3332
"brew link --overwrite ffmpeg@2.8",
34-
"brew install tensorflow",
3533
#"brew tap MTG/essentia",
3634
#"brew install gaia --HEAD",
37-
"python waf configure --with-tensorflow --pkg-config-path=\"${PKG_CONFIG_PATH}\"",
35+
# Override VIRTUAL_ENV set by cibuildwheel to ensure global install
36+
"VIRTUAL_ENV=/usr/local python waf configure --pkg-config-path=\"${PKG_CONFIG_PATH}\"",
3837
"python waf",
3938
"python waf install"
4039
]
4140

42-
test-command = "python -c 'import essentia; import essentia.standard; import essentia.streaming; from essentia.standard import MonoLoader, MetadataReader, YamlInput, Chromaprinter, TensorflowPredict'"
43-
41+
test-command = "python -c 'import essentia; import essentia.standard; import essentia.streaming; from essentia.standard import MonoLoader, MetadataReader, YamlInput, Chromaprinter'"
4442

4543
[[tool.cibuildwheel.overrides]]
4644
select = "*macosx_arm64*"
4745

48-
skip = ["pp*"]
46+
skip = ["pp*", "*cp36*", "*cp37*", "*cp38*"]
4947

50-
environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, ESSENTIA_MACOSX_ARM64=1 }
48+
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 }
5149

52-
before-build = [
50+
before-all = [
5351
"brew install pkg-config gcc readline sqlite gdbm libpng",
5452
"brew install eigen libyaml fftw ffmpeg@2.8 libsamplerate libtag",
5553
"brew link --force ffmpeg@2.8",
5654
"brew install chromaprint",
5755
"brew link --overwrite ffmpeg@2.8",
58-
"brew install tensorflow",
59-
"python waf configure --with-tensorflow --pkg-config-path=\"${PKG_CONFIG_PATH}\" --arch arm64 --no-msse",
56+
# Override VIRTUAL_ENV set by cibuildwheel to ensure global install
57+
"VIRTUAL_ENV=/usr/local python waf configure --pkg-config-path=\"${PKG_CONFIG_PATH}\" --arch arm64 --no-msse",
6058
"python waf",
6159
"sudo python waf install",
6260
]
@@ -75,7 +73,3 @@ repair-wheel-command = [
7573
"wheel_rel=$(echo {wheel} | grep -o '[^/]*$')",
7674
"cd {dest_dir} && zip -u {dest_dir}/$wheel_rel essentia/.dylibs/*"
7775
]
78-
79-
[build-system]
80-
81-
requires = ["wheel", "setuptools", "oldest-supported-numpy"]

doc/sphinxdoc/download.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ Releases
1010

1111
* `Essentia docker images <https://hub.docker.com/r/mtgupf/essentia/>`_
1212

13-
* `Manylinux Python wheels <https://pypi.org/project/essentia/>`_ (Linux)
13+
* `Python wheels <https://pypi.org/project/essentia/>`_ (Linux, MacOS)
14+
15+
* `Python wheels with TensorFlow support <https://pypi.org/project/essentia-tensorflow/>`_ (Linux, MacOS)
1416

1517
* Precompiled `extractor binaries <https://mtg.github.io/essentia-labs/news/2015/12/22/static-binaries-for-extractors/>`_ (Linux, OSX, Win)
1618

@@ -23,7 +25,7 @@ Development branch
2325

2426
* The latest updates are available in the `master branch <https://github.com/MTG/essentia/tree/master/>`_.
2527

26-
* The latest development builds of Python wheels are available `here <https://owncloud.rp.upf.edu/index.php/s/TpwgF4XrZEpBTOI>`_ (Linux).
28+
* The latest development builds of Python wheels are available `here <https://github.com/MTG/essentia/actions/workflows/build-wheels-cibuildwheel.yml>`_ (Linux, MacOS).
2729

2830

2931

0 commit comments

Comments
 (0)