-
Notifications
You must be signed in to change notification settings - Fork 190
[FIX] schemapath resolution in dev mode install of bidsschematools #2129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Before doing so, I wanted to confirm that https://github.com/bids-standard/bids-specification/blob/fix_dev_install/src/schema/BIDS_VERSION is the right place to change to bump the version for this type of fix? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2129 +/- ##
==========================================
- Coverage 82.19% 82.03% -0.17%
==========================================
Files 17 17
Lines 1528 1531 +3
==========================================
Hits 1256 1256
- Misses 272 275 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Is this a Windows issue? It would be good to test this. |
I did not confirm if it is Windows-specific, or anything else environmental specific, but it is quite possible Steps to reproduce locally or in CI on
My environment: fresh |
|
Okay, so you are on Windows, which would explain it. Do you have symlinks enabled for your filesystem? I seem to recall reading that it's a system setting. And does this occur when you use the WSL? |
Didn't know it was something you could turn off 😅 I use them prolifically, but unsure what changes under the hood with the file metadata across platforms (I usually create/follow them via things like I did try
Just tried this, and yes it does 🤔 git clone https://github.com/bids-standard/bids-specification
cd bids-specification/tools/schemacode
pip install -e .ErrorObtaining file:///mnt/e/GitHub/bids-specification/tools/schemacode Installing build dependencies ... done Checking if build backend supports build_editable ... done Getting requirements to build editable ... done Preparing editable metadata (pyproject.toml) ... error error: subprocess-exited-with-error× Preparing editable metadata (pyproject.toml) did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. × Encountered error while generating package metadata. note: This is an issue with the package mentioned above, not pip. I also confirmed that the fix here applies to WSL as well Sorry for not raising this as an issue beforehand |
|
No worries. Just want to understand. Before merging this, I want to add CI tests for Linux/Mac/Windows to verify that loading the schema from full/editable installs works as expected. If you're up to exploring that, feel free. I'm currently working on a different PR on this repo, so will fiddle around with this later. |
Sure, I can take a crack at it Does an extra (short) step before primary |
|
I think I would add an bids-specification/.github/workflows/schemacode_ci.yml Lines 57 to 62 in 11611bd
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
+ install-type: [wheel]
include:
- os: macos-latest
python-version: 3
+ install-type: wheel
- os: windows-latest
python-version: 3
+ install-type: wheelThen add some inclusions for bids-specification/.github/workflows/schemacode_ci.yml Lines 82 to 84 in 11611bd
|
|
One last thing: What is the actual command / Python code you run to induce the error? |
git clone https://github.com/bids-standard/bids-specification
pip install -e bids-specification/tools/schemacode[all]ErrorObtaining file:///mnt/e/GitHub/bids-specification/tools/schemacode Installing build dependencies ... done Checking if build backend supports build_editable ... done Getting requirements to build editable ... done Preparing editable metadata (pyproject.toml) ... error error: subprocess-exited-with-error× Preparing editable metadata (pyproject.toml) did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. × Encountered error while generating package metadata. note: This is an issue with the package mentioned above, not pip. |
|
So far as I can tell, it is simply that one file which git clones as a text file containing the symlink target, and is not established as an actual symlink Speculation: using a more magical built-in But I feel like I am only one with a very rare particular problem 🤷♂️ so maybe no need for over-engineering... |
|
Oh, it's the pip install itself. That is definitely more painful, and makes sense. Since the installation requires loading the schema, if you can install it, you can load it. |
|
Could you try this patch? This more narrowly targets your case. The current proposal will read any text file passed to |
|
@effigies Sure thing - re-implemented that and it works fine Last question is how you want to handle version bump? |
|
There's no need. It'll be in the next release. I'll backport this onto Also, can you add yourself to https://github.com/bids-standard/bids-specification/wiki/Recent-Contributors? The change to |
I ran into some issues when trying to achieve a local dev install to thoroughly test the
bep032branch on some real datasetsInvestigation revealed that this file: https://github.com/bids-standard/bids-specification/blob/9540a823ed70fa65dcf914e992adabd11c7285fc/tools/schemacode/src/bidsschematools/data/schema, which effectively seems to be a symlink, was being passed diectly into the
Namespace.from_jsonas a raw string, instead of being recognized as a path to a directoryThis small fix resolved my problems and allowed local installation to occur smoothly as expected
Speculation: possibly related to #2120? A collaborator (@yarikoptic) who showed me how to do this weeks ago was able to do it themselves without any issues
TODO