Fork me on GitHub
#tools-deps
<
2021-02-23
>
mpenet14:02:57

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

Alex Miller (Clojure team)14:02:24

working towards that yes

Alex Miller (Clojure team)14:02:45

but looking good so far

mpenet14:02:49

good to hear

mike_ananev22:02:56

@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 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_ananev22:02:09

What I'm doing wrong?

mike@mbp02  projects clojure -X:clj-new :template rssyslib :name 

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

seancorfield22:02:19

@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?)

seancorfield22:02:37

(! 737)-> clojure -X:new :template rssyslib :name  :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 

seancorfield22:02:11

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_ananev22:02:25

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

seancorfield22:02:31

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

mike_ananev22:02:16

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

seancorfield22:02:10

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

seancorfield22:02:50

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_ananev22:02:09

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

3
hiredman22:02:18

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

Alex Miller (Clojure team)23:02:54

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

hiredman23:02:22

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