Commit e8c9b44
committed
Enhance Foundry usability, testability, and documentation
This commit introduces several improvements to the Foundry library aimed at making it easier for you to use, more robust to test, and better documented.
Key changes include:
- **Authentication:**
- Clarified Globus authentication parameters (`no_browser`, `no_local_server`) in `Foundry.__init__` docstrings.
- Improved error handling during authentication setup by raising a `RuntimeError` with a more user-friendly message.
- **Testability:**
- Significantly refactored `tests/test_foundry.py` to use `unittest.mock` for external service interactions (Globus, Forge, MDF Connect).
- Introduced `tests/conftest.py` for shared mocking fixtures, enabling offline and more reliable test execution.
- **Usage Patterns & API:**
- `Foundry.list()` now consistently returns a `List[FoundryDataset]`.
- Introduced `DatasetNotFoundError` for more specific error handling in `Foundry.search()`.
- Refined Pydantic `ValidationError` handling in `FoundryDataset` and `foundry/models.py` to provide clearer error feedback and avoid unnecessary re-validation.
- Updated `FoundryDataset.clean_dc_dict()` for Pydantic V2 compatibility and replaced a print statement with logging.
- **Documentation:**
- Updated `README.md` and `docs/` to reflect all code changes.
- Provided detailed explanations of the Globus authentication flow, `no_browser`/`no_local_server` options, and `use_globus=False` for data transfers.
- Added a comprehensive "Common Foundry Errors" section to `docs/support/troubleshooting.md`.
- Overhauled `docs/publishing/publishing-datasets.md` with current API examples.
- Added guidance for contributors on testing with mocks in `docs/how-to-contribute/contributing.md`.
- Updated examples in `README.md` and `docs/examples.md` to use current API patterns.1 parent 0c028b8 commit e8c9b44
File tree
12 files changed
+1223
-369
lines changed- docs
- concepts
- how-to-contribute
- publishing
- support
- foundry
- tests
12 files changed
+1223
-369
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 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 | + | |
38 | 95 | | |
39 | | - | |
40 | | - | |
41 | 96 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 97 | + | |
45 | 98 | | |
| 99 | + | |
46 | 100 | | |
| 101 | + | |
47 | 102 | | |
48 | | - | |
49 | | - | |
| 103 | + | |
50 | 104 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
56 | 124 | | |
57 | 125 | | |
58 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
23 | 42 | | |
24 | 43 | | |
25 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
38 | 52 | | |
39 | 53 | | |
40 | | - | |
41 | | - | |
42 | | - | |
| 54 | + | |
43 | 55 | | |
| 56 | + | |
44 | 57 | | |
45 | | - | |
46 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
47 | 77 | | |
48 | 78 | | |
49 | | - | |
| 79 | + | |
50 | 80 | | |
51 | 81 | | |
52 | 82 | | |
| |||
56 | 86 | | |
57 | 87 | | |
58 | 88 | | |
59 | | - | |
| 89 | + | |
60 | 90 | | |
61 | 91 | | |
62 | 92 | | |
63 | 93 | | |
64 | 94 | | |
65 | 95 | | |
66 | | - | |
67 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
68 | 100 | | |
| 101 | + | |
69 | 102 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
38 | 55 | | |
39 | 56 | | |
40 | 57 | | |
| |||
0 commit comments