Replace cmem-cmempy with cmem-client - #43
Open
msaipraneeth wants to merge 13 commits into
Open
Conversation
…t param get_file_resource lives on DatasetsRepository, not FilesRepository - corrected in both the implementation and the plan doc.
Covers the previously-untested surfaces from the cmempy -> cmem-client migration: the deprecated setup_cmempy_user_access/ setup_cmempy_super_user_access wrappers, the new setup_cmem_client_super_user_access client-credentials path (including its DEPLOY_BASE_URL fallback and missing-config error), setup_cmem_client's guard clauses, DatasetParameterType.label() and its dataset_type filter, GraphParameterType's system-graph/unclassified-graph branches, and the explicit-client half of File.read_stream's hybrid client/ambient-fallback design. utils/__init__.py, parameter/dataset.py and parameter/resource.py now sit at 100% line coverage; parameter/graph.py at 96%.
…hared instance Several needs_cmem tests were leaving orphaned projects/graphs on the shared plugin-testing instance whenever a run didn't reach teardown, which then broke every subsequent run with "already exists" errors. Fixtures and the graph parameter test now delete-then-create their fixtures for idempotency, and test project names carry a common cmem_plugin_base_ prefix for easier identification on the shared instance. Also fixes four setup_cmem_client tests that hardcoded http://docker.localhost and the cmem-client library's placeholder OAuth secret, neither of which is reachable/valid against CI's actual shared test instance. They now reuse the already-configured ambient CMEM_BASE_URI/OAUTH_CLIENT_SECRET instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmem-cmempydependency withcmem-client(eccenca's typed, httpx-based successor) acrosscmem_plugin_baseand the test suitesetup_cmempy_user_access/setup_cmempy_super_user_accessare kept as deprecated wrappers around newsetup_cmem_client/setup_cmem_client_super_user_accessfunctions that return a ready-to-usecmem_client.Client, so downstream plugins calling the old names keep workingFile.read_streamand its convenience methods (is_text,read_bytes,text_stream, etc.) gain an optionalclientparameter, falling back to an ambientClient.from_env()for existing single-argument callerswrite_to_datasetnow returnsNone(wasrequests.Response) and raiseshttpx.HTTPStatusError(wasrequests.exceptions.HTTPError) on failed uploads — documented in the CHANGELOGTest plan
ruff check/ruff format --checkontestsandcmem_plugin_basemypy -p tests -p cmem_plugin_basedeptry .(no dependency issues,cmem-cmempyfully uninstalled viapoetry sync)grep -rn "cmem\.cmempy" cmem_plugin_base tests— no matchespytestrun against a live Corporate Memory instance (CMEM_BASE_URI) — 42 passed, 1 pre-existing unrelated skip