Closed carlsmedstad closed 11 months ago
Solved the issue by removing the Python files and pointing to the built package:
check() {
cd "$_archive"
rm -r tiktoken tiktoken.egg-info tiktoken_ext
local python_version
python_version=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
export PYTHONPATH="build/lib.linux-$CARCH-cpython-$python_version"
echo "$PYTHONPATH"
python -m pytest
}
Let me know if there is a better solution. Thanks!
Yeah, you want to make sure you're running tests against the installed version, not the source files in the current directory. Your solution is a solution, another option is to change the default pytest behaviour using the --import-mode
flag, like so: https://github.com/openai/tiktoken/blob/39f29cecdb6fc38d9a3434e5dd15e4de58cf3c80/pyproject.toml#L40
Hi :wave:
I maintain the Arch User Repository package for tiktoken. I'm trying to incorporate the tests in the package build, but I cannot get them to pass:
Just running
import tiktoken
produces the following error:Help very much appreciated, thanks!