diff --git a/binaries/cli/src/template/python/mod.rs b/binaries/cli/src/template/python/mod.rs index 3baf8b49..10ae7cc0 100644 --- a/binaries/cli/src/template/python/mod.rs +++ b/binaries/cli/src/template/python/mod.rs @@ -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(()) } diff --git a/node-hub/README.md b/node-hub/README.md index aa35bc60..9dd0d5c6 100644 --- a/node-hub/README.md +++ b/node-hub/README.md @@ -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):