clams-python 1.6.0__tar.gz → 1.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. clams_python-1.7.1/.github/workflows/release-check.yml +11 -0
  2. {clams_python-1.6.0 → clams_python-1.7.1}/CHANGELOG.md +83 -0
  3. {clams_python-1.6.0 → clams_python-1.7.1}/CONTRIBUTING.md +7 -0
  4. {clams_python-1.6.0/clams_python.egg-info → clams_python-1.7.1}/PKG-INFO +7 -2
  5. clams_python-1.7.1/build-tools/prep_release.py +104 -0
  6. {clams_python-1.6.0 → clams_python-1.7.1}/clams/app/__init__.py +774 -7
  7. {clams_python-1.6.0 → clams_python-1.7.1}/clams/appmetadata/__init__.py +21 -0
  8. clams_python-1.7.1/clams/backends/__init__.py +9 -0
  9. clams_python-1.7.1/clams/backends/hf.py +247 -0
  10. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/__init__.py +16 -2
  11. clams_python-1.7.1/clams/develop/templates/app/app.py.template +119 -0
  12. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/app/metadata.py.template +44 -3
  13. clams_python-1.7.1/clams/develop/templates/utl-tf/__init__.py.template +0 -0
  14. clams_python-1.7.1/clams/develop/templates/utl-tf/timeframe.py.template +154 -0
  15. {clams_python-1.6.0 → clams_python-1.7.1/clams_python.egg-info}/PKG-INFO +7 -2
  16. {clams_python-1.6.0 → clams_python-1.7.1}/clams_python.egg-info/SOURCES.txt +10 -1
  17. {clams_python-1.6.0 → clams_python-1.7.1}/clams_python.egg-info/requires.txt +7 -1
  18. clams_python-1.7.1/documentation/app-baseclasses.rst +521 -0
  19. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/conf.py +0 -20
  20. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/index.rst +1 -0
  21. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/introduction.rst +4 -1
  22. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/modules.rst +1 -0
  23. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/runtime-params.rst +14 -0
  24. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/target-versions.csv +6 -1
  25. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/tutorial.md +6 -6
  26. {clams_python-1.6.0 → clams_python-1.7.1}/pyproject.toml +4 -1
  27. clams_python-1.7.1/tests/test_backends_hf.py +450 -0
  28. {clams_python-1.6.0 → clams_python-1.7.1}/tests/test_clamsapp.py +27 -0
  29. clams_python-1.7.1/tests/test_promptable.py +585 -0
  30. clams_python-1.6.0/clams/develop/templates/app/app.py.template +0 -74
  31. {clams_python-1.6.0 → clams_python-1.7.1}/.github/workflows/codecov.yml +0 -0
  32. {clams_python-1.6.0 → clams_python-1.7.1}/.github/workflows/container.yml +0 -0
  33. {clams_python-1.6.0 → clams_python-1.7.1}/.github/workflows/containers.yml +0 -0
  34. {clams_python-1.6.0 → clams_python-1.7.1}/.github/workflows/issue-assign.yml +0 -0
  35. {clams_python-1.6.0 → clams_python-1.7.1}/.github/workflows/issue-close.yml +0 -0
  36. {clams_python-1.6.0 → clams_python-1.7.1}/.github/workflows/issue-infra-project.yml +0 -0
  37. {clams_python-1.6.0 → clams_python-1.7.1}/.github/workflows/publish.yml +0 -0
  38. {clams_python-1.6.0 → clams_python-1.7.1}/.gitignore +0 -0
  39. {clams_python-1.6.0 → clams_python-1.7.1}/.pytype.cfg +0 -0
  40. {clams_python-1.6.0 → clams_python-1.7.1}/LICENSE +0 -0
  41. {clams_python-1.6.0 → clams_python-1.7.1}/README.md +0 -0
  42. {clams_python-1.6.0 → clams_python-1.7.1}/build-tools/build.py +0 -0
  43. {clams_python-1.6.0 → clams_python-1.7.1}/build-tools/clean.py +0 -0
  44. {clams_python-1.6.0 → clams_python-1.7.1}/build-tools/docs.py +0 -0
  45. {clams_python-1.6.0 → clams_python-1.7.1}/build-tools/publish.py +0 -0
  46. {clams_python-1.6.0 → clams_python-1.7.1}/build-tools/test.py +0 -0
  47. {clams_python-1.6.0 → clams_python-1.7.1}/clams/__init__.py +0 -0
  48. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/app/.dockerignore.template +0 -0
  49. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/app/.gitignore.template +0 -0
  50. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/app/Containerfile.template +0 -0
  51. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/app/LICENSE.template +0 -0
  52. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/app/README.md.template +0 -0
  53. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/app/cli.py.template +0 -0
  54. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/app/requirements.txt.template +0 -0
  55. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/gha/for-clams-team.md.template +0 -0
  56. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/gha/workflows/issue-apps-project.yml.template +0 -0
  57. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/gha/workflows/issue-assign.yml.template +0 -0
  58. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/gha/workflows/issue-close.yml.template +0 -0
  59. {clams_python-1.6.0 → clams_python-1.7.1}/clams/develop/templates/gha/workflows/publish.yml.template +0 -0
  60. {clams_python-1.6.0 → clams_python-1.7.1}/clams/envelop/__init__.py +0 -0
  61. {clams_python-1.6.0 → clams_python-1.7.1}/clams/restify/__init__.py +0 -0
  62. {clams_python-1.6.0 → clams_python-1.7.1}/clams/serve/__init__.py +0 -0
  63. {clams_python-1.6.0 → clams_python-1.7.1}/clams/ver/__init__.py +0 -0
  64. {clams_python-1.6.0 → clams_python-1.7.1}/clams_python.egg-info/dependency_links.txt +0 -0
  65. {clams_python-1.6.0 → clams_python-1.7.1}/clams_python.egg-info/entry_points.txt +0 -0
  66. {clams_python-1.6.0 → clams_python-1.7.1}/clams_python.egg-info/top_level.txt +0 -0
  67. {clams_python-1.6.0 → clams_python-1.7.1}/container/Containerfile +0 -0
  68. {clams_python-1.6.0 → clams_python-1.7.1}/container/ffmpeg-hf.containerfile +0 -0
  69. {clams_python-1.6.0 → clams_python-1.7.1}/container/ffmpeg-hf4.containerfile +0 -0
  70. {clams_python-1.6.0 → clams_python-1.7.1}/container/ffmpeg-hf5.containerfile +0 -0
  71. {clams_python-1.6.0 → clams_python-1.7.1}/container/ffmpeg-tf2.containerfile +0 -0
  72. {clams_python-1.6.0 → clams_python-1.7.1}/container/ffmpeg-torch2.containerfile +0 -0
  73. {clams_python-1.6.0 → clams_python-1.7.1}/container/ffmpeg.containerfile +0 -0
  74. {clams_python-1.6.0 → clams_python-1.7.1}/container/generate_containers_yml.py +0 -0
  75. {clams_python-1.6.0 → clams_python-1.7.1}/container/hf.containerfile +0 -0
  76. {clams_python-1.6.0 → clams_python-1.7.1}/container/hf4.containerfile +0 -0
  77. {clams_python-1.6.0 → clams_python-1.7.1}/container/hf5.containerfile +0 -0
  78. {clams_python-1.6.0 → clams_python-1.7.1}/container/jdk8.containerfile +0 -0
  79. {clams_python-1.6.0 → clams_python-1.7.1}/container/opencv4-hf.containerfile +0 -0
  80. {clams_python-1.6.0 → clams_python-1.7.1}/container/opencv4-hf4.containerfile +0 -0
  81. {clams_python-1.6.0 → clams_python-1.7.1}/container/opencv4-hf5.containerfile +0 -0
  82. {clams_python-1.6.0 → clams_python-1.7.1}/container/opencv4-tf2.containerfile +0 -0
  83. {clams_python-1.6.0 → clams_python-1.7.1}/container/opencv4-torch2.containerfile +0 -0
  84. {clams_python-1.6.0 → clams_python-1.7.1}/container/opencv4.containerfile +0 -0
  85. {clams_python-1.6.0 → clams_python-1.7.1}/container/tf2.containerfile +0 -0
  86. {clams_python-1.6.0 → clams_python-1.7.1}/container/torch2.containerfile +0 -0
  87. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/appdirectory.rst +0 -0
  88. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/appmetadata.rst +0 -0
  89. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/autodoc/clams.app.rst +0 -0
  90. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/autodoc/clams.appmetadata.rst +0 -0
  91. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/autodoc/clams.mmif_utils.rst +0 -0
  92. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/autodoc/clams.restify.rst +0 -0
  93. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/clamsapp.rst +0 -0
  94. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/cli.rst +0 -0
  95. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/gpu-apps.rst +0 -0
  96. {clams_python-1.6.0 → clams_python-1.7.1}/documentation/input-output.rst +0 -0
  97. {clams_python-1.6.0 → clams_python-1.7.1}/setup.cfg +0 -0
  98. {clams_python-1.6.0 → clams_python-1.7.1}/tests/metadata.py +0 -0
  99. {clams_python-1.6.0 → clams_python-1.7.1}/tests/pillow-logo.png +0 -0
  100. {clams_python-1.6.0 → clams_python-1.7.1}/tests/test_envelope.py +0 -0
