Commit c9b4872
merge: bring CLARIN branch (main) into dtq
origin/main and origin/dtq had diverged since 5724696 (2024-10-24) with no
ancestry either way. main added +300/-0 lines and dtq +263/-71, both confined
to dspace_rest_client/client.py and dspace_rest_client/models.py.
main contributes the CLARIN/UFAL surface: License and Label models,
clarinlruallowances get/create, submit-group creation, eperson-to-group
membership, get_item_by_handle, get_items_from_collection, get_bundle_by_name,
get_user_by_email, api_put_uri and the dict-based resource-policy helpers.
dtq keeps its hardening: reauth on 401, request timeouts, proxy support,
verify_response, _last_err, the ResourcePolicy model and 404-safe bundles.
Conflict resolutions (3 hunks, 2 in client.py and 1 in models.py):
- get_items: kept dtq's paginated get_items(self, page=0, size=20) and dropped
main's no-arg variants. main still carried two duplicate `def get_items`
definitions; the shadowing second one tested for 'collections' in _embedded
while iterating _embedded['items']. The paginated signature is required by
DSpace-ISstag-integration src/ingest/_dspace.py, which calls
get_items(page=page, size=page_size). main's additive get_item_by_handle is
kept alongside it.
- remove_metadata: unified the two signatures into
remove_metadata(self, dso, field, place=None). place=None removes every value
of the field (dtq behaviour, PATCH /metadata/{field}); an explicit place
removes a single value (main behaviour, PATCH /metadata/{field}/{place}).
This keeps dtq's 2-arg call sites and dspace-import-clarin's
remove_metadata(item, key, 0) working. main's module-level logging.error was
replaced by _logger.error to match the rest of the file.
- models.py: kept all three new classes - License (with to_dict), Label and
ResourcePolicy (with as_dict and __repr__). The conflict was purely
positional, both sides having appended at EOF.
api_put_uri was added on main against the pre-hardening base, so it was
harmonised with its sibling api_put: reset self._last_err on entry, pass
proxies=self.proxies, and use _logger instead of module-level logging. Its
public signature is unchanged - dspace-rest-test depends on it.
dtq-dev is deliberately NOT merged. Its only unique commit, 145635a
(2023-06-12, "copied code from dtq main"), is a snapshot of a different
project: it relocates dspace_rest_client/{client,models}.py into
support/dspace_interface/, deletes setup.py, example.py, example_gets.py,
solr_example.py, publish.sh, CHANGELOG.md and MAINTAINING.md, and adds ~8.5k
lines of import tooling, test fixtures, license icons and a localization CSV.
Merging it would destroy the installable package.
Both resource-policy APIs are retained side by side, since main's dict-based
set (get_resource_policy, create_resource_policy, update_resource_policy_group)
and dtq's model-based set (get_resourcepolicy, create_resourcepolicy) each have
live consumers. Unification is left to a separate deprecation change.
Verified: compileall clean, package imports, no duplicate method definitions,
and the merged API surface is exactly the union of both branches (nothing from
either side lost, main's duplicate get_items aside). The
DSpace-ISstag-integration suite gives an identical result with and without this
merge - 579 passed, 40 failed - where the 40 failures are pre-existing and
caused by flask being absent from that environment, not by the library.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>2 files changed
Lines changed: 295 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
328 | 360 | | |
329 | 361 | | |
330 | 362 | | |
| |||
978 | 1010 | | |
979 | 1011 | | |
980 | 1012 | | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
981 | 1036 | | |
982 | 1037 | | |
983 | 1038 | | |
| |||
1079 | 1134 | | |
1080 | 1135 | | |
1081 | 1136 | | |
1082 | | - | |
| 1137 | + | |
1083 | 1138 | | |
1084 | | - | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1085 | 1145 | | |
1086 | 1146 | | |
1087 | 1147 | | |
1088 | 1148 | | |
1089 | 1149 | | |
1090 | 1150 | | |
1091 | 1151 | | |
1092 | | - | |
1093 | | - | |
| 1152 | + | |
1094 | 1153 | | |
1095 | 1154 | | |
1096 | 1155 | | |
1097 | 1156 | | |
1098 | 1157 | | |
1099 | | - | |
1100 | 1158 | | |
1101 | 1159 | | |
1102 | 1160 | | |
| |||
1154 | 1212 | | |
1155 | 1213 | | |
1156 | 1214 | | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
1157 | 1254 | | |
1158 | 1255 | | |
1159 | 1256 | | |
| |||
1204 | 1301 | | |
1205 | 1302 | | |
1206 | 1303 | | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
524 | 579 | | |
525 | 580 | | |
526 | 581 | | |
| |||
544 | 599 | | |
545 | 600 | | |
546 | 601 | | |
| 602 | + | |
547 | 603 | | |
548 | 604 | | |
549 | 605 | | |
| |||
559 | 615 | | |
560 | 616 | | |
561 | 617 | | |
562 | | - | |
| 618 | + | |
0 commit comments