11[build-system ]
2- requires = [" maturin>=1,<2 " ]
3- build-backend = " maturin "
2+ requires = [" hatchling " , " hatch-rs " ]
3+ build-backend = " hatchling.build "
44
55[project ]
66name = " python-template-rust"
@@ -35,9 +35,10 @@ develop = [
3535 " check-manifest" ,
3636 " cibuildwheel" ,
3737 " codespell>=2.4,<2.5" ,
38+ " hatch-rs" ,
39+ " hatchling" ,
3840 " mdformat>=0.7.22,<0.8" ,
3941 " mdformat-tables>=1" ,
40- " maturin>=1,<2" ,
4142 " pytest" ,
4243 " pytest-cov" ,
4344 " ruff" ,
@@ -80,6 +81,8 @@ replace = 'version = "{new_version}"'
8081[tool .check-manifest ]
8182ignore = [
8283 " .copier-answers.yaml" ,
84+ " Cargo.toml" ,
85+ " Cargo.lock" ,
8386 " Makefile" ,
8487 " docs/**/*" ,
8588 " rust/.config/*" ,
@@ -102,7 +105,7 @@ rustup target add x86_64-unknown-linux-gnu
102105rustup show
103106"""
104107environment = {PATH =" $HOME/.cargo/bin:$PATH" , CARGO_TERM_COLOR =" always" }
105- archs = " x86_64 aarch64 "
108+ skip = " *i686 musllinux* "
106109
107110[tool .cibuildwheel .macos ]
108111before-build = """
@@ -112,7 +115,7 @@ rustup target add x86_64-apple-darwin
112115rustup show
113116"""
114117environment = {PATH =" $HOME/.cargo/bin:$PATH" , CARGO_TERM_COLOR =" always" , MACOS_DEPLOYMENT_TARGET =11.0 }
115- archs = " x86_64 arm64"
118+ archs = " arm64"
116119
117120[tool .cibuildwheel .windows ]
118121before-build = """
@@ -122,7 +125,7 @@ rustup target add aarch64-pc-windows-msvc
122125rustup show
123126"""
124127environment = {PATH =" $UserProfile\\ .cargo\b in;$PATH" , CARGO_TERM_COLOR =" always" }
125- archs = " AMD64 ARM64 "
128+ skip = " *win32 *arm_64 "
126129
127130[tool .coverage .run ]
128131branch = true
@@ -138,6 +141,30 @@ exclude_also = [
138141ignore_errors = true
139142fail_under = 50
140143
144+ [tool .hatch .build ]
145+ artifacts = [
146+ " project/*.dll" ,
147+ " project/*.dylib" ,
148+ " project/*.so" ,
149+ ]
150+
151+ [tool .hatch .build .sources ]
152+ src = " /"
153+
154+ [tool .hatch .build .hooks .hatch-rs ]
155+ verbose = true
156+ module = " python_template_rust"
157+ path = " ."
158+
159+ [tool .hatch .build .targets .sdist ]
160+ packages = [" python_template_rust" , " /rust" , " /src" ]
161+ sources = [" ." ]
162+
163+
164+
165+ [tool .hatch .build .targets .wheel ]
166+ packages = [" python_template_rust" ]
167+
141168[tool .pytest .ini_options ]
142169addopts = [" -vvv" , " --junitxml=junit.xml" ]
143170testpaths = " python_template_rust/tests"
0 commit comments