tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
mpenet 2021-02-23T14:31:57.033300Z

@alexmiller gitlibs will shell out to git instead of using jgit in the near future? (looking at these recent commits in the repo)

alexmiller 2021-02-23T14:38:24.034Z

working towards that yes

alexmiller 2021-02-23T14:38:33.034200Z

all on a branch atm

alexmiller 2021-02-23T14:38:45.034500Z

but looking good so far

mpenet 2021-02-23T14:38:49.034700Z

good to hear

mike_ananev 2021-02-23T22:00:56.037900Z

@seancorfield Hello. I've created new library template for clj-new and published it on http://Clojars.org Source code is here https://github.com/redstarssystems/rssyslib When I'm trying to use it by clojure -X:clj-new :template rssyslib :name <http://my.org/mylib01|my.org/mylib01> then clj-new can't find it on Clojars. My ~/.clojure/deps.edn contains:

:clj-new     {:extra-deps {seancorfield/clj-new {:mvn/version "1.1.243"}}
                         :exec-fn    clj-new/create
                         :main-opts  ["-m" "clj-new.create"]}

mike_ananev 2021-02-23T22:03:09.039100Z

What I'm doing wrong?

mike@mbp02  projects clojure -X:clj-new :template rssyslib :name <http://my.org/mylib01|my.org/mylib01>

Failed with: Failed to resolve version for rssyslib:lein-template:jar:RELEASE: Could not find metadata rssyslib:lein-template/maven-metadata.xml in local (/Users/mike/.m2/repository)
Execution error (ExceptionInfo) at clj-new.helpers/resolve-remote-template (helpers.clj:181).
Could not load artifact for template: rssyslib
	Tried coordinates:
		[rssyslib/boot-template "RELEASE"]
		[rssyslib/lein-template "RELEASE"]

For more detail, enable verbose logging with -v, -vv, or -vvv

Full report at:
/var/folders/l5/65w77gdx78zdb8ycr1cb2lhw0000gn/T/clojure-1964961708616204516.edn

seancorfield 2021-02-23T22:08:19.039800Z

@mike1452 clj-new only looks for releases -- until you tell it to look for snapshots (and your lib is only a snapshot right now, yes?)

seancorfield 2021-02-23T22:09:37.040Z

(! 737)-&gt; clojure -X:new :template rssyslib :name <http://my.org/mylib01|my.org/mylib01> :snapshot true
Downloading: seancorfield/clj-new/maven-metadata.xml from clojars
Downloading: rssyslib/clj-template/maven-metadata.xml from clojars
Downloading: rssyslib/clj-template/0.1.0-SNAPSHOT/maven-metadata.xml from clojars
Generating project from library template <https://github.com/redstarssystems/rssyslib.git>

seancorfield 2021-02-23T22:11:11.041100Z

Your :clj-new alias doesn't need :main-opts BTW since you're invoking it with -X:

:new {:extra-deps {seancorfield/clj-new {:mvn/version "RELEASE"}}
        :exec-fn clj-new/create
        :exec-args {:template lib}}

mike_ananev 2021-02-23T22:30:25.042300Z

Yes, my lib has snapshot version. How can I tell to look for snapshots?

seancorfield 2021-02-23T22:31:09.042600Z

@mike1452 I just showed you.

seancorfield 2021-02-23T22:32:31.043Z

(it's also explained in the clj-new readme)

mike_ananev 2021-02-23T22:33:16.043500Z

Oh! Now I see it! @seancorfield thank you!!

seancorfield 2021-02-23T22:34:10.044Z

I wanted to check the template actually worked (which it did!).

seancorfield 2021-02-23T22:35:50.045900Z

If you want to check a template without publishing it to Clojars, you should be able to run clojure -X:new :template rssyslib ... directly in your project's folder since the template will be on the classpath (via the src path and your existing deps.edn) and clj-new tries to require the namespaces locally before starting to search clojars for clj templates (then boot templates, then lein templates).

mike_ananev 2021-02-23T22:39:09.047700Z

Yes. I've checked it locally. It works fine. Now, I will make latest command for bumping version and then publish release.

1
mike_ananev 2021-02-23T22:39:43.048100Z

Thank you!!!

2021-02-23T22:59:18.049300Z

I saw a blog post about infering dependencies for python projects based on imports, and it got me wondering if there are any projects that will look at clojure code and spit out a deps.edn for it

alexmiller 2021-02-23T23:00:54.049700Z

something Rich and I have been talking about for years :)

2021-02-23T23:02:22.050500Z

I wrote a little function that does its best https://gist.github.com/15186e238dc365fd72e2e09c3eb7561a but I was wondering it was tackled more seriously