Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 2d0c192
_commit: 56f5fb6
_src_path: https://github.com/python-project-templates/base.git
add_docs: true
add_extension: rust
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish Docs

on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-ext/python/setup@main
- uses: actions-ext/rust/setup@main
- run: uv pip install .
- run: uv pip install yardang
- run: yardang build
- uses: peaceiris/actions-gh-pages@v4
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/html
112 changes: 64 additions & 48 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ crate-type = ["cdylib"]

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

[profile.release]
panic = 'abort'
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ requirements: requirements-rs requirements-py ## setup project for development

.PHONY: build-py build-rs build dev
build-py:
maturin build
python -m build -w -n

build-rs:
make -C rust build
Expand Down
37 changes: 31 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["maturin>=1,<2"]
build-backend = "maturin"
requires = ["hatchling", "hatch-rs>=0.1.4"]
build-backend="hatchling.build"

[project]
name = "python-template-rust"
Expand Down Expand Up @@ -35,9 +35,10 @@ develop = [
"check-manifest",
"cibuildwheel",
"codespell>=2.4,<2.5",
"hatch-rs",
"hatchling",
"mdformat>=0.7.22,<0.8",
"mdformat-tables>=1",
"maturin>=1,<2",
"pytest",
"pytest-cov",
"ruff",
Expand Down Expand Up @@ -80,6 +81,8 @@ replace = 'version = "{new_version}"'
[tool.check-manifest]
ignore = [
".copier-answers.yaml",
"Cargo.toml",
"Cargo.lock",
"Makefile",
"docs/**/*",
"rust/.config/*",
Expand All @@ -102,7 +105,7 @@ rustup target add x86_64-unknown-linux-gnu
rustup show
"""
environment = {PATH="$HOME/.cargo/bin:$PATH", CARGO_TERM_COLOR="always"}
archs = "x86_64 aarch64"
skip = "*i686 musllinux*"

[tool.cibuildwheel.macos]
before-build = """
Expand All @@ -112,7 +115,7 @@ rustup target add x86_64-apple-darwin
rustup show
"""
environment = {PATH="$HOME/.cargo/bin:$PATH", CARGO_TERM_COLOR="always", MACOS_DEPLOYMENT_TARGET=11.0}
archs = "x86_64 arm64"
archs = "arm64"

[tool.cibuildwheel.windows]
before-build = """
Expand All @@ -122,7 +125,7 @@ rustup target add aarch64-pc-windows-msvc
rustup show
"""
environment = {PATH="$UserProfile\\.cargo\bin;$PATH", CARGO_TERM_COLOR="always"}
archs = "AMD64 ARM64"
skip = "*win32 *arm_64"

[tool.coverage.run]
branch = true
Expand All @@ -138,6 +141,28 @@ exclude_also = [
ignore_errors = true
fail_under = 50

[tool.hatch.build]
artifacts = [
"project/*.dll",
"project/*.dylib",
"project/*.so",
]

[tool.hatch.build.sources]
src = "/"

[tool.hatch.build.hooks.hatch-rs]
verbose = true
module = "python_template_rust"
path = "."

[tool.hatch.build.targets.sdist]
packages = ["python_template_rust", "/rust", "/src"]
sources = ["."]

[tool.hatch.build.targets.wheel]
packages = ["python_template_rust"]

[tool.pytest.ini_options]
addopts = ["-vvv", "--junitxml=junit.xml"]
testpaths = "python_template_rust/tests"
Expand Down
Loading
Loading