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: b74d698
_commit: 37f89c1
_src_path: https://github.com/python-project-templates/base.git
add_docs: true
add_extension: rustjswasm
Expand Down
2 changes: 1 addition & 1 deletion js/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ crate-type = ["cdylib"]

[dependencies]
python_template_rust = { path = "../rust", version = "*" }
wasm-bindgen = "0.2.106"
wasm-bindgen = "0.2.108"
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"access": "public"
},
"scripts": {
"setup": "cargo install -f wasm-bindgen-cli --version 0.2.106",
"setup": "cargo install -f wasm-bindgen-cli --version 0.2.108",
"build:debug": "node build.mjs --debug",
"build:rust": "cargo build --release --all-features --target wasm32-unknown-unknown",
"build:wasm-bindgen": "wasm-bindgen ../target/wasm32-unknown-unknown/release/python_template_rust.wasm --out-dir ./dist/pkg --target web",
Expand Down
65 changes: 52 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
[build-system]
requires = ["hatchling", "hatch-js", "hatch-rs"]
requires = [
"hatchling",
"hatch-js",
"hatch-rs",
]
build-backend = "hatchling.build"

[project]
name = "python-template-rust"
authors = [{name = "Python Project Template Authors", email = "3105306+timkpaine@users.noreply.github.com"}]
authors = [
{name = "Python Project Template Authors", email = "3105306+timkpaine@users.noreply.github.com"},
]
description = "A Rust-Python project template"
readme = "README.md"
license = { text = "Apache-2.0" }
Expand Down Expand Up @@ -44,6 +50,8 @@ develop = [
"pytest-cov",
"ruff>=0.9,<0.15",
"twine",
"ty",
"uv",
"wheel",
]

Expand Down Expand Up @@ -108,7 +116,7 @@ ignore = [
[tool.cibuildwheel]
build = "cp310-*"
test-command = "pytest -vvv {project}/python_template_rust/tests"
test-requires = ["pytest", "pytest-cov", "pytest-sugar", "pytest-xdist"]
test-extras = "develop"

[tool.cibuildwheel.linux]
before-all = """
Expand Down Expand Up @@ -145,36 +153,67 @@ fail_under = 50
path = "js"
build_cmd = "build"
tool = "pnpm"
targets = ["python_template_rust/extension/cdn/index.js"]
targets = [
"python_template_rust/extension/cdn/index.js",
]

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

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

[tool.hatch.build.targets.wheel]
packages = ["python_template_rust"]
exclude = ["/js", "/rust", "/src"]
packages = [
"python_template_rust",
]
exclude = [
"/js",
"/rust",
"/src",
]

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

[tool.ruff]
line-length = 150

[tool.ruff.lint]
extend-select = ["I"]
extend-select = [
"I",
]

[tool.ruff.lint.isort]
combine-as-imports = true
default-section = "third-party"
known-first-party = ["python_template_rust"]
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
known-first-party = [
"python_template_rust",
]
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"]
"__init__.py" = [
"F401",
"F403",
]
4 changes: 2 additions & 2 deletions rust/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
requirements: ## install required dev dependencies
rustup component add rustfmt
rustup component add clippy
cargo install -f cargo-nextest
cargo install -f cargo-nextest --locked
cargo install -f cargo-llvm-cov
cargo install -f wasm-bindgen-cli --version 0.2.106
cargo install -f wasm-bindgen-cli --version 0.2.108
rustup target add wasm32-unknown-unknown

develop: requirements ## install required dev dependencies
Expand Down
Loading