21 inherit pname version;
22 hash = "sha256-J+dzVkIyAE9PgQ/R+FI2Zz7DpW7X8SBvye2GcOvtuXo=";
25 cp ${./Cargo.lock} Cargo.lock
29 inherit pname version src postPatch;
32 disabled = pythonOlder "3.8";
40 cargoDeps = rustPlatform.fetchCargoTarball {
41 inherit src postPatch;
42 name = "${pname}-${version}";
43 hash = "sha256-Q7XO+auj4tKDAGbqNn9pmJg8EJvooN2ie0lWwZVrld4=";
47 rustPlatform.cargoSetupHook
53 buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
55 propagatedBuildInputs = [
61 # almost all tests require network access
64 pythonImportsCheck = [
69 description = "tiktoken is a fast BPE tokeniser for use with OpenAI's models.";
70 homepage = "https://github.com/openai/tiktoken";
71 license = licenses.mit;
72 maintainers = with maintainers; [ happysalada ];