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 examples/rustjswasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ add_extension: rustjswasm
email: [email protected]
github: python-project-templates
project_description: A Rust-Python project template
project_name: python template rust
project_name: python template rustjswasm
python_version_primary: '3.9'
team: Python Project Template Authors
9 changes: 9 additions & 0 deletions rustjswasm/Cargo.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@ strum = "0.24.1"
[profile.release]
panic = 'abort'
lto = true

[profile.test.junit]
path = "junit.xml"

[workspace]
members = [
"js",
"rust",
]
193 changes: 0 additions & 193 deletions rustjswasm/js/Cargo.lock.jinja

This file was deleted.

4 changes: 0 additions & 4 deletions rustjswasm/js/Cargo.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@ crate-type = ["cdylib"]
[dependencies]
{{module}} = { path = "../rust", version = "*" }
wasm-bindgen = "0.2.84"

[profile.release]
panic = 'abort'
lto = true
2 changes: 1 addition & 1 deletion rustjswasm/js/package.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"setup": "cargo install -f wasm-bindgen-cli --version 0.2.101",
"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/{{module}}.wasm --out-dir ./dist/pkg --target web",
"build:wasm-bindgen": "wasm-bindgen ../target/wasm32-unknown-unknown/release/{{module}}.wasm --out-dir ./dist/pkg --target web",
"build:prod": "node build.mjs",
"build": "npm-run-all build:rust build:wasm-bindgen build:prod",
"clean": "rm -rf dist lib playwright-report ../{{module}}/extension",
Expand Down
89 changes: 0 additions & 89 deletions rustjswasm/rust/Cargo.lock.jinja

This file was deleted.

4 changes: 0 additions & 4 deletions rustjswasm/rust/Cargo.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,3 @@ crate-type = ["rlib"]
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"

[profile.test.junit]
path = "junit.xml"

18 changes: 7 additions & 11 deletions rustjswasm/src/example/mod.rs.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use pyo3::prelude::*;

use {{module}}::Example as BaseExample;


#[pyclass]
pub struct Example {
pub example: BaseExample,
Expand All @@ -12,21 +11,18 @@ pub struct Example {
impl Example {
#[new]
fn py_new(value: String) -> PyResult<Self> {
Ok(
Example {
example: BaseExample {
stuff: value.as_str().to_string()
},
}
)

Ok(Example {
example: BaseExample {
stuff: value.as_str().to_string(),
},
})
}

fn __str__(&self) -> PyResult<String> {
fn __str__(&self) -> PyResult<String> {
Ok(format!("{}", self.example.stuff))
}

fn __repr__(&self) -> PyResult<String> {
fn __repr__(&self) -> PyResult<String> {
Ok(format!("Example<{}>", self.example.stuff))
}
}
1 change: 0 additions & 1 deletion rustjswasm/src/lib.rs.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ mod example;

pub use example::Example;


#[pymodule]
fn {{module}}(_py: Python, m: &Bound<PyModule>) -> PyResult<()> {
// Example
Expand Down
Loading