Closed niccolomineo closed 9 months ago
I have the same error message. I'm on Mac with Intel chip
Collecting spotfire
Using cached spotfire-2.1.1.tar.gz (70 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy<2.0,>=1.21 in ./venv/lib/python3.11/site-packages (from spotfire) (1.24.2)
Requirement already satisfied: pandas!=1.0.2,!=1.0.3,>=0.24.0 in ./venv/lib/python3.11/site-packages (from spotfire) (2.0.1)
Requirement already satisfied: pip in ./venv/lib/python3.11/site-packages (from spotfire) (23.3.1)
Requirement already satisfied: python-dateutil in ./venv/lib/python3.11/site-packages (from spotfire) (2.8.2)
Requirement already satisfied: pytz in ./venv/lib/python3.11/site-packages (from spotfire) (2022.7.1)
Requirement already satisfied: setuptools in ./venv/lib/python3.11/site-packages (from spotfire) (68.2.2)
Requirement already satisfied: six in ./venv/lib/python3.11/site-packages (from spotfire) (1.16.0)
Requirement already satisfied: wheel in ./venv/lib/python3.11/site-packages (from spotfire) (0.41.2)
Requirement already satisfied: tzdata>=2022.1 in ./venv/lib/python3.11/site-packages (from pandas!=1.0.2,!=1.0.3,>=0.24.0->spotfire) (2022.5)
Building wheels for collected packages: spotfire
Building wheel for spotfire (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for spotfire (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [79 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-14.0-x86_64-cpython-311
creating build/lib.macosx-14.0-x86_64-cpython-311/spotfire
copying spotfire/public.py -> build/lib.macosx-14.0-x86_64-cpython-311/spotfire
copying spotfire/version.py -> build/lib.macosx-14.0-x86_64-cpython-311/spotfire
copying spotfire/spk.py -> build/lib.macosx-14.0-x86_64-cpython-311/spotfire
copying spotfire/__init__.py -> build/lib.macosx-14.0-x86_64-cpython-311/spotfire
copying spotfire/data_function.py -> build/lib.macosx-14.0-x86_64-cpython-311/spotfire
copying spotfire/_utils.py -> build/lib.macosx-14.0-x86_64-cpython-311/spotfire
running egg_info
writing spotfire.egg-info/PKG-INFO
writing dependency_links to spotfire.egg-info/dependency_links.txt
writing requirements to spotfire.egg-info/requires.txt
writing top-level names to spotfire.egg-info/top_level.txt
reading manifest file 'spotfire.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*' found under directory 'spotfire/test'
warning: no previously-included files matching '*' found under directory 'venv'
warning: no previously-included files matching '*' found under directory '.github'
warning: no previously-included files found matching '.gitattributes'
warning: no previously-included files found matching '.gitignore'
warning: no previously-included files found matching '.whitesource*'
adding license file 'LICENSE'
writing manifest file 'spotfire.egg-info/SOURCES.txt'
copying spotfire/cabfile.pyx -> build/lib.macosx-14.0-x86_64-cpython-311/spotfire
copying spotfire/cabfile_helpers.c -> build/lib.macosx-14.0-x86_64-cpython-311/spotfire
copying spotfire/codesign.pyx -> build/lib.macosx-14.0-x86_64-cpython-311/spotfire
copying spotfire/requirements.txt -> build/lib.macosx-14.0-x86_64-cpython-311/spotfire
copying spotfire/sbdf.pyx -> build/lib.macosx-14.0-x86_64-cpython-311/spotfire
copying spotfire/sbdf_helpers.c -> build/lib.macosx-14.0-x86_64-cpython-311/spotfire
running build_ext
cythoning spotfire/cabfile.pyx to build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire/cabfile.c
creating build/temp.macosx-14.0-x86_64-cpython-311
creating build/temp.macosx-14.0-x86_64-cpython-311/pyrex
creating build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire
cythoning spotfire/codesign.pyx to build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire/codesign.c
cythoning spotfire/sbdf.pyx to build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire/sbdf.c
Error compiling Cython file:
------------------------------------------------------------
...
except ImportError:
PIL = None
### Various utility helper functions for doing things that are problematic in PYX files
include "sbdf_helpers.pxi"
^
------------------------------------------------------------
spotfire/sbdf.pyx:60:0: 'sbdf_helpers.pxi' not found
building 'spotfire.cabfile' extension
creating build/temp.macosx-14.0-x86_64-cpython-311/build
creating build/temp.macosx-14.0-x86_64-cpython-311/build/temp.macosx-14.0-x86_64-cpython-311
creating build/temp.macosx-14.0-x86_64-cpython-311/build/temp.macosx-14.0-x86_64-cpython-311/pyrex
creating build/temp.macosx-14.0-x86_64-cpython-311/build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire
creating build/temp.macosx-14.0-x86_64-cpython-311/spotfire
clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Ispotfire -Ibuild/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire -I/Users/pei/maroon-bells/venv/include -I/Users/pei/.pyenv/versions/3.11.6/include/python3.11 -c build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire/cabfile.c -o build/temp.macosx-14.0-x86_64-cpython-311/build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire/cabfile.o
clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Ispotfire -Ibuild/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire -I/Users/pei/maroon-bells/venv/include -I/Users/pei/.pyenv/versions/3.11.6/include/python3.11 -c spotfire/cabfile_helpers.c -o build/temp.macosx-14.0-x86_64-cpython-311/spotfire/cabfile_helpers.o
clang -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/pei/.pyenv/versions/3.11.6/lib -Wl,-rpath,/Users/pei/.pyenv/versions/3.11.6/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/pei/.pyenv/versions/3.11.6/lib -Wl,-rpath,/Users/pei/.pyenv/versions/3.11.6/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib build/temp.macosx-14.0-x86_64-cpython-311/build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire/cabfile.o build/temp.macosx-14.0-x86_64-cpython-311/spotfire/cabfile_helpers.o -L/Users/pei/.pyenv/versions/3.11.6/lib -o build/lib.macosx-14.0-x86_64-cpython-311/spotfire/cabfile.cpython-311-darwin.so
ld: warning: duplicate -rpath '/Users/pei/.pyenv/versions/3.11.6/lib' ignored
building 'spotfire.codesign' extension
clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Ibuild/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire -I/Users/pei/maroon-bells/venv/include -I/Users/pei/.pyenv/versions/3.11.6/include/python3.11 -c build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire/codesign.c -o build/temp.macosx-14.0-x86_64-cpython-311/build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire/codesign.o
clang -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/pei/.pyenv/versions/3.11.6/lib -Wl,-rpath,/Users/pei/.pyenv/versions/3.11.6/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/pei/.pyenv/versions/3.11.6/lib -Wl,-rpath,/Users/pei/.pyenv/versions/3.11.6/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib build/temp.macosx-14.0-x86_64-cpython-311/build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire/codesign.o -L/Users/pei/.pyenv/versions/3.11.6/lib -o build/lib.macosx-14.0-x86_64-cpython-311/spotfire/codesign.cpython-311-darwin.so
ld: warning: duplicate -rpath '/Users/pei/.pyenv/versions/3.11.6/lib' ignored
building 'spotfire.sbdf' extension
creating build/temp.macosx-14.0-x86_64-cpython-311/vendor
creating build/temp.macosx-14.0-x86_64-cpython-311/vendor/sbdf-c
creating build/temp.macosx-14.0-x86_64-cpython-311/vendor/sbdf-c/src
clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -DSBDF_STATIC -Ispotfire -Ivendor/sbdf-c/include -I/private/var/folders/lb/xzhllhrs1fv0m42y8x11k1mr0000gn/T/pip-build-env-33kcmbvm/overlay/lib/python3.11/site-packages/numpy/core/include -Ibuild/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire -I/Users/pei/maroon-bells/venv/include -I/Users/pei/.pyenv/versions/3.11.6/include/python3.11 -c build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire/sbdf.c -o build/temp.macosx-14.0-x86_64-cpython-311/build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire/sbdf.o
build/temp.macosx-14.0-x86_64-cpython-311/pyrex/spotfire/sbdf.c:1:2: error: Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for spotfire
Failed to build spotfire
ERROR: Could not build wheels for spotfire, which is required to install pyproject.toml-based projects
OK, I found the problem that was causing the errors. The sdist file was missing a few of the helper files from the Cython code that was introduced after the 1.8.x releases (starting with 2.0.x). Turns out I actually fixed the underlying problem during our update to the current Cython release (3.0, #47). I verified this using one of the sdists from the build
Actions workflow:
C:\tmp\>docker run -it --rm -v %CD%:/a -w /a python:3.12 bash
root@80819228a737:/a# pip install setuptools wheel cython oldest-supported-numpy
Requirement already satisfied: setuptools in /usr/local/lib/python3.12/site-packages (69.0.2)
Requirement already satisfied: wheel in /usr/local/lib/python3.12/site-packages (0.42.0)
Collecting cython
Obtaining dependency information for cython from https://files.pythonhosted.org/packages/94/58/a6ac4ce15ec4e4bd0e6d5b951d3b915bb8a817c272957c2abf92197ab1f2/Cython-3.0.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
Downloading Cython-3.0.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.2 kB)
Collecting oldest-supported-numpy
Obtaining dependency information for oldest-supported-numpy from https://files.pythonhosted.org/packages/dc/5c/e3c84cfdd488701aa074b22cf5bd227fb15d26e1d55a66d9088c39afa123/oldest_supported_numpy-2023.12.21-py3-none-any.whl.metadata
Downloading oldest_supported_numpy-2023.12.21-py3-none-any.whl.metadata (9.8 kB)
Collecting numpy==1.26.2 (from oldest-supported-numpy)
Obtaining dependency information for numpy==1.26.2 from https://files.pythonhosted.org/packages/04/89/3b831e2b50c9364069609d1335f46c488a149d5f2be14a08741c92a60009/numpy-1.26.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
Downloading numpy-1.26.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
???????????????????????????????????????? 61.2/61.2 kB 2.9 MB/s eta 0:00:00
Downloading Cython-3.0.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB)
???????????????????????????????????????? 3.5/3.5 MB 15.3 MB/s eta 0:00:00
Downloading oldest_supported_numpy-2023.12.21-py3-none-any.whl (4.9 kB)
Downloading numpy-1.26.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.9 MB)
???????????????????????????????????????? 17.9/17.9 MB 28.6 MB/s eta 0:00:00
Installing collected packages: numpy, cython, oldest-supported-numpy
Successfully installed cython-3.0.7 numpy-1.26.2 oldest-supported-numpy-2023.12.21
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[notice] A new release of pip is available: 23.2.1 -> 23.3.2
[notice] To update, run: pip install --upgrade pip
root@80819228a737:/a# pip install spotfire-2.2.0.dev0.tar.gz
Processing spotfire-2.2.0.dev0.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting pandas!=1.0.2,!=1.0.3,>=0.24.0 (from spotfire==2.2.0.dev0)
Obtaining dependency information for pandas!=1.0.2,!=1.0.3,>=0.24.0 from https://files.pythonhosted.org/packages/5b/5f/076b1ce74f80df0a9db244d30e30c4d4dee45342cbfa5f3e01f64cadf663/pandas-2.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
Downloading pandas-2.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (18 kB)
Requirement already satisfied: numpy<2.0,>=1.22 in /usr/local/lib/python3.12/site-packages (from spotfire==2.2.0.dev0) (1.26.2)
Collecting packaging (from spotfire==2.2.0.dev0)
Obtaining dependency information for packaging from https://files.pythonhosted.org/packages/ec/1a/610693ac4ee14fcdf2d9bf3c493370e4f2ef7ae2e19217d7a237ff42367d/packaging-23.2-py3-none-any.whl.metadata
Downloading packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
Requirement already satisfied: pip in /usr/local/lib/python3.12/site-packages (from spotfire==2.2.0.dev0) (23.2.1)
Requirement already satisfied: setuptools in /usr/local/lib/python3.12/site-packages (from spotfire==2.2.0.dev0) (69.0.2)
Requirement already satisfied: wheel in /usr/local/lib/python3.12/site-packages (from spotfire==2.2.0.dev0) (0.42.0)
Collecting python-dateutil>=2.8.2 (from pandas!=1.0.2,!=1.0.3,>=0.24.0->spotfire==2.2.0.dev0)
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
???????????????????????????????????????? 247.7/247.7 kB 6.6 MB/s eta 0:00:00
Collecting pytz>=2020.1 (from pandas!=1.0.2,!=1.0.3,>=0.24.0->spotfire==2.2.0.dev0)
Obtaining dependency information for pytz>=2020.1 from https://files.pythonhosted.org/packages/32/4d/aaf7eff5deb402fd9a24a1449a8119f00d74ae9c2efa79f8ef9994261fc2/pytz-2023.3.post1-py2.py3-none-any.whl.metadata
Downloading pytz-2023.3.post1-py2.py3-none-any.whl.metadata (22 kB)
Collecting tzdata>=2022.1 (from pandas!=1.0.2,!=1.0.3,>=0.24.0->spotfire==2.2.0.dev0)
Obtaining dependency information for tzdata>=2022.1 from https://files.pythonhosted.org/packages/a3/fb/52b62131e21b24ee297e4e95ed41eba29647dad0e0051a92bb66b43c70ff/tzdata-2023.4-py2.py3-none-any.whl.metadata
Downloading tzdata-2023.4-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting six>=1.5 (from python-dateutil>=2.8.2->pandas!=1.0.2,!=1.0.3,>=0.24.0->spotfire==2.2.0.dev0)
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Downloading pandas-2.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.7 MB)
???????????????????????????????????????? 11.7/11.7 MB 27.8 MB/s eta 0:00:00
Downloading packaging-23.2-py3-none-any.whl (53 kB)
???????????????????????????????????????? 53.0/53.0 kB 3.0 MB/s eta 0:00:00
Downloading pytz-2023.3.post1-py2.py3-none-any.whl (502 kB)
???????????????????????????????????????? 502.5/502.5 kB 23.2 MB/s eta 0:00:00
Downloading tzdata-2023.4-py2.py3-none-any.whl (346 kB)
???????????????????????????????????????? 346.6/346.6 kB 15.3 MB/s eta 0:00:00
Building wheels for collected packages: spotfire
Building wheel for spotfire (pyproject.toml) ... done
Created wheel for spotfire: filename=spotfire-2.2.0.dev0-cp312-cp312-linux_x86_64.whl size=1471496 sha256=2c65061e0d921532676ea576bbc3735bc20fc8ee250e260224382fff9e696c74
Stored in directory: /root/.cache/pip/wheels/c8/fe/88/42624ed018319a869dc8414ab6dd88084cac79194ddbcf1df2
Successfully built spotfire
Installing collected packages: pytz, tzdata, six, packaging, python-dateutil, pandas, spotfire
Successfully installed packaging-23.2 pandas-2.1.4 python-dateutil-2.8.2 pytz-2023.3.post1 six-1.16.0 spotfire-2.2.0.dev0 tzdata-2023.4
I think a good fix for the underlying issue would be to have the "wheels" workflow job work from the generated sdist instead of from a checkout. I'll make that change before closing the issue.
OK, I've updated the CI workflow to build the wheels from the sdist as described. This will let us catch this kind of error before we release future versions.
Please note that this should work starting with 2.2.0. (We don't currently have a target date for the next release, since we're waiting on the new NumPy 2.0 release as a prereq.)
Since after 1.8.3 I am unable to build spotfire. I am on Apple M1.
With 1.8.3:
Onwards (currently 2.1.1):