tools-deps

timothypratley 2023-07-03T19:29:36.169079Z

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?

seancorfield 2023-07-03T19:31:16.655529Z

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).

timothypratley 2023-07-03T19:31:57.917239Z

Oh, wonderful. Thank you Sean!

seancorfield 2023-07-03T19:32:26.115679Z

It probably still won't let you load that JSON file since it won't seem to be on a classpath...

seancorfield 2023-07-03T19:33:17.697459Z

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

timothypratley 2023-07-03T19:33:47.511819Z

yes πŸ™‚

seancorfield 2023-07-03T19:34:40.795729Z

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.

timothypratley 2023-07-03T19:36:24.309669Z

I kinda wish I could do: :deps/manifest {:paths ["tests"]} πŸ™‚

timothypratley 2023-07-03T19:38:22.449409Z

ooo maybe I can :override-deps

dpsutton 2023-07-03T19:40:18.046849Z

would just using a traditional git submodule be simpler and straightforward in this instance?

timothypratley 2023-07-03T19:42:21.020429Z

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.

dpsutton 2023-07-03T19:42:53.326479Z

yeah. i’ve never actually used one personally. so i can totally understand wanting to add it into other tooling to hide it

Alex Miller (Clojure team) 2023-07-03T19:54:30.367739Z

submodules don't work with tdeps git libs

dpsutton 2023-07-03T19:55:31.425919Z

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

Alex Miller (Clojure team) 2023-07-03T19:55:43.529559Z

yes, that should work afaik

Alex Miller (Clojure team) 2023-07-03T19:56:10.597579Z

I think this is not a code dep and not really the case git libs was designed for

timothypratley 2023-07-03T20:15:33.587339Z

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"))
😎

πŸ˜‚ 1