Skip to content

Commit 9c9865c

Browse files
committed
Partial sync of codebase
1 parent 6352764 commit 9c9865c

File tree

6 files changed

+341
-241
lines changed

6 files changed

+341
-241
lines changed

Cargo.toml

+12-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,20 @@ edition = "2021"
55
rust-version = "1.57.0"
66

77
[lib]
8-
name = "_tiktoken"
9-
crate-type = ["cdylib"]
8+
name = "tiktoken"
9+
crate-type = ["cdylib", "rlib"]
10+
11+
[features]
12+
default = []
13+
python = [
14+
"pyo3",
15+
]
1016

1117
[dependencies]
12-
pyo3 = { version = "0.22.2", default-features = false, features = ["extension-module", "macros"] }
18+
pyo3 = { version = "0.22.2", default-features = false, features = [
19+
"extension-module",
20+
"macros",
21+
], optional = true }
1322

1423
# tiktoken dependencies
1524
fancy-regex = "0.13.0"

pyproject.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name = "tiktoken"
33
version = "0.8.0"
44
description = "tiktoken is a fast BPE tokeniser for use with OpenAI's models"
55
readme = "README.md"
6-
license = {file = "LICENSE"}
7-
authors = [{name = "Shantanu Jain"}, {email = "[email protected]"}]
6+
license = { file = "LICENSE" }
7+
authors = [{ name = "Shantanu Jain" }, { email = "[email protected]" }]
88
dependencies = ["regex>=2022.1.18", "requests>=2.26.0"]
9-
optional-dependencies = {blobfile = ["blobfile>=2"]}
9+
optional-dependencies = { blobfile = ["blobfile>=2"] }
1010
requires-python = ">=3.9"
1111

1212
[project.urls]
@@ -43,3 +43,4 @@ test-command = "pytest {project}/tests --import-mode=append"
4343
[[tool.cibuildwheel.overrides]]
4444
select = "*linux_aarch64"
4545
test-command = """python -c 'import tiktoken; enc = tiktoken.get_encoding("gpt2"); assert enc.encode("hello world") == [31373, 995]'"""
46+

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Between our use of editable installs and wanting to use Rust for performance sensitive
1111
# code, it makes sense to just always use --release
1212
debug=False,
13+
features=["python"],
1314
)
1415
],
1516
package_data={"tiktoken": ["py.typed"]},

0 commit comments

Comments
 (0)