Browse Source

Improve documentation on adding new node to the node-hub

tags/test-git
haixuantao 10 months ago
parent
commit
567ee66f14
2 changed files with 31 additions and 4 deletions
  1. +4
    -4
      binaries/cli/src/template/python/mod.rs
  2. +27
    -0
      node-hub/README.md

+ 4
- 4
binaries/cli/src/template/python/mod.rs View File

@@ -90,10 +90,10 @@ fn create_custom_node(
Path::new(".").join(&root).display()
);
println!(" cd {}", Path::new(".").join(&root).display());
println!(" pip install -e . # Install",);
println!(" ruff check . --fix # Format");
println!(" ruff check . # Lint",);
println!(" pytest . # Test");
println!(" uv pip install -e . # Install",);
println!(" uv run ruff check . --fix # Format");
println!(" uv run ruff check . # Lint",);
println!(" uv run pytest . # Test");

Ok(())
}


+ 27
- 0
node-hub/README.md View File

@@ -2,6 +2,33 @@

This hub contains useful pre-built nodes for Dora.

## Add a new python node

- To work on a new node, start by:

```bash
cd node-hub
dora new your-node-name --lang python --kind node
cd ./your-node-name
uv venv --seed -p 3.11
uv pip install -e . # Install
uv run ruff check . --fix # Format
uv run ruff check . # Lint
uv run pytest . # Test
```

- To add a python dependency just do:

```bash
uv add numpy # for example
```

> The package is then added to your `pyproject.toml`

- Modify the code within `main.py` in your liking.

- Create a PR and let the CI/CD run test on it 🙋

# Structure

The structure of the node hub is as follows (please use the same structure if you need to add a new node):


Loading…
Cancel
Save