by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 30 2019 14:37
    bhaskarmelkani starred lihaoyi/Ammonite
  • Jan 29 2019 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 29 2019 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 28 2019 15:07
    ishubelko starred lihaoyi/Ammonite
  • Jan 25 2019 22:38
    borissmidt starred lihaoyi/Ammonite
  • Jan 25 2019 17:12

    alexarchambault on 1.6.3

    (compare)

  • Jan 25 2019 17:11

    alexarchambault on master

    1.6.3 (compare)

  • Jan 25 2019 15:48
    alexarchambault commented #923
  • Jan 25 2019 01:15

    lihaoyi on gh-pages

    5ad9ae5538f23cab92ccd8c6b1617d8… (compare)

  • Jan 25 2019 00:50

    alexarchambault on master

    Partly revert 84d48542 (#923) … (compare)

  • Jan 25 2019 00:50
    alexarchambault closed #923
  • Jan 25 2019 00:50
    alexarchambault closed #920
  • Jan 25 2019 00:50
    alexarchambault closed #922
  • Jan 24 2019 23:13
    lihaoyi commented #923
  • Jan 24 2019 22:39
    alexarchambault closed #921
  • Jan 24 2019 22:39
    alexarchambault commented #921
  • Jan 24 2019 22:39
    alexarchambault edited #923
  • Jan 24 2019 22:38
    alexarchambault opened #923
  • Jan 24 2019 22:37
    david-bouyssie commented #919
  • Jan 24 2019 21:33
    nksureshkumar commented #922
Damian Reeves
@DamianReeves
Hi, is there some sort of trick to get code-completion working on ivy dependencies either in VS Code or IntelliJ?
Wojtek Pituła
@Krever
Hey, I've hit classpath issue when using os-lib in jupyter. My guess is that is because of embedded os-lib instance. Is there a way to hide it? Or at least check what version comes as embedded?
Damian Reeves
@DamianReeves
Is there a jar that exists on maven that I can use as the startup for ammonite?
Anton Sviridov
@keynmol
@kofish-sl sys.exit(1) should still work in the script
@DamianReeves do you mean the code from dependencies themselves or autocompleting the $ivy.... blocks with actual suggestions from coursier?
Damian Reeves
@DamianReeves
Code from dependencies themselves
Anton Sviridov
@keynmol

Actually just recently ammonite script support in metals got merged and it's quite good.

The kicker is that it's not actually released yet, but you can make VS Code to use Metals' snapshot version: https://scalameta.org/metals/docs/editors/vscode.html#using-latest-metals-snapshot

I have this override in all of my of my projects and overall the support for Ammonite scripts is quite impressive. It takes a few Metals: Restart server to get it to pick up new dependencies, but the experience of editing an individual ammonite script in VS code with IDE features is quite incredible :)
Damian Reeves
@DamianReeves
thanks
Nitay Kufert
@nitayk

Hello, I need some help after I broke ammonite when trying to use https://github.com/mmolimar/kukulcan.
(I had to install java11, reinstall ammonite etc)

The current situation is when I try to launch ammonite I get:

 ~  amm
Loading...
Compiling /Users/nitaykufert/.ammonite/predef.sc
Compiling /Users/nitaykufert/.ammonite/predef.sc #2
predef.sc:11: object PathConvertible is not a member of package ammonite.ops
  import ammonite.ops.PathConvertible._
                      ^
predef.sc:12: not found: value cwd
  val p = ammoniteModules.orElse(scala.sys.env.get("AMMONITE_MODULES").map(s => Path(s))).getOrElse(cwd)
                                                                                                    ^
predef.sc:13: not found: value cwd
  val c = cwd
          ^
