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 14:37
    bhaskarmelkani starred lihaoyi/Ammonite
  • Jan 29 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 29 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 28 15:07
    ishubelko starred lihaoyi/Ammonite
  • Jan 25 22:38
    borissmidt starred lihaoyi/Ammonite
  • Jan 25 17:12

    alexarchambault on 1.6.3

    (compare)

  • Jan 25 17:11

    alexarchambault on master

    1.6.3 (compare)

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

    lihaoyi on gh-pages

    5ad9ae5538f23cab92ccd8c6b1617d8… (compare)

  • Jan 25 00:50

    alexarchambault on master

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

  • Jan 25 00:50
    alexarchambault closed #923
  • Jan 25 00:50
    alexarchambault closed #920
  • Jan 25 00:50
    alexarchambault closed #922
  • Jan 24 23:13
    lihaoyi commented #923
  • Jan 24 22:39
    alexarchambault closed #921
  • Jan 24 22:39
    alexarchambault commented #921
  • Jan 24 22:39
    alexarchambault edited #923
  • Jan 24 22:38
    alexarchambault opened #923
  • Jan 24 22:37
    david-bouyssie commented #919
  • Jan 24 21:33
    nksureshkumar commented #922
Piotr Jander
@mhonadh_twitter
Ok now I see it's res0 etc
After adding ammonite to my project's build sbt, I can run ammonite with sbt test:run. However, when I do sbt test, which previously would run my unit tests, I get java.util.NoSuchElementException: None.get. Did anyone encounter this?
Li Haoyi
@lihaoyi
@superamr_twitter the latest unstable release should be on 2.12.9
Quafadas
@Quafadas

Hoping someone can give me a pointer - I'm sat behind a corporate proxy trying to use ammonite. We have nexus setup between us and maven. I have successfully downloaded some ivy's into ammonite - import $ivy.com.lihaoyi::scalatags:0.7.0 works, which I think proves proves my predefs and coursier resolvers appear to be setup correctly.

I'd like to use com.github.seratch::awscala-s3:0.8.2, but that fails with an error that looks like; download error: Caught javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: . The same import (correctly formatted!) works (inside an sbt project), so I think the problem is that somehow ammonite is missing my corporate certificate.

Does this sound right? Is there a place I could attempt to add the cert so that ammonite knows about it? Any other hints or ideas?

Alexandre Archambault
@alexarchambault
@Quafadas coursier downloads these artifacts, the error originates from it.

Are you able to reproduce that error with the coursier CLI?
Calling it like

$ coursier resolve \
    --no-default \
    -r https://your-corporate-repo \
    com.github.seratch::awscala-s3:0.8.2

should result in an error IIUC your issue.

