Skip to content

Commit 975340c

Browse files
committed
Move to hatch-rs
1 parent 318169c commit 975340c

File tree

7 files changed

+61
-252
lines changed

7 files changed

+61
-252
lines changed

.copier-answers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 2d0c192
2+
_commit: 82f650d
33
_src_path: https://github.com/python-project-templates/base.git
44
add_docs: true
55
add_extension: rust

.github/workflows/docs.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
permissions:
9+
contents: write
10+
jobs:
11+
docs:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions-ext/python/setup@main
16+
- uses: actions-ext/rust/setup@main
17+
- run: uv pip install .
18+
- run: uv pip install yardang
19+
- run: yardang build
20+
- uses: peaceiris/actions-gh-pages@v4
21+
with:
22+
publish_branch: gh-pages
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
publish_dir: docs/html

Cargo.lock

Lines changed: 0 additions & 237 deletions
This file was deleted.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ crate-type = ["cdylib"]
1111

1212
[dependencies]
1313
python_template_rust = { path = "./rust", version = "*" }
14-
pyo3 = { version = "0.25", features = ["abi3-py39", "extension-module", "multiple-pymethods"] }
15-
strum = "0.27.2"
14+
pyo3 = { version = "0.22", features = ["abi3-py39", "extension-module", "multiple-pymethods"] }
15+
strum = "0.24.1"
1616

1717
[profile.release]
1818
panic = 'abort'

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ requirements: requirements-rs requirements-py ## setup project for development
2323

2424
.PHONY: build-py build-rs build dev
2525
build-py:
26-
maturin build
26+
python -m build -w -n
2727

2828
build-rs:
2929
make -C rust build

pyproject.toml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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]
66
name = "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",
@@ -138,6 +139,27 @@ exclude_also = [
138139
ignore_errors = true
139140
fail_under = 50
140141

142+
[tool.hatch.build]
143+
artifacts = [
144+
"project/*.dll",
145+
"project/*.dylib",
146+
"project/*.so",
147+
]
148+
149+
[tool.hatch.build.sources]
150+
src = "/"
151+
152+
[tool.hatch.build.hooks.hatch-rs]
153+
verbose = true
154+
module = "python_template_rust"
155+
path = "."
156+
157+
[tool.hatch.build.targets.sdist]
158+
packages = ["python_template_rust", "rust"]
159+
160+
[tool.hatch.build.targets.wheel]
161+
packages = ["python_template_rust"]
162+
141163
[tool.pytest.ini_options]
142164
addopts = ["-vvv", "--junitxml=junit.xml"]
143165
testpaths = "python_template_rust/tests"

rust/Cargo.lock

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

0 commit comments

Comments
 (0)