Skip to content

Bundle store-tcs.properties as package data and pass via --store-tcs to all getscu calls - #65

Merged
akhanf merged 3 commits into
masterfrom
copilot/update-getscu-calls-to-use-store-tcs-properties
Jul 14, 2026
Merged

akhanf merged 3 commits into
masterfrom
copilot/update-getscu-calls-to-use-store-tcs-properties

Conversation

Copilot AI commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

store-tcs.properties was previously provided by the dcm4che-tools conda package, making it fragile to update and unavailable in non-conda installs. This bundles the file directly in the Python package and wires it into every getscu invocation.

Changes

  • cfmm2tar/data/store-tcs.properties — Copies the file from share/dcm4che/etc/getscu/ into the package so it's included as wheel/editable package data
  • cfmm2tar/dcm4che_utils.py — Resolves the bundled file path at module load via importlib.resources; appends --store-tcs <path> to _getscu_str in _build_commands
  • tests/test_dcm4che_utils.py — Asserts --store-tcs and store-tcs.properties appear in _getscu_str

The resolved path is set once at module import:

from importlib.resources import files as _resource_files
_STORE_TCS_PATH = str(_resource_files("cfmm2tar").joinpath("data/store-tcs.properties"))

And injected into every getscu command:

+ f" --store-tcs {shlex.quote(_STORE_TCS_PATH)} "

@akhanf
akhanf changed the base branch from explicit-store-tcs to master July 14, 2026 14:48
@akhanf
akhanf marked this pull request as ready for review July 14, 2026 17:46
@akhanf
akhanf merged commit fa9cb5e into master Jul 14, 2026
2 checks passed
@akhanf
akhanf deleted the copilot/update-getscu-calls-to-use-store-tcs-properties branch July 14, 2026 17:46
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.

2 participants