If that's the case, open an issue in the coursier repo
Also, the latest version of the coursier CLI shouldn't trap the stacktrace, it'll be helpful if you could add it in the issue.
Jon Keatley
@jckeatley
@Quafadas I have a similar situation at work. I set this environment variable before I run amm:
JAVA_OPTS='-Xmx1G -Djavax.net.ssl.keyStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.keyStorePassword=changeit -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStorePassword=changeit'
I'm running an Ubuntu system, and I put any local certificates into /usr/local/share/ca-certificates/<my-cert-dir>, then I run update-ca-certificatesas root.
Jon Keatley
@jckeatley
On my Windows machine, I run Cygwin64, and I put the local certs into /etc/pki/ca-trust/source/anchors, then run 'update-ca-trust'. I then use the Windows path for the cacerts, like this: C:/cygwin64/etc/pki/ca-trust/extracted/java/cacerts
Quafadas
@Quafadas
@alexarchambault @jckeatley Thankyou both very much - I realised my biggest problem was that when I was trying to add the cert to the keystore, I had forgotten to elevate privelges, but hadn't spotted keytool erroring out...
You put no on the right path to testability, and @jckeatley your config works great. Thanks again.
Marvin Ward Jr.
@choct155
Hello All, I'm a big fan of the project, and I'd love to use it at work. Is it possible to launch the REPL using only the ammonite jar (as opposed to the executable)?
Andy Czerwonka
@andyczerwonka
@choct155 you can probably crib that from the launch script in the distro
Li Haoyi
@lihaoyi
the executable is a jar. Search the docs for “embed”
Marvin Ward Jr.
@choct155
Thanks for the replies @andyczerwonka and @lihaoyi . Apologies as well for being unclear. I know I can list the jar as a dependency and use it within a project (we have been doing this via SBT on toy projects). I'd like to be able to launch the repl from the command line with a "java" call, but I'm running into dependency issues (for example, running Ammonite.Main depends on os-lib). In general, it is more difficult than might be obvious to get new software approved and into our organization. This actually hangs up our use of SBT for the time being, because we need to generate fat JARs and we are without sbt-assembly in the short run. (I know about the Mill project, which looks super cool. Ultimately, however, it hangs up for the same reasons in the short run.) Since the ammonite JAR is available for use, I was wondering if I was just missing some obvious way to call the repl from the command line that does not require additional dependencies.
In general, I'd love to push ammonite into our regular workflow which mostly involves writing Spark applications (hence the need for fat JARs). After using ammonite, the default Spark REPL leaves a lot to be desired.
Mateusz Błażejewski
@mblaze
Hi, I'm new to Ammonite and consider using it instead of bash but I'm also concerned about performance. Does every script execution create a new JVM? Have anybody tested how much overhead in startup time does it add compared to bash?
Olivier Mélois
@Baccata
@mblaze there is definitely an startup overhead related to the JVM. What ammonite gets you is correctness and maintainability of your scripts (as well as access to the extraordinary amount of scala/java libraries). You don't have to choose between bash and ammonite, you can decide to use one or the other depending on the complexity of the task you're trying to solve and the amount of times a day you're gonna run your scripts.
Paul S.
@pshirshov
Hi guys. Could you give me a hint if I workaround dependency convergence in ammonite somehow? My script depends on scopt v4 and seems clashes with the version shipped with ammonite. --thin doesn't help for some reason
Paul S.
@pshirshov
@here: could someone tell me if I can somehow override magic import behaviour so it would load a file with .scala extension?..
2efper
@2efPer
Does ammonite has paste mode?
jvr-ks
@jvr-ks
@2efPer Put the code inside { ... }
Tim Harper
@timcharper
Does ammonite have the equivalent of $0 (i.e. from bash SCRIPT_DIR=$(dirname "$0")) ? I'd like my script to be relatively invocable
Li Haoyi
@lihaoyi
I think you can use sourccode.File
Tim Harper
@timcharper
neat, that does it!
oh... no :(
does not include the path
// lol.sc
println(sourcecode.File())
$ amm lol.sc
lol.sc

$ cd ..
$ amm tim/lol.sc
lol.sc
Tim Harper
@timcharper
so, no, unfortunately this does not work. The docs for sourcecode say it gives the full path but something magic must be happening
Li Haoyi
@lihaoyi
probably a bug in ammonite
can you open an issue?
it should be the full path everywhere
Srepfler Srdan
@schrepfler
the homebrew casks are no longer getting published ?
Bassel
@Shokodemon
hey ho is there a way to set ammote repl prompt from the build.sbt ?
Tim Harper
@timcharper

@lihaoyi I found this issue, looks like the same one; should I reopen it? lihaoyi/Ammonite#493

I've confirmed the bug in 1.5.x Ammonite and also in 1.7.1

Li Haoyi
@lihaoyi
sure
Can anyone take a look at this question on shell script
Matthew de Detrich
@mdedetrich

So I just upgraded to Amm 1.7.1 and I am getting the following

Logistics.sc:6: not found: value coursier
import coursier.core.Authentication, coursier.MavenRepository
       ^
Logistics.sc:6: not found: value coursier
import coursier.core.Authentication, coursier.MavenRepository

when trying to specify authentication settings for a repository

for some reason the coursier variable is no longer visible?
ahhh its coursierapi now
Matthew de Detrich
@mdedetrich
Hmm actually I am having a problem here, for some reason Authentication is not visible in the coursier api
Matthew de Detrich
@mdedetrich
In fact it seems to be impossible to add a repository to interp.repositories() that requires authentication?
Brian Maso
@bmaso
I literally had a dream last night of being able to plot out visualizations in a scala REPL (a la a jupyter notebook with matplot). With regard to that, can anyone offer a rough sketch of what modifications would be necessary in Ammonite to support outputting an image as the response to a line of code in Ammonite?
Sören Brunk
@sbrunk
@bmaso perhaps not exactly the same but you can use Ammonite with support for embedded plots in an actual Jupyter notebook via https://almond.sh
Brian Maso
@bmaso
@sbrunk Thanks. I hadn't realized jupyter-scala had advanced somewhat -- last time I had tried to use it it, it was a bit krufty.
Anton Kulaga
@antonkulaga
Stupid question: how one can pre-compile ammonite script without running it?
In my docker container I have a script with one @main() method, I want to precompile when I build docker container so the user will not wait much, but I do not want the main function to be run.