Hi π
I'd like to make use of some files from the [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite),
(specifically, it has some test/ref.json etc files).
I added it as a git/sha dependency in my deps.edn:
io.github.json-schema-org/JSON-Schema-Test-Suite {:git/sha "7950d9e0579382103031ef3cfcdc37e7c58b2d1f"}
Error:
Manifest file not found for io.github.json-schema-org/JSON-Schema-Test-Suite
Which makes sense... this project is not a Clojure or Java project (it's just a bunch of data files).
But, on the other hand, it would be very convenient if I could specify it as a dependency in this way and make use of those files.
Is this something that can be achieved?You can specify :deps/manifest :deps in the coords to tell tools.deps "treat this as if it were a deps.edn project" (with an empty deps.edn file).
Oh, wonderful. Thank you Sean!
It probably still won't let you load that JSON file since it won't seem to be on a classpath...
You're talking about the stuff in this folder, yes? https://github.com/json-schema-org/JSON-Schema-Test-Suite/tree/main/tests/draft2020-12
yes π
Not sure how you'd tell tools.deps that would be on your classpath for it... you might be better off just pulling the file(s) direct from GitHub with an http client.
I kinda wish I could do:
:deps/manifest {:paths ["tests"]} π
ooo maybe I can :override-deps
would just using a traditional git submodule be simpler and straightforward in this instance?
Yes; using a git submodule is the recommended way to depend on the test suite, but I was curious π IMO submodules aren't much fun.
yeah. iβve never actually used one personally. so i can totally understand wanting to add it into other tooling to hide it
submodules don't work with tdeps git libs
yeah. just suggesting it being a submodule of the project heβs working on so then he could just add it to the classpath and use git to fetch as normal without tdeps involved
yes, that should work afaik
I think this is not a code dep and not really the case git libs was designed for
This worked:
(slurp (io/file (System/getProperty "user.home") ".gitlibs/libs/io.github.json-schema-org/JSON-Schema-Test-Suite/7950d9e0579382103031ef3cfcdc37e7c58b2d1f/tests/draft7/ref.json"))
π