Compilation Failed
Olivier Mélois
@Baccata
@nitayk try to replace cwd by os.pwd
also remove the ammonite.ops import and use os.Path instead
Nitay Kufert
@nitayk
Thanks for the response.
I'll try it soon.
I got the predef file both under .ammonite & also in the ammonite-modules (with export AMMONITE_MODULES="/Users/nitaykufert/Supersonic/ammonite-modules";)
I can see the code is different - The error is thrown from .ammonite
Any idea of how I got to this situation?
Olivier Mélois
@Baccata
a quick googling led me to https://github.com/yeghishe/ammonite-modules which I assume is what you're referring to ... a wild guess would be that it ain't up to date with the latest ammonite, can't say for sure
Nitay Kufert
@nitayk
Thanks! for some reason I missed the fact that this is unrelated to the original repo :/
This fixed it for me: curl https://raw.githubusercontent.com/yeghishe/ammonite-modules/master/predef.sc > ~/.ammonite/predef.sc
(I belive your guess was right, as part of my efforts I've updated that repo but didn't override the predef file)
Thanks for the help and sorry for the google-quest, I just missed that in my searches
Oron Port
@soronpo
Hi all. Are you aware that Scala 3 will not support symbol literals (e.g. val target = root/'target/'file will not be possible). Do you have opinion on that? I did not see any discussion on this.
Li Haoyi
@lihaoyi
you can use strings in your path segments
it’s one more character but nbd
Oron Port
@soronpo
I am aware. Just so much user-code is out there with this syntax...
Li Haoyi
@lihaoyi
yeah, that’ll just have to change
Yann Moisan
@YannMoisan
hello. I'm trying to use a private maven repositories and I run into the following error :
@ import $repo.`https://xxx/content/repositories/releases`
Import Hook List($repo, https://xxx/content/repositories/releases) could not be resolved
Anton Sviridov
@keynmol
@YannMoisan which version are you using?
the "$repo" import hook is in 2.13-2.1.4-7-d1e71b9 version, which is not part of a release yet (you can still use it tho)
Yann Moisan
@YannMoisan
Welcome to the Ammonite Repl 2.1.4 (Scala 2.13.2 Java 13.0.2)
I've found a workaround. As it's cousier behind the hood, I've used :
export COURSIER_REPOSITORIES="ivy2Local|central|https://xxx/content/repositories/releases"
Anton Sviridov
@keynmol

$repo is equivalent to

interp.repositories() ++= Seq(coursierapi.MavenRepository.of("https://blabla"))

@

// your script

which should work out of the box in 2.1.4 and earlier versions

Soren
@srnb_gitlab
Is there an example out there of wrappers for commands? Typing %yay("-Syu", "--devel") all the time is kind of a bother.
deeex
@OverTheHeap_twitter
image.png
hi all, got an error like this, any ideas?
deeex
@OverTheHeap_twitter
ok, the version I'm having problem with is 0.9.1, but it works when switch to 0.8.2
Prada Souvanlasy
@pradasouvanlasy
Hi, might have overlooked something but is there a way to either exclude or enforce a dependency?
I'm declaring a single dependency through import $ivy.com.google.cloud:google-cloud-bigtable:1.13.0` but I end up with conflicting deps.
Prada Souvanlasy
@pradasouvanlasy

Self answer for this precise case if I can help someone else:

interp.load.ivy("com.google.cloud" % "google-cloud-bigtable" % "1.13.0" addExclusion("io.grpc", "grpc-core") addExclusion("io.grpc", "grpc-netty-shaded"))
interp.load.ivy("io.grpc" % "grpc-core" % "1.28.1")
interp.load.ivy("io.grpc" % "grpc-netty-shaded" % "1.28.1")

Not very straightforward since I had to check https://github.com/coursier/interface/blob/master/interface/src/main/java/coursierapi/Dependency.java to figure this out but could help to make it more obvious from the ammonite docs IMHO

philbertw4
@philbertw4
hi all, does the ammonite-sshd package not exist anymore, or has been moved somewhere? I am having a hard time pulling it into my project. (it is mentioned here: http://ammonite.io/#RemoteREPL)
Oron Port
@soronpo
Maybe a dumb question. Is it possible for the ammonite REPL to first try to print via TPrint and if it fails to find an implicit then it will fall back on the default printer?
I mean on printing return values. Not when the user explicitly invokes TPrint
Li Haoyi
@lihaoyi
probably possible, just need to change the implementation of tprint to do so
Oron Port
@soronpo
Does anybody have experience with macro annotations in Ammonite? I turn on the flag, but it doesn't seem to work.
Oron Port
@soronpo
Am I doing something wrong?
@ interp.configureCompiler(_.settings.YmacroAnnotations.value = true)


@ @df class Foo
cmd2.sc:1: macro annotation could not be expanded (since these are experimental, you must enable them with -Ymacro-annotations)
@df class Foo
          ^
Compilation Failed
Li Haoyi
@lihaoyi
not sure, you’ll have to investigate
Oron Port
@soronpo
@lihaoyi I experimented some more and have more info.
I had interp.configureCompiler(_.settings.YmacroAnnotations.value = true) in predef along with the library import.
That gives an error, but if I directly inputted it in ammonite then it was fine.
So I used preConfigureCompiler instead and everything works now.
Anton Sviridov
@keynmol

Can anyone here verify that this script (just two imports)

import $ivy.`org.deeplearning4j:deeplearning4j-core:0.9.1`
import $ivy.`org.nd4j:nd4j-native-platform:0.9.1`

works for them? I'm getting exceptions from coursier which indicate may be a conflict or a deadlock (missing .part files)

Weirdly enough, doing cs fetch org.deeplearning4j:deeplearning4j-core:0.9.1 separately seems to have resolved it :-/ But ammonite's coursier itself (in -w mode) seemingly couldn't download the dependencies
Nick Isaacs
@nicky-isaacs

Hi folks, im trying to track down the source of the following issue:

sh: /dev/tty: Device not configured

java.lang.RuntimeException: Nonzero exit value: 1
  scala.sys.package$.error(package.scala:30)
  scala.sys.process.ProcessBuilderImpl$AbstractBuilder.slurp(ProcessBuilderImpl.scala:138)
  scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang$bang(ProcessBuilderImpl.scala:108)
  ammonite.terminal.TTY$.stty(Utils.scala:103)
  ammonite.terminal.TTY$.withSttyOverride(Utils.scala:114)
// truncated

I am trying to start the repl with

ammonite.Main().run()

running on OSX with Java 8

Oron Port
@soronpo
image.png