Skip to content

Commit d776b63

Browse files
[FIX] schemapath resolution in dev mode install of bidsschematools (#2129)
* fix: schemapath resolution in Windows dev mode installation of bidsschematools * chore: add to contributors * chore: shorten line for ruff * refactor: recommended nesting
1 parent daad867 commit d776b63

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/appendices/contributors.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ If you contributed to the BIDS ecosystem and your name is not listed, please add
107107
| Christopher Lee-Messer | 📖 |
108108
| Clara Moreau | 📖 |
109109
| Clint Hansen | 📖🤔 |
110+
| Cody Baker | 💻🔧 |
110111
| Cyril Pernet | 💬📝📖🎨💡📋🤔📢 |
111112
| Cyrus Eierud | 📖 |
112113
| D. Sturgeon | 💻 |

tools/schemacode/JsonschemaValidator

Whitespace-only changes.

tools/schemacode/src/bidsschematools/schema.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ def load_schema(schema_path=None):
218218
schema_path = data.load.readable("schema.json")
219219
if not schema_path.is_file():
220220
schema_path = data.load.readable("schema")
221+
222+
# Probably a Windows checkout with a git link. Resolve first.
223+
if schema_path.is_file() and (content := schema_path.read_text()).startswith("../"):
224+
schema_path = Path.resolve(schema_path.parent / content)
221225
lgr.info("No schema path specified, defaulting to the bundled schema, `%s`.", schema_path)
222226
elif isinstance(schema_path, str):
223227
schema_path = Path(schema_path)

0 commit comments

Comments
 (0)