From 5ea6e3f7912fa3ae83f9031f53e8a67a1a849e62 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 10 Mar 2026 18:28:40 +0100 Subject: [PATCH 1/8] README: Copy editing --- README.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/README.md b/README.md index 9e9da88..49b9e3c 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,6 @@ Write Node-RED user-defined functions in Python / Efficient test harnesses for N True headless Node-RED / Improved development iteration times / Node-RED without needing to take the red pill / Node-BLUE is Node-RED on rails / Now it all makes sense_ -:::{todo} -This list should make it into the »Features« section. -::: - -:::{attention} -Here be dragons. -::: - - ## About The idea is to embed [Node-RED] into Python programs, in order to leverage it @@ -29,10 +20,8 @@ The other idea is to extend the Node-RED ecosystem by leveraging other programmi languages and their ecosystems natively, beyond what JavaScript/NPM can do. We made a start with [Python], by using the excellent [JSPyBridge] package. - ## Synopsis - ### Command-line use Install [Node-BLUE] and [HTTPie], and their prerequisites. @@ -58,7 +47,6 @@ Launch a flow which defines a pipeline to converge data from [MQTT] to [CrateDB] node-blue launch --flow=examples/flows/mqtt-to-cratedb.yaml ``` - ### Library use ```python @@ -83,7 +71,6 @@ if __name__ == "__main__": asyncio.run(launch_blue()) ``` - ## Examples ### Introduction @@ -211,13 +198,11 @@ node-blue launch --flow=examples/flows/mqtt-routing-python.yaml ] ``` - ## References See also the IBM Data management article about [Implementing ETL flows with Node-RED] by [Ondrej Lehota]. - ## Etymology To use the name »Node-BLUE« for this project was obvious. However, we discovered @@ -228,7 +213,6 @@ will not be much harm to reuse that name now. - https://www.npmjs.com/package/node-blue - https://github.com/node-blue/node-blue - ## Acknowledgements This project bundles a few significant pieces of software and technologies, From e1e83c3a386b5814bcd2f1d700d82271c657ce63 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 10 Mar 2026 18:29:53 +0100 Subject: [PATCH 2/8] Chore: Format `pyproject.toml` using most recent `pyproject-fmt` --- pyproject.toml | 69 ++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 81ba46f..997f2ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,10 @@ requires = [ [project] name = "node-blue" -description = "Node-RED without a mouse / Node-RED as a library / Write Node-RED flows in YAML / Efficient test harnesses for Node-RED / Headless Node-RED / Improved development cycle times / Now it all makes sense" +description = """\ + Node-RED without a mouse / Node-RED as a library / Write Node-RED flows in YAML / Efficient test harnesses for \ + Node-RED / Headless Node-RED / Improved development cycle times / Now it all makes sense\ + """ readme = "README.md" keywords = [ "automation", @@ -93,8 +96,8 @@ dependencies = [ optional-dependencies.develop = [ "munch<5", "mypy<1.20", - "poethepoet<0.30", - "pyproject-fmt<2.6", + "poethepoet<1", + "pyproject-fmt<3", "ruff<0.16", "types-tabulate", ] @@ -116,8 +119,8 @@ urls.homepage = "https://github.com/daq-tools/node-blue" urls.repository = "https://github.com/daq-tools/node-blue" scripts.node-blue = "node_blue.cli:cli" -[tool.setuptools.packages.find] -namespaces = false +[tool.setuptools] +packages.find.namespaces = false [tool.black] line-length = 120 @@ -131,36 +134,32 @@ extend-exclude = [ # Temporary "workbench.py", ] - lint.ignore = [ "E722", # Do not use bare `except` ] -[tool.pytest.ini_options] -minversion = "2.0" -addopts = "-rsfEX -p pytester --strict-markers --verbosity=3 --capture=no" -log_cli = true # Enable to receive way more log details on stdout. -log_cli_level = "DEBUG" -log_level = "DEBUG" -log_format = "%(asctime)-15s [%(name)-24s] %(levelname)-7s: %(message)s" -testpaths = [ "examples", "droste", "node_blue", "tests" ] -xfail_strict = true -markers = [ +[tool.pytest] +ini_options.minversion = "2.0" +ini_options.addopts = "-rsfEX -p pytester --strict-markers --verbosity=3 --capture=no" +ini_options.log_cli = true # Enable to receive way more log details on stdout. +ini_options.log_cli_level = "DEBUG" +ini_options.log_level = "DEBUG" +ini_options.log_format = "%(asctime)-15s [%(name)-24s] %(levelname)-7s: %(message)s" +ini_options.testpaths = [ "examples", "droste", "node_blue", "tests" ] +ini_options.xfail_strict = true +ini_options.markers = [ "capmqtt_decode_utf8", ] -[tool.coverage.run] -branch = false -source = [ "droste", "node_blue" ] - -[tool.coverage.report] -fail_under = 0 -show_missing = true +[tool.coverage] +run.branch = false +run.source = [ "droste", "node_blue" ] +report.fail_under = 0 +report.show_missing = true [tool.mypy] packages = [ "node_blue" ] -exclude = [ -] +exclude = [] check_untyped_defs = true ignore_missing_imports = true implicit_optional = true @@ -168,32 +167,30 @@ install_types = true non_interactive = true [tool.versioningit] +vcs.method = "git" +vcs.default-tag = "0.0.0" -[tool.versioningit.vcs] -method = "git" -default-tag = "0.0.0" - -[tool.poe.tasks] -format = [ +[tool.poe] +tasks.format = [ { cmd = "ruff format" }, # Configure Ruff not to auto-fix (remove!): # unused imports (F401), unused variables (F841), `print` statements (T201), and commented-out code (ERA001). { cmd = "ruff check --fix --ignore=ERA --ignore=F401 --ignore=F841 --ignore=T20 --ignore=ERA001 ." }, { cmd = "pyproject-fmt --keep-full-version pyproject.toml" }, ] -lint = [ +tasks.lint = [ { cmd = "ruff check ." }, { cmd = "pyproject-fmt --check pyproject.toml" }, { cmd = "mypy" }, ] -test = [ +tasks.test = [ { cmd = "node-blue setup" }, { cmd = "pytest" }, ] -coverage = [ +tasks.coverage = [ { cmd = "coverage run pytest" }, { cmd = "coverage xml" }, { cmd = "coverage report" }, ] -build = { cmd = "python -m build" } -check = [ "lint", "test" ] +tasks.build = { cmd = "python -m build" } +tasks.check = [ "lint", "test" ] From dbbc1bd4be4d846f4d317897f6a0514e9b9a81c0 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 10 Mar 2026 18:31:13 +0100 Subject: [PATCH 3/8] Dependencies: Remove `minibump` --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 997f2ce..83b141c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,7 +103,6 @@ optional-dependencies.develop = [ ] optional-dependencies.release = [ "build<2", - "minibump<1; python_version>='3.10'", "twine<7", ] optional-dependencies.test = [ From 653661344914d94742ab117daa94c3f67f949d21 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 10 Mar 2026 18:31:21 +0100 Subject: [PATCH 4/8] Chore: Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8d9c962..5b127a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /.idea /.venv +/.mypy_cache __pycache__ *.pyc *.egg-info From e26b04b7b244771c2e37be34b54812721b1852c7 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 10 Mar 2026 18:40:10 +0100 Subject: [PATCH 5/8] CI: Prettify / consolidate configuration --- .github/workflows/tests.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 678fe95..285ef38 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,7 +44,7 @@ jobs: run: | docker version - - name: Setup Python + - name: Install Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -52,18 +52,22 @@ jobs: cache: 'pip' cache-dependency-path: 'pyproject.toml' - - name: Setup Node.js + - name: Install Node.js uses: actions/setup-node@v3 with: node-version: 18 cache: 'npm' cache-dependency-path: 'package.json' - - name: Setup project + - name: Set up project run: | # Install package in editable mode. pip install versioningit wheel pip install --editable=.[test,develop] + + # TODO: This command should write a `package.json`, then invoke `npm install`. + node-blue setup + # TODO: Refactor to `node-blue setup`, see above. npm install - name: Check code style @@ -72,7 +76,6 @@ jobs: - name: Run tests run: | - node-blue setup poe test - name: Upload coverage to Codecov From f077021abd4bfcadfcc714458f062f60dce93627 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 10 Mar 2026 18:40:46 +0100 Subject: [PATCH 6/8] Documentation: Update README and backlog --- README.md | 8 +++++++- docs/backlog.md | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 49b9e3c..8352c04 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,14 @@ a start with [Python], by using the excellent [JSPyBridge] package. Install [Node-BLUE] and [HTTPie], and their prerequisites. ```shell -pip install httpie https://github.com/daq-tools/node-blue +pip install httpie node-blue +``` + +There is currently a little manual post-setup procedure. +```shell node-blue setup +wget https://github.com/daq-tools/node-blue/raw/refs/heads/main/package.json +wget https://github.com/daq-tools/node-blue/raw/refs/heads/main/node.importmap npm install ``` diff --git a/docs/backlog.md b/docs/backlog.md index 4023527..6627e2d 100644 --- a/docs/backlog.md +++ b/docs/backlog.md @@ -1,5 +1,9 @@ # Node-BLUE backlog +## Iteration +0 +- [o] Refactor `npm install` to `node-blue setup` +- [o] Enable code coverage uploading + ## Iteration +1 - [o] What about calling Python functions? - [o] Python functions, appsource, and appsink From cc9b283268c305d7a87d990bd898e46898e1d989 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 10 Mar 2026 18:46:52 +0100 Subject: [PATCH 7/8] CI: Use `pip install --upgrade` This will hopefully install the most recent versions of all packages, including `pyproject-fmt`. 2.8.0 gets installed while 2.18.1 is available. However, the former fails on Python 3.9: thread '' panicked at common/src/create.rs:22:5: --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 285ef38..0fad907 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -62,8 +62,8 @@ jobs: - name: Set up project run: | # Install package in editable mode. - pip install versioningit wheel - pip install --editable=.[test,develop] + pip install --upgrade versioningit wheel + pip install --upgrade --editable='.[test,develop]' # TODO: This command should write a `package.json`, then invoke `npm install`. node-blue setup From c48f859bdcbc63c6d11a5ad846604cfd2e32a15b Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 10 Mar 2026 18:50:06 +0100 Subject: [PATCH 8/8] CI: Don't invoke linters on Python 3.9 pyproject-fmt 2.8.0 fails on Python 3.9. thread '' panicked at common/src/create.rs:22:5: --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0fad907..b8a5ace 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,6 +71,7 @@ jobs: npm install - name: Check code style + if: ${{ matrix.python-version != '3.9' }} run: | poe lint