When running the test suite with hatch, I got the following compilation error for the Rust-based dependency tiktoken:
$ hatch run test
error: subprocess-exited-with-error
× Building wheel for tiktoken (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [36 lines of output]
running bdist_wheel
running build
running build_py
creating build/lib.macosx-10.13-x86_64-cpython-312/tiktoken
copying tiktoken/registry.py -> build/lib.macosx-10.13-x86_64-cpython-312/tiktoken
copying tiktoken/__init__.py -> build/lib.macosx-10.13-x86_64-cpython-312/tiktoken
copying tiktoken/core.py -> build/lib.macosx-10.13-x86_64-cpython-312/tiktoken
copying tiktoken/model.py -> build/lib.macosx-10.13-x86_64-cpython-312/tiktoken
copying tiktoken/load.py -> build/lib.macosx-10.13-x86_64-cpython-312/tiktoken
copying tiktoken/_educational.py -> build/lib.macosx-10.13-x86_64-cpython-312/tiktoken
creating build/lib.macosx-10.13-x86_64-cpython-312/tiktoken_ext
copying tiktoken_ext/openai_public.py -> build/lib.macosx-10.13-x86_64-cpython-312/tiktoken_ext
running egg_info
writing tiktoken.egg-info/PKG-INFO
writing dependency_links to tiktoken.egg-info/dependency_links.txt
writing requirements to tiktoken.egg-info/requires.txt
writing top-level names to tiktoken.egg-info/top_level.txt
reading manifest file 'tiktoken.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'Makefile'
adding license file 'LICENSE'
writing manifest file 'tiktoken.egg-info/SOURCES.txt'
copying tiktoken/py.typed -> build/lib.macosx-10.13-x86_64-cpython-312/tiktoken
running build_ext
running build_rust
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
To update pip, run:
pip install --upgrade pip
and then retry package installation.
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for tiktoken
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (tiktoken)
I installed Rust and retried with a similar hatch command which produced a Rust compilation error:
It seems like the tiktoken dependency is only a child dependency of the write-the snk dependency, so I tried removing write-the from the project's dependencies list and running hatch run test again. This change allowed me to run the test suite.
Since write-the is specifically needed for building the documentation, what if it was part of a separate optional dependency group in the pyproject file? This would allow contributors to run the test suite without installing Rust or working around the tiktoken dependency.
Is there is another better way to work around this issue?
Description
When running the test suite with hatch, I got the following compilation error for the Rust-based dependency tiktoken:
I installed Rust and retried with a similar hatch command which produced a Rust compilation error:
It seems like the tiktoken dependency is only a child dependency of the
write-the
snk dependency, so I tried removingwrite-the
from the project's dependencies list and runninghatch run test
again. This change allowed me to run the test suite.Since
write-the
is specifically needed for building the documentation, what if it was part of a separate optional dependency group in the pyproject file? This would allow contributors to run the test suite without installing Rust or working around the tiktoken dependency.Is there is another better way to work around this issue?
Motivated by https://github.com/openjournals/joss-reviews/issues/7410
Environment