librelist archives

« back to archive

Transitive dependencies

Transitive dependencies

From:
Tim Linquist
Date:
2015-08-20 @ 06:14
I'm working on a project to list and track the transitive deps of a given
clj project using leinengen. Is there a public api to get the full list of
dependencies that I'm missing?

Thanks for the help.

Best,

Tim

-- 
Tim Linquist

Cell:        (509)-481-3669
Email:     tim.linquist@gmail.com
Skype:    tim.linquist

Re: [leiningen] Transitive dependencies

From:
Akhil Wali
Date:
2015-08-20 @ 06:31
Is this something like what `lein pom` (which creates a pom.xml file) does?
For a tree of dependencies, there's also `lein deps :tree`.

On Thu, Aug 20, 2015 at 11:44 AM, Tim Linquist <tim.linquist@gmail.com>
wrote:

> I'm working on a project to list and track the transitive deps of a given
> clj project using leinengen. Is there a public api to get the full list of
> dependencies that I'm missing?
>
> Thanks for the help.
>
> Best,
>
> Tim
>
> --
> Tim Linquist
>
> Cell:        (509)-481-3669
> Email:     tim.linquist@gmail.com
> Skype:    tim.linquist
>



-- 
Akhil Wali

# https://github.com/darth10
# https://darth10.github.io

Re: [leiningen] Transitive dependencies

From:
Tim Linquist
Date:
2015-08-20 @ 06:50
Hey,

I sort of started down this path except walk-paths is not public. First
attempt:

(defn list-deps
  "Output project dependencies as json to $stdout for pickup via ops-web"
  [project & args]
  (let [deps []
        hierarchy (dependency-hierarchy
                    (tree-command command)
                    project)]
        (walk-deps hierarchy #(conj deps (map-dep %)))
    (println (generate-string (map map-dep deps)))))

I suppose I could use lein deps :tree and parse the output but that seems a
bit round about if we can open up the apis in such a way that one can
access the list directly.

On Wed, Aug 19, 2015 at 11:31 PM, Akhil Wali <akhil.wali.10@gmail.com>
wrote:

> Is this something like what `lein pom` (which creates a pom.xml file) does?
> For a tree of dependencies, there's also `lein deps :tree`.
>
> On Thu, Aug 20, 2015 at 11:44 AM, Tim Linquist <tim.linquist@gmail.com>
> wrote:
>
>> I'm working on a project to list and track the transitive deps of a given
>> clj project using leinengen. Is there a public api to get the full list of
>> dependencies that I'm missing?
>>
>> Thanks for the help.
>>
>> Best,
>>
>> Tim
>>
>> --
>> Tim Linquist
>>
>> Cell:        (509)-481-3669
>> Email:     tim.linquist@gmail.com
>> Skype:    tim.linquist
>>
>
>
>
> --
> Akhil Wali
>
> # https://github.com/darth10
> # https://darth10.github.io
>
>


-- 
Tim Linquist

Cell:        (509)-481-3669
Email:     tim.linquist@gmail.com
Skype:    tim.linquist

Re: [leiningen] Transitive dependencies

From:
Phil Hagelberg
Date:
2015-08-20 @ 07:17
Tim Linquist <tim.linquist@gmail.com> writes:

> I sort of started down this path except walk-paths is not public.

Do you mean walk-deps? We could make that public in the next release if
you don't need compatibility with old versions, but it's a short
function, so it'd probably be simpler just to copy it. That would also
allow you to just depend on leiningen-core rather than the full
leiningen dependency with all the tasks.

I would advise against parsing the output of `lein deps :tree` as it's
intended to be primarily human readable.

-Phil

Re: [leiningen] Transitive dependencies

From:
Tim Linquist
Date:
2015-08-20 @ 07:35
Ah yes. I think this will be perfect. No need to open the api up. I'm
working on the data structure now to represent the different levels.

Thanks Phil and Akhil!

On Thu, Aug 20, 2015 at 12:17 AM, Phil Hagelberg <phil@hagelb.org> wrote:

> Tim Linquist <tim.linquist@gmail.com> writes:
>
> > I sort of started down this path except walk-paths is not public.
>
> Do you mean walk-deps? We could make that public in the next release if
> you don't need compatibility with old versions, but it's a short
> function, so it'd probably be simpler just to copy it. That would also
> allow you to just depend on leiningen-core rather than the full
> leiningen dependency with all the tasks.
>
> I would advise against parsing the output of `lein deps :tree` as it's
> intended to be primarily human readable.
>
> -Phil
>



-- 
Tim Linquist

Cell:        (509)-481-3669
Email:     tim.linquist@gmail.com
Skype:    tim.linquist