From e610f04cb18f529d7cf58cea783fc3751773ffd3 Mon Sep 17 00:00:00 2001 From: Gavin Ying Date: Sat, 14 Nov 2026 11:33:58 +0800 Subject: [PATCH 1/2] ci: publish to PyPI with Trusted Publishing The three release workflows upload with the workflow's OIDC identity (--trusted-publishing always) instead of the PYPI_TOKEN secret. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/modpoll-release.yml | 6 +++--- .github/workflows/modpoll-wot-release.yml | 6 +++--- .github/workflows/modsim-release.yml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/modpoll-release.yml b/.github/workflows/modpoll-release.yml index 7adc815..b3d6f28 100644 --- a/.github/workflows/modpoll-release.yml +++ b/.github/workflows/modpoll-release.yml @@ -48,6 +48,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + id-token: write steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: @@ -83,9 +84,8 @@ jobs: run: python .github/scripts/preview-release.py pypi "$TAG" - name: Publish application to PyPI if: steps.pypi.outputs.state == 'absent' - env: - UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} - run: uv publish --no-progress dist/* + # Trusted Publishing: PyPI accepts this workflow's OIDC identity; no token is stored. + run: uv publish --no-progress --trusted-publishing always dist/* - name: Record functional prerelease env: GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/modpoll-wot-release.yml b/.github/workflows/modpoll-wot-release.yml index c988f9c..25b1933 100644 --- a/.github/workflows/modpoll-wot-release.yml +++ b/.github/workflows/modpoll-wot-release.yml @@ -20,6 +20,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + id-token: write steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: @@ -36,9 +37,8 @@ jobs: working_directory: packages/modpoll-wot - run: mise run check - name: Publish to PyPI without replacing existing files - env: - UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} - run: uv publish --no-progress --check-url https://pypi.org/simple/ dist/* + # Trusted Publishing: PyPI accepts this workflow's OIDC identity; no token is stored. + run: uv publish --no-progress --trusted-publishing always --check-url https://pypi.org/simple/ dist/* - name: Verify the registry installation timeout-minutes: 15 run: | diff --git a/.github/workflows/modsim-release.yml b/.github/workflows/modsim-release.yml index 50f083c..eced384 100644 --- a/.github/workflows/modsim-release.yml +++ b/.github/workflows/modsim-release.yml @@ -30,6 +30,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + id-token: write actions: read steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 @@ -62,9 +63,8 @@ jobs: run: python .github/scripts/preview-release.py immutable "${GIT_TAG#modsim-v}" - name: Publish PyPI package if: steps.registry.outputs.exists == 'false' - env: - UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} - run: uv publish --no-progress dist/* + # Trusted Publishing: PyPI accepts this workflow's OIDC identity; no token is stored. + run: uv publish --no-progress --trusted-publishing always dist/* - name: Publish GitHub prerelease env: GH_TOKEN: ${{ github.token }} From 91d872e832d00dc9d25e25d95a90470ef3376f3b Mon Sep 17 00:00:00 2001 From: Gavin Ying Date: Sat, 14 Nov 2026 11:33:58 +0800 Subject: [PATCH 2/2] chore: release modpoll-wot 0.7.0a1, modpoll 2.0.0a12 and modsim 2.0.0a14 modpoll installs pyserial by default, so Modbus RTU needs no extra; modpoll[serial] stays as an empty extra. modpoll-wot 0.7.0a1 brings the typed top-level interface and calendar report dates (WOT-05). Co-Authored-By: Claude Opus 5.5 --- packages/modpoll/README.md | 14 +++++--------- packages/modpoll/docs/preview-notes.md | 10 ++++++++++ packages/modpoll/docs/site/installation.rst | 12 ++++-------- packages/modpoll/pyproject.toml | 7 +++++-- packages/modsim/docs/preview-notes.md | 7 ++++++- packages/modsim/modsim/__init__.py | 2 +- packages/modsim/pyproject.toml | 2 +- uv.lock | 12 ++++-------- 8 files changed, 36 insertions(+), 30 deletions(-) diff --git a/packages/modpoll/README.md b/packages/modpoll/README.md index 46b3466..4fd8bf2 100644 --- a/packages/modpoll/README.md +++ b/packages/modpoll/README.md @@ -1,4 +1,4 @@ -> **2.x development branch.** This checkout accepts v1 CSV and WoT TM/TD JSON using profile 0.2; `--config` detects the format from the content. Install the current preview with `uv tool install --prerelease allow 'modpoll[serial]==2.0.0a8'`; stable 1.x remains available with `uv tool install 'modpoll<2'`. For development, run `make install`, then prefix project commands with `uv run`. +> **2.x development branch.** This checkout accepts v1 CSV and WoT TM/TD JSON using profile 0.2; `--config` detects the format from the content. Install the current preview with `uv tool install --prerelease allow 'modpoll==2.0.0a12'`; stable 1.x remains available with `uv tool install 'modpoll<2'`. For development, run `make install`, then prefix project commands with `uv run`. # Modpoll - A New Command-line Tool for Modbus and MQTT @@ -47,14 +47,10 @@ This tool requires Python 3.10+ (Ubuntu 22.04+ or equivalent) and is available o Install *modpoll* using the following command, ```bash -uv tool install --prerelease allow "modpoll==2.0.0a8" +uv tool install --prerelease allow "modpoll==2.0.0a12" ``` -Optionally, [pyserial](https://pyserial.readthedocs.io/) library can be installed for Modbus-RTU communication, - -```bash -uv tool install --prerelease allow 'modpoll[serial]==2.0.0a8' -``` +Modbus RTU support ([pyserial](https://pyserial.readthedocs.io/)) is included since 2.0.0a12. Upgrade the tool via the following command, @@ -173,7 +169,7 @@ so `modsim --config device.tm.json --data snapshot.json` replays it locally. A docker image has been provided for user to directly run the tool without local installation, ```bash - docker run --rm topmaker/modpoll:2.0.0a8 + docker run --rm topmaker/modpoll:2.0.0a12 ``` It shows the version of the tool by default. @@ -185,7 +181,7 @@ If you want to load a local configure file, you need to mount a local folder ont for example, if the child folder `examples` contains the config file `modsim.tm.json`, we can use it via the following command, ```bash - docker run --rm --network host -v "$(pwd)/examples:/app/examples:ro" topmaker/modpoll:2.0.0a8 \ + docker run --rm --network host -v "$(pwd)/examples:/app/examples:ro" topmaker/modpoll:2.0.0a12 \ modpoll -d \ --tcp 127.0.0.1 --tcp-port 5020 \ --config /app/examples/modsim.tm.json diff --git a/packages/modpoll/docs/preview-notes.md b/packages/modpoll/docs/preview-notes.md index 582f2a2..3d43e47 100644 --- a/packages/modpoll/docs/preview-notes.md +++ b/packages/modpoll/docs/preview-notes.md @@ -1,3 +1,13 @@ +# Modpoll 2.0.0a12 preview + +Modpoll 2.0.0a12 pins modpoll-wot 0.7.0a1: + +- Modbus RTU works without extras: pyserial is now a regular dependency, so `uvx modpoll --rtu ...` and + `uv tool install modpoll` read serial devices. `modpoll[serial]` still installs, as an empty extra. +- A verification report whose date is not on the calendar (such as `2026-02-31`) is rejected, as ModioHub + already did on upload. +- modpoll reaches modpoll-wot through its public top-level interface only. + # Modpoll 2.0.0a11 preview Modpoll 2.0.0a11 pins modpoll-wot 0.6.0a3 and is the first release after modsim and modpoll-wot joined this diff --git a/packages/modpoll/docs/site/installation.rst b/packages/modpoll/docs/site/installation.rst index 37e2d7c..82e7f71 100644 --- a/packages/modpoll/docs/site/installation.rst +++ b/packages/modpoll/docs/site/installation.rst @@ -3,11 +3,11 @@ Installation This documentation describes the 2.x functional preview. Install the exact version:: - uv tool install --prerelease allow 'modpoll[serial]==2.0.0a8' + uv tool install --prerelease allow 'modpoll==2.0.0a12' For existing CSV installations use ``uv tool install 'modpoll<2'`` and the `1.x documentation `_. -The preview image is ``topmaker/modpoll:2.0.0a8``; stable ``latest`` stays on 1.x. +The preview image is ``topmaker/modpoll:2.0.0a12``; stable ``latest`` stays on 1.x. See :doc:`v1-compatibility` for tested platforms and hardware limitations. This program is tested on python 3.10+ (Ubuntu 22.04+ or equivalent). Ubuntu 20.04 and python 3.8 are no longer supported. @@ -19,13 +19,9 @@ The package is available in the `Python Package Index `_, .. code-block:: shell - uv tool install --prerelease allow "modpoll==2.0.0a8" + uv tool install --prerelease allow "modpoll==2.0.0a12" -Optionally, pyserial library can be installed for Modbus-RTU communication, - -.. code-block:: shell - - uv tool install --prerelease allow 'modpoll[serial]==2.0.0a8' +Modbus RTU support (pyserial) is included since 2.0.0a12. Run the following command to check if there is new version available, diff --git a/packages/modpoll/pyproject.toml b/packages/modpoll/pyproject.toml index ea0c470..cfffb2e 100644 --- a/packages/modpoll/pyproject.toml +++ b/packages/modpoll/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "modpoll" -version = "2.0.0a11" +version = "2.0.0a12" description = "A New Command-line Tool for Modbus and MQTT" authors = [{ name = "Ying Shaodong", email = "helloysd@gmail.com" }] readme = "README.md" @@ -10,11 +10,14 @@ dependencies = [ "paho-mqtt>=2.1.0,<3.0.0", "prettytable>=3.9.0,<4.0.0", "requests>=2.32.5,<3.0.0", + # Modbus RTU works out of the box; pyserial is pure Python and installs everywhere. + "pyserial>=3.5,<4.0", "modpoll-wot==0.7.0a1", ] [project.optional-dependencies] -serial = ["pyserial>=3.5,<4.0"] +# Kept empty so existing `modpoll[serial]` commands still install. +serial = [] [dependency-groups] dev = [ diff --git a/packages/modsim/docs/preview-notes.md b/packages/modsim/docs/preview-notes.md index 1b02486..09a6d6c 100644 --- a/packages/modsim/docs/preview-notes.md +++ b/packages/modsim/docs/preview-notes.md @@ -1,4 +1,9 @@ -# Modsim 2.0.0a13 preview +# Modsim 2.0.0a14 preview + +Modsim 2.0.0a14 pins modpoll-wot 0.7.0a1 and uses only its public, typed top-level interface. It +changes nothing in the simulator. + +## Modsim 2.0.0a13 preview Modsim 2.0.0a13 pins modpoll-wot 0.6.0a3 and is the first release from the [modpoll repository](https://github.com/top-maker/modpoll/tree/v2/packages/modsim), where modsim, modpoll and diff --git a/packages/modsim/modsim/__init__.py b/packages/modsim/modsim/__init__.py index 607d0e4..6a1f928 100644 --- a/packages/modsim/modsim/__init__.py +++ b/packages/modsim/modsim/__init__.py @@ -1 +1 @@ -__version__ = "2.0.0a13" +__version__ = "2.0.0a14" diff --git a/packages/modsim/pyproject.toml b/packages/modsim/pyproject.toml index 81bec30..7c2e4d2 100644 --- a/packages/modsim/pyproject.toml +++ b/packages/modsim/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "modsim" -version = "2.0.0a13" +version = "2.0.0a14" description = "A Simple Modbus TCP Device Simulator used for modpoll tool" authors = [{ name = "Ying Shaodong", email = "helloysd@gmail.com" }] readme = "README.md" diff --git a/uv.lock b/uv.lock index 8ad4c85..da87909 100644 --- a/uv.lock +++ b/uv.lock @@ -1338,19 +1338,15 @@ wheels = [ [[package]] name = "modpoll" -version = "2.0.0a11" +version = "2.0.0a12" source = { editable = "packages/modpoll" } dependencies = [ { name = "modpoll-wot", marker = "python_full_version < '3.15'" }, { name = "paho-mqtt", marker = "python_full_version < '3.15'" }, { name = "prettytable", marker = "python_full_version < '3.15'" }, { name = "pymodbus", marker = "python_full_version < '3.15'" }, - { name = "requests", marker = "python_full_version < '3.15'" }, -] - -[package.optional-dependencies] -serial = [ { name = "pyserial", marker = "python_full_version < '3.15'" }, + { name = "requests", marker = "python_full_version < '3.15'" }, ] [package.dev-dependencies] @@ -1377,7 +1373,7 @@ requires-dist = [ { name = "paho-mqtt", specifier = ">=2.1.0,<3.0.0" }, { name = "prettytable", specifier = ">=3.9.0,<4.0.0" }, { name = "pymodbus", specifier = "~=3.16.1" }, - { name = "pyserial", marker = "extra == 'serial'", specifier = ">=3.5,<4.0" }, + { name = "pyserial", specifier = ">=3.5,<4.0" }, { name = "requests", specifier = ">=2.32.5,<3.0.0" }, ] provides-extras = ["serial"] @@ -1434,7 +1430,7 @@ dev = [ [[package]] name = "modsim" -version = "2.0.0a13" +version = "2.0.0a14" source = { editable = "packages/modsim" } dependencies = [ { name = "jsonschema", marker = "python_full_version < '3.15'" },