Commit dfbcfd8
authored
feat: add StorageAdapter plugin system for third-party storage protocols
Adds a StorageAdapter ABC and entry-point plugin system (datajoint.storage
group) so third-party packages can register new storage protocols without
modifying DataJoint internals. Built-in protocols (file, s3, gcs, azure)
remain hardcoded; full unification is tracked in #1440 with Phase 0
(per-protocol unit-test scaffolding) as a hard prerequisite, gated on the
atomicity contract in safe_write/safe_copy and recursive-op semantics.
- StorageAdapter ABC with four extension points: create_filesystem,
validate_spec, full_path, get_url
- Lazy entry-point discovery via _discover_adapters; adapters auto-load
when their protocol is referenced in dj.config.stores
- _require_adapter helper provides symmetric missing-adapter errors
across _create_filesystem, _full_path, and get_url; _full_path now
reaches file-protocol logic only via an explicit elif, not as a
catch-all else, so unknown protocols can no longer silently take it
- _apply_common_store_defaults keeps built-in and plugin paths in sync
on shared defaults; the location default is intentionally not applied
to plugins so adapters can declare it in required_keys
- 23 unit tests covering the registry, validation defaults, backend
delegation, symmetric error handling on unknown protocols, entry-point
discovery, and graceful failure of a bad entry point1 parent a251f44 commit dfbcfd8
4 files changed
Lines changed: 463 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
| 423 | + | |
432 | 424 | | |
433 | 425 | | |
434 | 426 | | |
435 | 427 | | |
436 | 428 | | |
437 | | - | |
438 | | - | |
439 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
440 | 444 | | |
| 445 | + | |
441 | 446 | | |
442 | 447 | | |
443 | 448 | | |
| |||
582 | 587 | | |
583 | 588 | | |
584 | 589 | | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
585 | 600 | | |
586 | 601 | | |
587 | 602 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
333 | 342 | | |
334 | 343 | | |
335 | 344 | | |
| |||
368 | 377 | | |
369 | 378 | | |
370 | 379 | | |
371 | | - | |
| 380 | + | |
372 | 381 | | |
373 | 382 | | |
374 | 383 | | |
| |||
397 | 406 | | |
398 | 407 | | |
399 | 408 | | |
400 | | - | |
401 | | - | |
| 409 | + | |
402 | 410 | | |
403 | 411 | | |
404 | 412 | | |
405 | 413 | | |
| 414 | + | |
| 415 | + | |
406 | 416 | | |
407 | 417 | | |
408 | 418 | | |
| |||
448 | 458 | | |
449 | 459 | | |
450 | 460 | | |
451 | | - | |
452 | | - | |
| 461 | + | |
453 | 462 | | |
454 | 463 | | |
455 | 464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
0 commit comments