@@ -0,0 +1,11 @@
1
+ name: "🔖 Release PR check"
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+ types: [opened, synchronize, reopened, edited]
7
+
8
+ jobs:
9
+ release-check:
10
+ name: "🤙 Call SDK release-check workflow"
11
+ uses: clamsproject/.github/.github/workflows/sdk-release-check.yml@main
@@ -1,4 +1,38 @@
1
1
 
2
+ ## releasing 1.7.0 (2026-05-29)
3
+ ### Overview
4
+ This release introduces a specialized base class `ClamsPromptableApp` and its HuggingFace specialization `ClamsHFPromptableApp` for CLAMS apps that wrap LLM / VLM / ALM / LMM-based analyzers, along with other HF-related helper code in various places. Additionally, it adds `appTags` field for app categorization in app metadata, and new timeframe related local utility recipe for `clams develop --recipe utl-tf` scaffold.
5
+
6
+ ### Additions
7
+ * `ClamsPromptableApp`, a new specialized base class (subclassing `ClamsApp`) for prompt-driven, instruction-tuned LLM apps with pre-equipped with commonly used runtime parameter set (`prompt`, `systemPrompt`, `promptMode`, `maxNewTokens`, `temperature`, `topP`, `topK`, `parallelPrompts`). Plus, `ClamsHFPromptableApp` (subclassing `ClamsPromptableApp`) for the common case of "promptable app + local HuggingFace `transformers` model". This subclass should significanly simplify wrapping HF models into a CLAMS app. See https://clams.ai/clams-python/app-baseclasses.html for the developer guide. (https://github.com/clamsproject/clams-python/pull/291)
8
+ * `clams.backends.hf` (new module) with two general HF loaders: `load_hf_model` (`from_pretrained` flow) and `load_hf_pipeline` (`transformers.pipeline` flow). Wraps the device auto-detection, revision pinning, dtype handling, and kwargs pass-through that every HF-backed CLAMS app does identically; used internally by `ClamsHFPromptableApp` and callable directly from any non-promptable HF app. Requires the `[hf]` extra (`pip install clams-python[hf]`) to keep `torch` and `transformers` out of the base install.
9
+ * `clams develop --recipe utl-tf` scaffold drops a `utils/timeframe.py` into the new app that factors out the canonical TimeFrame iteration / `vdh.extract_images_by_mode_with_sources` / TimePoint-on-fallback / task-tuple pattern. (7bc91d97ff0af2a2253ca24b00afa8b554ad5849)
10
+ * `appTags` field on `AppMetadata`, a sibling to https://github.com/clamsproject/mmif/pull/253. Allows categorization of CLAMS apps for app-directory search / filtering. (https://github.com/clamsproject/clams-python/pull/290)
11
+
12
+ ### Changes
13
+ * Updated to the latest `mmif-python` SDK (1.5.0).
14
+ * Tightened the semantics of the `AppMetadata.analyzer_versions` field (introduced in 1.4.0) for CHFPApp-based development. When an app subclasses `ClamsHFPromptableApp`, the dict is now the source of truth for the family of supported HF model IDs and their pinned commit hashes: the SDK auto-derives a `model` runtime parameter from the dict's keys, and the HF base class refines `model=<id>` into `model=<id>@<revision>` on output so the resolved revision lands in `view.metadata.appConfiguration` automatically.
15
+ * `clams develop` scaffold templates (`app.py.template`, `metadata.py.template`) updated with commented-out blocks for both promptable variants.
16
+
17
+
18
+ ## releasing 1.6.0 (2026-05-19)
19
+ ### Overview
20
+
21
+ This release adds an optional JSON "envelope" input format for passing complex or long runtime parameters to apps, migrates the build system to `pyproject.toml`, and expands runtime-parameter documentation.
22
+
23
+ ### Additions
24
+
25
+ * Parameter envelope: in addition to query strings or `--flag`-like CLI args, apps now accept a JSON envelope (`{"parameters": {...}, "mmif": {...}}`) as input. This enables long prompts and structured (map/array) parameter values that do not fit nicely in URL query strings. The envelope is auto-detected, explicit parameters (query string or cli flags) take priority over envelope values, and app output is always raw MMIF so existing pipelines are unaffected (https://github.com/clamsproject/clams-python/pull/287).
26
+ * `clams envelop` CLI subcommand and a `clams.create_envelope()` Python API for constructing envelope JSON from a parameter file (or dict) and an MMIF read from a file or stdin (https://github.com/clamsproject/clams-python/pull/287).
27
+
28
+ ### Changes
29
+
30
+ * Updated to `mmif-python` 1.4.0.
31
+ * Build system migrated from `setup.py` to `pyproject.toml` with `setuptools-scm` versioning; the CI and documentation publishing pipeline was standardized accordingly (https://github.com/clamsproject/clams-python/pull/286).
32
+ * Expanded runtime-parameter documentation, including detailed parameter-type reference and a warning emitted when a colon appears in a `map`-type parameter key (https://github.com/clamsproject/clams-python/pull/284).
33
+
34
+
35
+
2
36
  ## releasing 1.5.0 (2026-03-12)
3
37
  ### Overview
4
38
 
@@ -15,6 +49,7 @@ Adds `tfSamplingMode` as a universal runtime parameter and overhauls container i
15
49
  > [!NOTE]
16
50
  > This release requires `mmif-python >= 1.3.0` for the sampling mode API.
17
51
 
52
+
18
53
  ## releasing 1.4.0 (2025-11-30)
19
54
  ### Overview
20
55
  This release introduces three new fields to the app metadata to improve the orchestration and handling of large models within apps.
@@ -32,11 +67,13 @@ This release introduces three new fields to the app metadata to improve the orch
32
67
  * VRAM usage record: Apps running on CUDA and `torch` now cache VRAM usage statistics in the local disk cache (typically in `$XDG_CACHE_HOME`) (https://github.com/clamsproject/clams-python/issues/243). Currently, this information is for logging only, and we plan to add a retrieval API in the future.
33
68
  * See current _private_ implementation at https://github.com/clamsproject/clams-python/blob/671560b184a3b73bf417db753d0fa8f1c73d3bda/clams/app/__init__.py#L348-L361
34
69
 
70
+
35
71
  ## releasing 1.3.3 (2025-07-28)
36
72
  ### Overview
37
73
  Updated `mmif-python` version that includes a hotfix for reading 1.0.x MMIF
38
74
 
39
75
 
76
+
40
77
  ## releasing 1.3.2 (2025-07-26)
41
78
  ### Overview
42
79
  Patch release, mainly to support new MMIF spec and corresponding `mmif-python` SDK versions, with more base images with HF libraries and miscellaneous fixes.
@@ -51,6 +88,7 @@ Patch release, mainly to support new MMIF spec and corresponding `mmif-python` S
51
88
  * Minor bugfixes and documentation improvements.
52
89
 
53
90
 
91
+
54
92
  ## releasing 1.3.1 (2024-07-29)
55
93
  ### Overview
56
94
  This patch includes update to the latest `mmif-python` which contains a hot fix for a critical bug.
@@ -59,6 +97,7 @@ This patch includes update to the latest `mmif-python` which contains a hot fix
59
97
  - based on `mmif-python==1.0.19`
60
98
 
61
99
 
100
+
62
101
  ## releasing 1.3.0 (2024-07-22)
63
102
  ### Overview
64
103
  This version added two universal runtime parameters that make some aspects of the runtime environment are recorded in the views' metadata.
@@ -71,6 +110,7 @@ This version added two universal runtime parameters that make some aspects of th
71
110
 
72
111
 
73
112
 
113
+
74
114
  ## releasing 1.2.6 (2024-07-15)
75
115
  ### Overview
76
116
  Patch release to update mmif SDK version, and minor improvements
@@ -83,6 +123,7 @@ Patch release to update mmif SDK version, and minor improvements
83
123
  - bug fix "raw" runtime parameters weren't properly recorded when an app fails to refine the parameters (https://github.com/clamsproject/clams-python/issues/232)
84
124
 
85
125
 
126
+
86
127
  ## releasing 1.2.5 (2024-06-26)
87
128
  ### Overview
88
129
  Patch release to fix an error in app cookie cutter, also updated to the latest MMIF and mmif-python.
@@ -91,6 +132,7 @@ Patch release to fix an error in app cookie cutter, also updated to the latest M
91
132
  - updated `mmif-python` to 1.0.17
92
133
  - fixed `Containerfile` from the app cookie cutter wasn't building an image due to an error
93
134
 
135
+
94
136
  ## releasing 1.2.4 (2024-06-14)
95
137
  ### Overview
96
138
  Patches bug in `clams develop` command and updated in documentation and `mmif-python` version
@@ -102,6 +144,7 @@ Patches bug in `clams develop` command and updated in documentation and `mmif-py
102
144
  * updated app development documentation
103
145
 
104
146
 
147
+
105
148
  ## releasing 1.2.3 (2024-06-07)
106
149
  ### Overview
107
150
  This version includes significant change to app development template, with some other changes
@@ -118,6 +161,7 @@ This version includes significant change to app development template, with some
118
161
  - updated to `mmif-python` 1.0.15
119
162
 
120
163
 
164
+
121
165
  ## releasing 1.2.2 (2024-05-14)
122
166
  ### Overview
123
167
  This is minor patch with bug fix for parameter handling
@@ -127,6 +171,7 @@ This is minor patch with bug fix for parameter handling
127
171
  * updated to the latest `mmif-python` (1.0.14)
128
172
 
129
173
 
174
+
130
175
  ## releasing 1.2.1 (2024-04-21)
131
176
  ### Overview
132
177
  This release includes documentation updates and bug fixes
@@ -138,6 +183,7 @@ This release includes documentation updates and bug fixes
138
183
  * fixed a bug where raw user input parameters with `multivalued=True` were not fully recorded in the output MMIF view metadata (https://github.com/clamsproject/clams-python/issues/214)
139
184
 
140
185
 
186
+
141
187
  ## releasing 1.2.0 (2024-04-11)
142
188
  ### Overview
143
189
  This is a minor release that brings improved portability of `clams source` command but also breaks some backward compatibility. If your app is based on clams-python 1.0.x or 1.1.x, please read the changelog carefully.
@@ -147,6 +193,7 @@ This is a minor release that brings improved portability of `clams source` comma
147
193
  - `ClamsApp.sign_view` method now expect the runtime parameters (dict of string to lists of values) as a second argument. Previously the second argument was optional, which is no more. CLAMS app developers who were calling this method in `_annotate()` method must directly pass down the runtime parameters from `_annotate()` argument.
148
194
 
149
195
 
196
+
150
197
  ## releasing 1.1.6 (2024-04-02)
151
198
  ### Overview
152
199
  Minor release to update the `mmif-python` dependency to the latest.
@@ -155,6 +202,7 @@ Minor release to update the `mmif-python` dependency to the latest.
155
202
  * now based on `mmif-python==1.0.13` including a hotfix for a wrong field name in MMIF serialization.
156
203
 
157
204
 
205
+
158
206
  ## releasing 1.1.5 (2024-04-01)
159
207
  ### Overview
160
208
  Hot-fix to fix some compatibility issues in the app develop template
@@ -163,6 +211,7 @@ Hot-fix to fix some compatibility issues in the app develop template
163
211
  * reverted some changes from 3ed54b3 due to broken backward compatibility
164
212
 
165
213
 
214
+
166
215
  ## releasing 1.1.4 (2024-03-31)
167
216
  ### Overview
168
217
  This release includes many changes regarding runtime parameters.
@@ -177,6 +226,7 @@ This release includes many changes regarding runtime parameters.
177
226
  * input and output type properties can be (under-)specified as wildcards (#194)
178
227
 
179
228
 
229
+
180
230
  ## releasing 1.1.3 (2024-03-04)
181
231
  ### Overview
182
232
  This is a minor release to catch up new version of MMIF and `mmif-python`.
@@ -187,6 +237,7 @@ This is a minor release to catch up new version of MMIF and `mmif-python`.
187
237
 
188
238
 
189
239
 
240
+
190
241
  ## releasing 1.1.2 (2024-02-10)
191
242
  ### Overview
192
243
  This release updates to the latest MMIF and `mmif-python`
@@ -195,6 +246,7 @@ This release updates to the latest MMIF and `mmif-python`
195
246
  * Now based on `mmif-python` 1.0.9 and MMIF 1.0.1
196
247
 
197
248
 
249
+
198
250
  ## releasing 1.1.1 (2024-02-05)
199
251
  ### Overview
200
252
  This release contains minor fixes in code and updates in documentations regarding changes in runtime parameter in the previous 1.1.0 release.
@@ -204,6 +256,7 @@ This release contains minor fixes in code and updates in documentations regardin
204
256
  * fixed outdated information regarding usage of `get_configuration` in various documentation
205
257
  * fixed `properties` in I/O specification in AppMetadata are unfairly restricted to `str` values
206
258
 
259
+
207
260
  ## releasing 1.1.0 (2024-01-31)
208
261
  ### Overview
209
262
  This is a minor-level release that fixes various bugs and adds safeguards for possible inconsistency in output MMIFs.
@@ -242,6 +295,7 @@ optional arguments:
242
295
  * fixed a bug in app metadata generation (https://github.com/clamsproject/clams-python/issues/187)
243
296
 
244
297
 
298
+
245
299
  ## releasing 1.0.9 (2023-07-24)
246
300
  ### Overview
247
301
  Minor release to update small issues in the app develop template.
@@ -249,6 +303,7 @@ Minor release to update small issues in the app develop template.
249
303
  ### Changes
250
304
  * `metadata.py` from the template now includes *universal* parameters when printing out the app metadata.
251
305
 
306
+
252
307
  ## releasing 1.0.8 (2023-07-24)
253
308
  ### Overview
254
309
  Minor release to update `mmif-python` version
@@ -257,6 +312,7 @@ Minor release to update `mmif-python` version
257
312
  * updated to `mmif-python==1.0.8`
258
313
  * enabled a python logger for clams-apps as `self.logger`
259
314
 
315
+
260
316
  ## releasing 1.0.7 (2023-07-20)
261
317
  ### Overview
262
318
  This release includes a bugfix and update to the latest mmif-python
@@ -266,6 +322,7 @@ This release includes a bugfix and update to the latest mmif-python
266
322
  * fixed some runtime parameters' default values not correctly casted (#173 )
267
323
 
268
324
 
325
+
269
326
  ## releasing 1.0.6 (2023-07-19)
270
327
  ### Overview
271
328
  Minor release to update `mmif-python` version
@@ -274,6 +331,7 @@ Minor release to update `mmif-python` version
274
331
  * updated to `mmif-python==1.0.5`
275
332
 
276
333
 
334
+
277
335
  ## releasing 1.0.5 (2023-07-19)
278
336
  ### Overview
279
337
  Minor release to update `mmif-python` version
@@ -282,6 +340,7 @@ Minor release to update `mmif-python` version
282
340
  * updated to `mmif-python==1.0.5`
283
341
 
284
342
 
343
+
285
344
  ## releasing 1.0.4 (2023-07-19)
286
345
  ### Overview
287
346
  This release include many updates to documentation, and `clams source --scheme` flag.
@@ -294,6 +353,7 @@ This release include many updates to documentation, and `clams source --scheme`
294
353
  * added validation step for parameters with fixed options (#164)
295
354
 
296
355
 
356
+
297
357
  ## releasing 1.0.3 (2023-06-14)
298
358
  ### Overview
299
359
  This release include minor bug fixes.
@@ -304,6 +364,7 @@ This release include minor bug fixes.
304
364
  * fixed #155
305
365
 
306
366
 
367
+
307
368
  ## releasing 1.0.2 (2023-06-02)
308
369
  ### Overview
309
370
  This release is a minor patch; see below.
@@ -311,6 +372,7 @@ This release is a minor patch; see below.
311
372
  ### Changes
312
373
  * fixed a filename bug that prevented some files from being copied to a newly generate app template.
313
374
 
375
+
314
376
  ## releasing 1.0.1 (2023-05-26)
315
377
  ### Overview
316
378
  This release is about updating to `mmif-python==1.0.1`, which is based on MMIF 1.0.0.
@@ -319,6 +381,7 @@ This release is about updating to `mmif-python==1.0.1`, which is based on MMIF 1
319
381
  * uses `mmif-python==1.0.1`
320
382
  * updated some names for upcoming pedantic v2 update
321
383
 
384
+
322
385
  ## releasing 1.0.0 (2023-05-26)
323
386
  ### Overview
324
387
  This release will be numbered as 1.0.0, but indeed it's a minor update from 0.6.3.
@@ -351,6 +414,7 @@ optional arguments:
351
414
  * "generic" readme file in the app template is replaced with a link to the generic user manual (soon be) published to `apps.clams.ai`.
352
415
  * now based on `mmif-python` and MMIF 1.0.0.
353
416
 
417
+
354
418
  ## releasing 0.6.3 (2023-05-20)
355
419
  ### Overview
356
420
  This is a minor release
@@ -361,6 +425,7 @@ This is a minor release
361
425
  ### Changes
362
426
  * protocol string used in the base url to generate app identifiers is now reverted back to `http` from `https` for consistency (all documentations of ours are using `http` in the base URL in any URI/IRI field).
363
427
 
428
+
364
429
  ## releasing 0.6.2 (2023-05-19)
365
430
  ### Overview
366
431
  This release includes all the `clamsproject`-specific GHA workflow files in the PyPI distribution.
@@ -368,6 +433,7 @@ This release includes all the `clamsproject`-specific GHA workflow files in the
368
433
  ### Changes
369
434
  * fixed GHA workflow files were missing in the sdist uploaded to PyPI (#143)
370
435
 
436
+
371
437
  ## releasing 0.6.1 (2023-05-19)
372
438
  ### Overview
373
439
  This release is based on a new version of `mmif-python` [0.5.2](https://github.com/clamsproject/mmif-python/blob/main/CHANGELOG.md#releasing-052-2023-05-19). Additionally, this release includes significant updates in documentation both in sphinx API documentation (website) and app starter-kit documentation, huge upgrades in GHA workflows in app-dev template, and finally small (but critical) bug fixes.
@@ -384,6 +450,7 @@ This release is based on a new version of `mmif-python` [0.5.2](https://github.c
384
450
  * fixed `@` sign wasn't properly serialized from `metadata.py`.
385
451
 
386
452
 
453
+
387
454
  ## releasing 0.6.0 (2023-05-03)
388
455
  ### Overview
389
456
  This release contains big changes and new features, including "breaking" ones. All CLAMS apps using `clams-python==0.5.*` are recommended to update to this release.
@@ -423,6 +490,7 @@ optional arguments:
423
490
  * The big change in the MMIF 0.5.0 is the change in the CLAMS vocab type versioning scheme. And as now the responsibility of vocab type version checking is pushed down to the `mmif-python` library, `clams-python` no longer checks any version numbers in an input MMIF file.
424
491
  * FYI, here's how vocab type versions are "checked" when comparing two `AnnotationTypes.SomeType` enum-like objects: https://github.com/clamsproject/mmif-python/blob/88040395b7349f49058a9bf315628bed426e3d51/templates/python/vocabulary/base_types.txt#L152-L166
425
492
 
493
+
426
494
  ## releasing 0.5.3 (2023-03-20)
427
495
  ### Overview
428
496
  This release includes update to the latest MMIF / `mmif-python`, and big improvements on handling runtime parameters.
@@ -435,12 +503,15 @@ This release includes update to the latest MMIF / `mmif-python`, and big improve
435
503
  * fixed bugs around setting default values for `bool` type runtime parameters (#111)
436
504
 
437
505
 
506
+
438
507
  ## releasing 0.5.2 (2023-02-02)
439
508
  This release contains updates of the python version (#102) and "uncapping" of python dependencies (#89), and a small update in handling `pretty` (and future "universal") parameter (#99).
440
509
 
510
+
441
511
  ## releasing 0.5.1 (2022-03-25)
442
512
  This release contains fixes in the development pipelines (#97 ) and dependency ( #95).
443
513
 
514
+
444
515
  ## releasing 0.5.0 (2021-07-24)
445
516
  This release contains changes in `AppMetadata` scheme and bug fix in `Restifier`.
446
517
 
@@ -451,11 +522,13 @@ This release contains changes in `AppMetadata` scheme and bug fix in `Restifier`
451
522
  * `wrappee_version` -> `analyzer_version`
452
523
  * `wrappee_license` -> `analyzer_license`
453
524
 
525
+
454
526
  ## releasing 0.4.4 (2021-07-11)
455
527
  This release includes bug fixes from mmif-python package, loosened ML library versions in docker images.
456
528
 
457
529
 
458
530
 
531
+
459
532
  ## releasing 0.4.3 (2021-06-19)
460
533
  This release contains various fixes and improvements.
461
534
 
@@ -467,6 +540,7 @@ This release contains various fixes and improvements.
467
540
  * (changed) `AppMetadata.add_parameter` now has a proper signature for IDE hints
468
541
 
469
542
 
543
+
470
544
  ## releasing 0.4.2 (2021-06-17)
471
545
  This release contains bugfixes
472
546
 
@@ -475,6 +549,7 @@ This release contains bugfixes
475
549
  - updated latest mmif-python
476
550
 
477
551
 
552
+
478
553
  ## releasing 0.4.1 (2021-06-14)
479
554
  This release includes minor API improvement ...
480
555
 
@@ -482,11 +557,13 @@ This release includes minor API improvement ...
482
557
  * `AppMetadata` class can be imported from `clams` package directly
483
558
 
484
559
 
560
+
485
561
  ## releasing 0.4.0 (2021-06-14)
486
562
  This release includes
487
563
  * input MMIF file compatibility check (#60 )
488
564
  * upgrade to mmif-python 0.4.x, which includes a lots of breaking changes.
489
565
 
566
+
490
567
  ## releasing 0.3.0 (2021-06-04)
491
568
  This new breaking release includes ...
492
569
 
@@ -495,9 +572,11 @@ This new breaking release includes ...
495
572
  * changing HTTP code for error responses to 500 (#61 )
496
573
  * and minor bugfixes
497
574
 
575
+
498
576
  ## releasing 0.2.4 (2021-05-12)
499
577
  This release includes small updates of error handling matching updates on mmif-python side.
500
578
 
579
+
501
580
  ## releasing 0.2.3 (2021-05-01)
502
581
  A new release includes
503
582
 
@@ -507,6 +586,7 @@ A new release includes
507
586
  * and other minor bugfixes
508
587
 
509
588
 
589
+
510
590
  ## releasing 0.2.2 (2021-03-30)
511
591
  * based on mmif-python 0.3.1 patch
512
592
  * more documentation
@@ -514,9 +594,11 @@ A new release includes
514
594
  * interpretation of HTTP parameters into python API arguments
515
595
  * dependency for lapps/LIF
516
596
 
597
+
517
598
  ## releasing 0.2.1 (2021-03-17)
518
599
  This version now based on `mmif-python` 0.3.0, which is based on MMIF spec 0.3.0. It doesn't have breaking changes, but due to the new dependency to `mmif-python` 0.3.0, it might break some apps. Please report here if it breaks your code.
519
600
 
601
+
520
602
  ## releasing 0.2.0 (2021-02-04)
521
603
  This PR contains many breaking changes, so when merged, we release as `0.2.0`.
522
604
 
@@ -536,6 +618,7 @@ This PR contains many breaking changes, so when merged, we release as `0.2.0`.
536
618
  * added `ClamsApp::validate_document_files` (not supporting integrity check such as MD5 yet) (https://github.com/clamsproject/mmif/issues/150)
537
619
 
538
620
 
621
+
539
622
  ## releasing 0.1.3 (2020-10-09)
540
623
  0.1.3 includes;
541
624
 
@@ -75,6 +75,13 @@ from clams.ver import __version__
75
75
  For a dev install without a matching tag, `setuptools-scm` generates a
76
76
  version like `1.4.1.dev20+gaf551a4e4.d20260325`.
77
77
 
78
+ ## Releases
79
+
80
+ Release PRs (from `develop` to `main`) are gated by the `release-check` CI workflow. Before opening one:
81
+
82
+ 1. Title the PR exactly `releasing X.Y.Z` (strict semver); `release-check` reads the version from the title.
83
+ 2. Run `python build-tools/prep_release.py X.Y.Z` and commit its changes. See inside the prep script to see what's actually prepared.
84
+
78
85
  ## Migration from Makefile
79
86
 
80
87
  The old `Makefile` and `setup.py` have been removed. If you are
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clams-python
3
- Version: 1.6.0
3
+ Version: 1.7.1
4
4
  Summary: A collection of APIs to develop CLAMS app for python
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: homepage, https://clams.ai
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
13
13
  Requires-Python: >=3.10
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
- Requires-Dist: mmif-python==1.4.0
16
+ Requires-Dist: mmif-python==1.5.1
17
17
  Requires-Dist: Flask>=2
18
18
  Requires-Dist: Flask-RESTful>=0.3.9
19
19
  Requires-Dist: gunicorn>=20
@@ -36,6 +36,11 @@ Requires-Dist: pytype; extra == "test"
36
36
  Requires-Dist: pytest; extra == "test"
37
37
  Requires-Dist: pytest-cov; extra == "test"
38
38
  Requires-Dist: pillow; extra == "test"
39
+ Provides-Extra: hf
40
+ Requires-Dist: torch; extra == "hf"
41
+ Requires-Dist: transformers; extra == "hf"
42
+ Requires-Dist: pillow; extra == "hf"
43
+ Requires-Dist: tqdm; extra == "hf"
39
44
  Dynamic: license-file
40
45
 
41
46
  ## CLAMS project
@@ -0,0 +1,104 @@
1
+ """
2
+ Prepare release artifacts for the clams-python package.
3
+
4
+ Run while preparing a release PR, passing the version being released::
5
+
6
+ python build-tools/prep_release.py X.Y.Z
7
+
8
+ Currently this adds a row to ``documentation/target-versions.csv`` for
9
+ the release version. The ``mmif-python`` column is read from this
10
+ package's pinned dependency in ``pyproject.toml``, and the target MMIF
11
+ spec version from the installed ``mmif.__specver__``. This script is the
12
+ single place that writes the target-versions table; the docs build only
13
+ renders it, and CI verifies (on the release PR) that a row for the PR's
14
+ version exists.
15
+
16
+ Requires an editable install (``pip install -e .``) so that
17
+ ``mmif.__specver__`` is importable.
18
+ """
19
+ import argparse
20
+ import re
21
+ import sys
22
+ from pathlib import Path
23
+
24
+ PROJECT_ROOT = Path(__file__).parent.parent
25
+ CSV_PATH = PROJECT_ROOT / 'documentation' / 'target-versions.csv'
26
+ PYPROJECT_PATH = PROJECT_ROOT / 'pyproject.toml'
27
+
28
+ VERSION_RE = re.compile(r'^\d+\.\d+\.\d+$')
29
+ TOP_ROW_RE = re.compile(r'`(\d+\.\d+\.\d+) <')
30
+ MMIF_PIN_RE = re.compile(r'mmif-python\s*==\s*(\d+\.\d+\.\d+)')
31
+
32
+
33
+ def _row(version, mmif_ver, specver):
34
+ return (
35
+ f'`{version} <https://pypi.org/project/clams-python/{version}/>`__,'
36
+ f'`{mmif_ver} <https://pypi.org/project/mmif-python/{mmif_ver}/>`__,'
37
+ f'`{specver} <https://mmif.clams.ai/{specver}/>`__'
38
+ )
39
+
40
+
41
+ def _version_tuple(v):
42
+ return tuple(int(x) for x in v.split('.'))
43
+
44
+
45
+ def _top_version(data_lines):
46
+ if not data_lines:
47
+ return None
48
+ m = TOP_ROW_RE.match(data_lines[0])
49
+ return m.group(1) if m else None
50
+
51
+
52
+ def _pinned_mmif_version():
53
+ m = MMIF_PIN_RE.search(PYPROJECT_PATH.read_text())
54
+ if not m:
55
+ sys.exit("Error: could not find a pinned 'mmif-python==X.Y.Z' "
56
+ "dependency in pyproject.toml.")
57
+ return m.group(1)
58
+
59
+
60
+ def main():
61
+ parser = argparse.ArgumentParser(
62
+ description="Prepare release artifacts for clams-python."
63
+ )
64
+ parser.add_argument(
65
+ "version", metavar="X.Y.Z",
66
+ help="the release version being prepared",
67
+ )
68
+ args = parser.parse_args()
69
+ version = args.version
70
+
71
+ if not VERSION_RE.match(version):
72
+ sys.exit(f"Error: '{version}' is not a valid X.Y.Z version.")
73
+
74
+ mmif_ver = _pinned_mmif_version()
75
+ try:
76
+ import mmif
77
+ specver = mmif.__specver__
78
+ except (ImportError, AttributeError):
79
+ sys.exit("Error: cannot read mmif.__specver__. "
80
+ "Run `pip install -e .` first.")
81
+
82
+ lines = CSV_PATH.read_text().splitlines()
83
+ header, data = lines[0], lines[1:]
84
+ top = _top_version(data)
85
+
86
+ if top is not None and _version_tuple(version) < _version_tuple(top):
87
+ sys.exit(f"Error: {version} is older than the current top row "
88
+ f"{top}; refusing to insert an out-of-order version.")
89
+
90
+ new_row = _row(version, mmif_ver, specver)
91
+ if top == version:
92
+ data[0] = new_row # update in place
93
+ action = "updated"
94
+ else:
95
+ data.insert(0, new_row) # prepend as the new latest
96
+ action = "added"
97
+
98
+ CSV_PATH.write_text('\n'.join([header] + data) + '\n')
99
+ print(f"target-versions.csv: {action} row {version} "
100
+ f"-> mmif-python {mmif_ver}, MMIF spec {specver}")
101
+
102
+
103
+ if __name__ == "__main__":
104
+ main()