It might be useful for mix new to accept a list of dependencies to
pre-fill the mix.exs template. Something like:

$ mix new --sup --deps benchee

That could reduce the friction for trying out a new package (of course
you still have to deps.get and compile).

But having mix rewrite an existing mix.exs file (like npm --save does)
feels antithetical to the Elixir philosophy.

Christopher

On 07/14/2016 01:47 AM, José Valim wrote:
> Elixir master already supports installing packages globally but only as
> escripts. You won't be able to use them directly in your Mix projects.
> 
> On Wednesday, July 13, 2016, Pedro Medeiros <[email protected]
> <mailto:[email protected]>> wrote:
> 
>     I also dislike handling with this kind of problem. I work mostly
>     with ruby and python . We had these kind in the past a lot, but in
>     the end prohibit to install global dependencies is not the best
>     solution IMO. Is cool to install and just test a library, show
>     something for someone at work, make a small POC... etc.
> 
>     On other languages like ruby or python they started putting
>     everything globally, then moved to local solutions (virtualenv or
>     bundler). In Elixir we started with local dependencies then people
>     are discussing if there's the necessity to move to global. I don't
>     believe this kind of problem will occur constantly that way. but
>     that's my 2 cents
> 
>     On Wed, Jul 13, 2016 at 12:46 PM, Ben Wilson <[email protected]
>     <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
> 
>         Global dependencies available in a mix project is gonna send us
>         back to the world of needing some equivalent of `bundle exec
>         blah` when we want to run our project with ONLY the mix deps.
>         Dependencies via mix "just work" at the moment and it's awesome.
>         If there's gonna be globally available dependencies at all I'd
>         much prefer if they weren't usable in a mix project at all. Use
>         cases would mostly be to let you do `Poison.decode!` inside a
>         normal `iex` session or something. Global dependencies
>         intermingled with local dependencies is a recipe for problems
>         that plague dependency management in python and the other
>         languages mentioned as models here.
> 
>         On Wednesday, July 13, 2016 at 10:59:50 AM UTC-4, Pedro Medeiros
>         wrote:
> 
>             I currently like the approach of descriptive dependencies at
>             a mix.exs file or maintain a mix.lock.  In the end of day I
>             think this is the best practice to run your project anywhere
>             in a more descriptive way.
> 
>             But I can also see the need for people that want to test or
>             debug something or another inside a project by not necessary
>             having to install the deps inside the mix.exs. I find useful
>             to have a way to install globally libs but I believe it can
>             brings problems with dependency versions more frequently.
> 
> 
>             On Wed, Jul 13, 2016 at 8:23 AM, derek <[email protected]> wrote:
> 
>                 On Sat, Jul 9, 2016 at 11:29 AM, Ben Wilson
>                 <[email protected]> wrote:
>                 > Global package installation is also a constant source of 
> problems when they
>                 > conflict. That isn't to say that there aren't scenarios 
> where it's handy.
>                 > However great care needs to be taken when it comes to make 
> code globally
>                 > available as we don't want to end up in dependency hell.
>                 >
>                 > It's also worth pointing out that as a compiled language 
> Elixir is simply a
>                 > different beast than Python. To my knowledge it is not 
> possible to
>                 > consolidate protocols outside of a mix project, and without 
> such
>                 > consolidation there is literally no point in benchmarking 
> anything. If you
>                 > have a mix project to consolidate protocols, then you may 
> as well just add
>                 > your benchmarking library as a dev dependency.
> 
>                 In the company I'm working for there are still lots of
>                 components in
>                 pure Erlang, and those Erlang packages are installed
>                 globally under
>                 /usr/lib/erlang/lib/... by a Linux package manager like
>                 yum; Managing
>                 packages dependencies is not a big deal here I would
>                 say, even without
>                 yum; With switching to Elixir doesn't mean we have to
>                 rewrite all
>                 components in Elixir, a consensus here is only when
>                 rewriting is
>                 proven to have superior benefits; so here why not give
>                 user freedom to
>                 manage global packages? not restricting user have to
>                 make a fake
>                 project to evaluate something; here benchee is used as a
>                 global
>                 package and doesn't belong to any particular project,
>                 don't even want
>                 to add into mix.exs
> 
>                 The current requirement of mix to install a package
>                 within a project
>                 is just odd to people with different language background
> 
>                 This is the proposal:
> 
>                 $ mix install benchee --save             # install the
>                 package to
>                 current project, `--save` option is optinal, inspired
>                 from `npm
>                 install`, which does add the new dependency to its
>                 package.json; for
>                 mix this can be added into mix.exs
>                 $ mix install benchee --user             # install into
>                 a hidden
>                 directory under user's home, this works for a user with
>                 ERL_LIBS
>                 properly set; this is pip's behavior
>                 $ sudo mix install benchee --global      # install
>                 globally to where
>                 Elixir or Erlang's system libs (that is
>                 /usr/lib/erlang/lib to Erlang
>                 usually)
> 
>                 --
>                 You received this message because you are subscribed to
>                 the Google Groups "elixir-lang-talk" group.
>                 To unsubscribe from this group and stop receiving emails
>                 from it, send an email to
>                 [email protected].
>                 To view this discussion on the web visit
>                 
> https://groups.google.com/d/msgid/elixir-lang-talk/CAJctwx42m%2B%2BmzJVV1F0c1ok7WVaO9iGs5PKVT9uxH%2BYqqKCvgQ%40mail.gmail.com.
>                 For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> 
>             -- 
>             Pedro Henrique de Souza Medeiros
>             ----------------------------------
>             Cel: +55 (61) 9197-0993
>             Email: [email protected]
> 
>             Beautifulis better than ugly,
>             Explicitis better than implicit,
>             Simpleis better than complex,
>             Complexis better than complicated.
> 
>             The Zen of Python, byTim Peters
> 
>         -- 
>         You received this message because you are subscribed to the
>         Google Groups "elixir-lang-talk" group.
>         To unsubscribe from this group and stop receiving emails from
>         it, send an email to
>         [email protected]
>         
> <javascript:_e(%7B%7D,'cvml','elixir-lang-talk%[email protected]');>.
>         To view this discussion on the web visit
>         
> https://groups.google.com/d/msgid/elixir-lang-talk/1e9f934a-d4ce-469e-8030-14b466f8f9b9%40googlegroups.com
>         
> <https://groups.google.com/d/msgid/elixir-lang-talk/1e9f934a-d4ce-469e-8030-14b466f8f9b9%40googlegroups.com?utm_medium=email&utm_source=footer>.
> 
>         For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> 
>     -- 
>     Pedro Henrique de Souza Medeiros
>     ----------------------------------
>     Cel: +55 (61) 9197-0993
>     Email: [email protected]
>     <javascript:_e(%7B%7D,'cvml','[email protected]');>
> 
>     Beautifulis better than ugly,
>     Explicitis better than implicit,
>     Simpleis better than complex,
>     Complexis better than complicated.
> 
>     The Zen of Python, byTim Peters
> 
>     -- 
>     You received this message because you are subscribed to the Google
>     Groups "elixir-lang-talk" group.
>     To unsubscribe from this group and stop receiving emails from it,
>     send an email to [email protected]
>     
> <javascript:_e(%7B%7D,'cvml','elixir-lang-talk%[email protected]');>.
>     To view this discussion on the web visit
>     
> https://groups.google.com/d/msgid/elixir-lang-talk/CAJbPmJNvOrus_qhFrVuF2qgDBKYE678e6c%2Bk8iKTATey46kwsg%40mail.gmail.com
>     
> <https://groups.google.com/d/msgid/elixir-lang-talk/CAJbPmJNvOrus_qhFrVuF2qgDBKYE678e6c%2Bk8iKTATey46kwsg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>     For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> -- 
> 
> 
> *José Valim*
> www.plataformatec.com.br <http://www.plataformatec.com.br/>
> Skype: jv.ptec
> Founder and Director of R&D
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "elixir-lang-talk" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-talk/CAGnRm4Kp%3DtC3oZQeAvfKba_S5cooiYu07PmnLw6eYU%2BK3AwtGA%40mail.gmail.com
> <https://groups.google.com/d/msgid/elixir-lang-talk/CAGnRm4Kp%3DtC3oZQeAvfKba_S5cooiYu07PmnLw6eYU%2BK3AwtGA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-talk/5786F0F3.6040605%40fabricatorz.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to