Skip to content

update template, rework the plugin documentation and migrate to cmem-client - #2

Merged
seebi merged 4 commits into
mainfrom
feature/updateTemplate
Sep 5, 2026
Merged

update template, rework the plugin documentation and migrate to cmem-client#2
seebi merged 4 commits into
mainfrom
feature/updateTemplate

Conversation

@seebi

@seebi seebi commented Sep 4, 2026

Copy link
Copy Markdown
Member

Three changes, one per commit.

update to cmem-plugin-template v9.5.0

Updates this repository to cmem-plugin-template v9.5.0 via copier update, and refreshes the locked dependencies that come with it.

rework the user facing plugin documentation

Rewrites the text a user reads inside Corporate Memory for both tasks, grounded in what the code actually does:

  • Python Code workflow task: describes the ports, documents the test_inputs variable of the Validate execution phase action, and adds a Caveats section covering unsandboxed execution, initialization code running on every load, the ten-entity cap and context is None during validation, and the limits of dependency installation.
  • Python Code transform operator: adds the missing task description, a working example and the caveats around scope, packages and repeated execution.
  • Adds descriptions to the initialization code, execution code and source code parameters.
  • Fixes the stale link to the context object documentation (it pointed at the 23.3 docs).

migrate to cmem-client

Removes the deprecated cmem-cmempy usage:

  • install_missing_packages takes a Client and reads client.python_packages instead of cmem.cmempy.workspace.python.
  • The workflow task builds its client with get_client(context) rather than calling setup_cmempy_user_access.
  • Tests use Client.from_env(), and test_install_missing_packages_success gained a fixture which uninstalls example-pypi-package unconditionally before and after the test, so neither a leftover from an earlier run nor a failing test can leave it behind.
  • cmem-cmempy is replaced by cmem-client in pyproject.toml.

This also fixes the Install missing dependencies action, which printed the package name where the installed version belongs, and the documentation no longer points at setup_cmempy_user_access.

Checks

task check passes locally against a live Corporate Memory deployment: ruff, mypy (9 source files), deptry and trivy clean, 12 tests passed.

Replays the template diff onto this repository and refreshes the locked
dependencies that come with it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhUJZ7EwjXm7mN2jAdZzvn
@seebi
seebi requested a review from rpietzsch September 4, 2026 09:55
@seebi

seebi commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Reviewer chosen automatically as part of the template-update sweep.

The main author of this plugin is Sebastian Tramp (62% of the commits touching cmem_plugin_*/ on the default branch), but they could not be assigned:

  • Sebastian Tramp (62%) — opened this request and cannot review it.

So review falls to the next-highest contributor who can be assigned here: René Pietzsch (38% of those commits).

@seebi seebi self-assigned this Sep 4, 2026
@seebi

seebi commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Taking this one as maintainer. I am the main author of this plugin (62% of the commits touching cmem_plugin_*/ on the default branch), so I will review and merge it myself.

GitHub does not allow requesting a review from the author of a pull request, so this is recorded as an assignment instead of a review request. The automatically chosen reviewer (@rpietzsch) has been removed from this pull request, since review falls to me.

@seebi
seebi removed the request for review from rpietzsch September 4, 2026 16:54
seebi and others added 2 commits September 4, 2026 21:38
- Python Code workflow task: describe ports and defaults up front, document
  the `test_inputs` variable used by the "Validate execution phase" action,
  and add a caveats section (no sandbox, initialization code running on every
  load, validation without an execution context, dependency handling)
- Python Code transform operator: add the missing task description, a working
  example and its own caveats
- add descriptions to the initialization code, execution code and source code
  parameters, and reword the action descriptions
- document `get_client` instead of the deprecated `setup_cmempy_user_access`
- fix the stale link to the context object documentation
- add a fixture which uninstalls example-pypi-package before and after
  test_install_missing_packages_success

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018CbvDZvVCY8JzWn9uJT6rc
Replace the deprecated cmem-cmempy usage with cmem-client:

- package_management.install_missing_packages takes a Client and uses
  client.python_packages instead of cmem.cmempy.workspace.python
- the workflow task builds its client with get_client(context) instead of
  calling setup_cmempy_user_access
- the tests use Client.from_env() and delete_item(..., skip_if_missing=True)
- cmem-cmempy is replaced by cmem-client in pyproject.toml

Along the way this fixes the "already installed" message, which repeated the
package name where the installed version belongs, and drops the last mention
of setup_cmempy_user_access from the task documentation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018CbvDZvVCY8JzWn9uJT6rc
@seebi seebi changed the title update to cmem-plugin-template v9.5.0 update template, rework the plugin documentation and migrate to cmem-client Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Coverage

Coverage Report
File Stmts Miss Cover Missing
init.py 0 0 100%
package_management.py 19 0 100%
test_transform_operator.py 17 0 100%
workflow_task.py 109 0 100%
TOTAL 145 0 100%  

Tests Skipped Failures Errors Time
12 0 💤 0 ❌ 0 🔥 39.977 ⏱

tests/utils.py defines the needs_cmem marker described by the plugin-testing
skill, and the tests which construct a Client, a TestExecutionContext or a
TestPluginContext now carry it. Without a populated .env the suite reports 6
passed and 6 skipped instead of erroring, so a fresh clone can run task check.

tests/fixtures/cmem-plugin-python-testing.project.zip is an export of a
DataIntegration project which drives both plugins against a real deployment -
port negotiation, dependency installation, SPARQL reads and writes through
cmem-client, and the transform operator - none of which a unit test reaches.
README.md says how to import and run it, and records the two workflows which
fail on a finding: a Python task with a flexible schema input port cannot be
fed by a JSON dataset, reported as cmem-plugin-template#79.

CLAUDE.md carries the project specific agent instructions the template never
writes: the two phase model of the workflow task, the documentation string
which doubles as the test corpus, and what the test suite does to a deployment.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q2PdymJgUZnA8KZKMEiUvm
@seebi
seebi merged commit cf10859 into main Sep 5, 2026
2 checks passed
@seebi
seebi deleted the feature/updateTemplate branch September 5, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant