Skip to content

Commit 9845c0e

Browse files
switch to maturin build system, include binary in python package (#33)
1 parent 19b2566 commit 9845c0e

File tree

4 files changed

+43
-9
lines changed

4 files changed

+43
-9
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ serde = { version = "1.0", features = ["derive"] }
1919
serde_json = "1.0"
2020
thiserror = "2.0"
2121
tokio = { version = "1.42", features = ["full"] }
22+
23+
[profile.dev.package]
24+
insta.opt-level = 3
25+
similar.opt-level = 3

crates/djls-ast/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ thiserror = { workspace = true }
99

1010
[dev-dependencies]
1111
insta = { version = "1.41", features = ["yaml"] }
12-
13-
[profile.dev.package]
14-
insta.opt-level = 3
15-
similar.opt-level = 3

pyproject.toml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
2-
requires = ["hatchling"]
3-
build-backend = "hatchling.build"
2+
requires = ["maturin>=1.0,<2.0"]
3+
build-backend = "maturin"
44

55
[project]
66
name = "djls"
@@ -16,15 +16,24 @@ dependencies = [
1616
"protobuf>=5.29.1",
1717
]
1818

19-
[tool.hatch.build.targets.wheel]
20-
sources = ["python"]
21-
2219
[dependency-groups]
2320
dev = [
2421
"django-stubs>=5.1.1",
22+
"maturin>=1.7.8",
2523
"ruff>=0.8.2",
2624
]
2725

26+
[tool.maturin]
27+
bindings = "bin"
28+
manifest-path = "crates/djls/Cargo.toml"
29+
module-name = "djls"
30+
python-source = "python"
31+
strip = true
32+
include = [
33+
{ path = "proto/**/*", format = ["sdist", "wheel"] },
34+
{ path = "LICENSE", format = "sdist" },
35+
]
36+
2837
[tool.ruff]
2938
# Exclude a variety of commonly ignored directories.
3039
exclude = [

uv.lock

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)