This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Can Calva jack-in to a lein based project that has github dependencies? I'm looking at using https://github.com/tobyhede/lein-git-deps but I'm open to any solution or best practice. Specifically I need https://github.com/faux-combinator/clojure/tree/master as a dep for my project
Can you run lein repl
from the terminal and verify the expected namespaces can be required?
If so, then jack-in should work fine.
https://github.com/tobyhede/lein-git-deps talks about wanting a custom classpath (but not with lein 2 maybe?). I'll have to play around with it to see what it does.
Like I say, if lein repl
works and you can require
namespaces from that faux-combinator library successfully, then jack-in should just work.
Is there not a standard way to use github repos for deps?
I agree
If you use the CLI and deps.edn
, that supports git deps natively.
(aside from helping beginners here, I haven't used Leiningen since 2015 🙂 )
well because you lead the alternative I should think 🙂
We switched to Boot in 2015 and the CLI in 2018 at work. I am not part of the core Clojure team -- I just use the tools they provide 🙂
but you're the deps.edn go-to guy as I understand it
boot's dead, yes?
Boot is pretty much dead, yes, but it was second to Leiningen for a while:grin:
We have a big Polylith codebase (140k lines, 160 subprojects) so I tend to be able to help people with deps issues...
The other folks I'm working with on this project prefer lein at this point. It would be nice if https://github.com/RickMoynihan/lein-tools-deps was up to date.
Thanks for the link to lein-git-deps, which I hadn't known about... Excellent artwork, but not a load-bearing part for reasons cited in the README. The README also gives very solid advice:
> [Instead,] fork the project and package up your own release. Then, you can either deploy it on your local system with lein install
, create a private Maven repository and publish it there, or publish it to Clojars with a different group-id.
Which, of course, would also benefit all other Leiningen users. I think git dependencies are a good, noble, and worthy holy grail in the sense of freedom from the middleman. But I intend to hold off until deps.edn's developers have put down their pencils for the very last time. Bulid tools that are still evolving are a headwind for the hobbyist who wants to return periodically to dusty old projects and give them another half-turn of the screw. I am still smarting from the Lein 1 to Lein 2 transition, which must have been 8-10 years ago now.
@U0HG4EHMH Excellent commentary. Thanks!
Ironically the author of the particular unreleased dep is one of the people I'm working with on the project. In this case I'll just ask him to release it. But it's a problem worth solving.
And yet git deps are a solved problem, supported as a first class procurer by the official Clojure CLI...
FWIW, the ClojureCLR folks plan to support git deps too.
And yet I don't have a good answer for lein yet and @U0HG4EHMH doesn't have a final word, iiuc. I think it's great that tools-deps has solved it.
TBH, I am a bit surprised and a bit disappointed that Leiningen hasn't moved with the times on this... But it's hardly been maintained at all for several years. All the work is happening around deps.edn
these days.
Does the deps.edn :deps
with a git repo support using a repo subdirectory besides the root one?
That would be a nice addition if not.
Can you do that with :deps
and :paths
?
Looks like maybe :deps/root
is my friend here
Leiningen is more or less “complete” hence most activity being fixing bugs whenever they’re reported. There are plans for releasing Leiningen 3.0, though again, the functionality requested here is already available through a plugin. And like most feature requests to Leiningen, the functionality either already exists in core or is provided via a plugin. deps.edn wont work for this git repo since there isnt a deps.edn committed to the repo. Leiningen doesnt have this problem. It should be sufficient to set up a project like so
(defproject git-sample "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.11.1"]
[faux-combinator/clojure "cc6897c"]]
:repositories [["public-github" {:url ""}]]
:plugins [[reifyhealth/lein-git-down "0.4.1"]])
Tested locallyYou don't need a deps.edn
file in the git repo for tools.deps
to be able to use it. You can specify the manifest type as :deps
and it will assume an empty deps.edn
file (if there are any other dependencies, you can specify those yourself, alongside the git dep you're trying to use.
@U0479UCF48H Worked like a charm. Thanks!
And calva sees it fine after jacking in through lein, which was my original query 🙂