microbiomedata / submission-schema

https://microbiomedata.github.io/submission-schema/
MIT License
1 stars 1 forks source link

Developer documentation does not say to install `yq` before running `make all` #273

Open eecavanna opened 2 days ago

eecavanna commented 2 days ago

I tried running $ make all without having yq installed on my computer. When I did that, I got this error (notice the 3rd line from the bottom):

poetry run gen-linkml \
            --no-materialize-attributes \
            --format yaml local/with_shuttles.yaml.raw > local/with_shuttles.yaml
poetry run linkml-lint local/with_shuttles.yaml > local/with_shuttles.lint_report.txt
make: [local/with_shuttles.yaml] Error 1 (ignored)
project.Makefile:48: warning: undefined variable ` '
cp local/with_shuttles.yaml local/with_shuttles_yq.yaml
# using \x0A to represent a line feed
# double gets reduced to one by make
# .string_serialization=="{text};{float} {unit}": what about multivalueds? don't see any at this time
# ControlledTermValue: experiential factor has string_serialization: '{termLabel} {[termID]}|{text}'
# ControlledTermValue: what about multivalued CTVs? don't see any besides chem_administration above at this time
# for water, can depth be a point, a range, or both?
yq -i '(.classes.[].slot_usage.[] | select(.name=="chem_administration") | .examples) = [{"value": "agar [CHEBI:2509];2018-05-11|agar [CHEBI:2509];2018-05-22"}, {"value": "agar [CHEBI:2509];2018-05"}]' local/with_shuttles_yq.yaml
bash: yq: command not found
make: *** [local/with_shuttles_yq.yaml] Error 127
make: *** Deleting file `local/with_shuttles_yq.yaml'

Emphasis:

bash: yq: command not found

Indeed, when I run $ yq --version on my computer, I get a similar error message (same error, different shell).

$ yq --version
zsh: command not found: yq
eecavanna commented 2 days ago

For reference, I do have jq available, but not yq.

eecavanna commented 2 days ago

yq can be downloaded from here: https://github.com/mikefarah/yq/

eecavanna commented 2 days ago

Installing yq on MacOS Sequoia leads to this user experience:

image

I recommend containerizing this project.

eecavanna commented 2 days ago

Even with yq present on my computer, and running via $ yq in zsh, the make all command fails with the same error:

image

I think that's because the make all stuff is running in bash instead of zsh, and the alias doesn't exist in that bash shell.

eecavanna commented 2 days ago

Even after updating my local ~/.bash_profile to define the alias alias yq='~/Downloads/Portable/yq_darwin_arm64', the make all command fails with the same error.

eecavanna commented 2 days ago

I got places to be. I'm going to edit the Makefile locally, like this:

+ yq_alias:
+         alias yq='~/Downloads/Portable/yq_darwin_arm64'

- all: site
+ all: yq_alias site
eecavanna commented 2 days ago

Same error:

bash: yq: command not found
eecavanna commented 2 days ago

Instead of creating the alias in Makefile as shown above, I'll create it in project.Makefile, at the beginning of the problematic target:

  local/with_shuttles_yq.yaml: local/with_shuttles.yaml
+         alias yq='~/Downloads/Portable/yq_darwin_arm64'
eecavanna commented 2 days ago

Same error.

bash: yq: command not found