# Travis and Julia 1.0

**URL:** <https://discourse.julialang.org/t/travis-and-julia-1-0/13166>\
**Category:** General Usage\
**Tags:** travis\
**Created:** [August 10, 2018, 10:59am UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166 "2018-08-10T10:59:20Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![traktofon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/traktofon/32/591_2.png) [@traktofon](https://discourse.julialang.org/u/traktofon)\
**Post date:** [August 10, 2018, 10:59am UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166/1 "2018-08-10T10:59:20Z")

</div>

I noticed that testing of my package on Travis is broken with Julia 1.0/nightly (using the `travis.yml` that was recommended in the past):

> $ julia -e ‘Pkg.clone(pwd()); Pkg.build(“FortranFiles”); Pkg.test(“FortranFiles”; coverage=true)’  
> ERROR: UndefVarError: Pkg not defined

Of course this is easy to fix, just need to add `using Pkg`. But then the Travis script will not work on Julia 0.6. I’m not very familiar with Travis, so what’s the best way to run different test scripts for different Julia versions?

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [August 10, 2018, 11:28am UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166/2 "2018-08-10T11:28:11Z")

</div>

I can’t help much but it seems to be something else than just a missing using Pkg  
because I just get the expected warnings:

> Julia for Travis-CI is not officially supported, but is community maintained.  
> Please file any issues using the following link  
> [Sign in to GitHub · GitHub](https://github.com/travis-ci/travis-ci/issues/new?labels=julia)  
> and mention `@travis-ci/julia-maintainers`in the issue  
> Julia-install  
> Installing Julia  
> 0.01s$ CURL\_USER\_AGENT=“Travis-CI (curl --version | head -n 1)" 0.01s mkdir -p ~/julia  
> 6.59s$ curl -A “CURL\_USER\_AGENT" -s -L --retry 7 'https://julialangnightlies-s3.julialang.org/bin/linux/x64/julia-latest-linux64.tar.gz' | tar -C ~/julia -x -z --strip-components=1 -f - 0.00s export PATH=”{PATH}:{HOME}/julia/bin”  
> $ julia -e ‘versioninfo()’  
> WARNING: Base.versioninfo is deprecated: it has been moved to the standard library package `InteractiveUtils`.  
> Add `using InteractiveUtils` to your imports.  
> in module Main  
> Julia Version 1.0.0-DEV.14  
> Commit 1dfc4d1fb0 (2018-08-04 07:20 UTC)  
> Platform Info:  
> OS: Linux (x86\_64-pc-linux-gnu)
> 
> …
> 
> The command “if [[-a .git/shallow]]; then git fetch --unshallow; fi” exited with 0.  
> 27.30s$ julia -e ‘Pkg.clone(pwd()); Pkg.build(“NormalizeQuantiles”); Pkg.test(“NormalizeQuantiles”; coverage=true)’;  
> WARNING: Base.Pkg is deprecated, run `using Pkg` instead  
> in module Main  
> Warning: Pkg.clone is only kept for legacy CI script reasons, please use `add`  
> …

And test is succeeding.

---

<div class="post-metadata">

**Author:** ![traktofon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/traktofon/32/591_2.png) [@traktofon](https://discourse.julialang.org/u/traktofon)\
**Post date:** [August 10, 2018, 12:35pm UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166/3 "2018-08-10T12:35:52Z")

</div>

Thanks. But your log shows Julia version

> [@oheil](#):
>
> 1.0.0-DEV.14

At that time, `Base.Pkg` was only deprecated but not removed. In the release Julia 1.0, `using Pkg` is needed.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [August 10, 2018, 12:39pm UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166/4 "2018-08-10T12:39:31Z")

</div>

Ah, ok, I restart my travis build and report if it is the same issue you have.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [August 10, 2018, 12:42pm UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166/5 "2018-08-10T12:42:07Z")

</div>

Problem confirmed!

Which contradicts what was said, that 1.0 only removes the deprecation warnings.

---

<div class="post-metadata">

**Author:** ![traktofon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/traktofon/32/591_2.png) [@traktofon](https://discourse.julialang.org/u/traktofon)\
**Post date:** [August 10, 2018, 12:58pm UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166/6 "2018-08-10T12:58:04Z")

</div>

Thanks for confirming! I think what is removed in 1.0 is not the deprecation warnings, but the deprecated features themselves.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [August 10, 2018, 1:03pm UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166/7 "2018-08-10T13:03:29Z")

</div>

Yes, all the deprecated warning were removed. Hence, consequently, you cannot use those features anymore.

By the way, all my tests in Travis against 1.0 are failing.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [August 10, 2018, 1:06pm UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166/8 "2018-08-10T13:06:50Z")

</div>

So is

```julia
if VERSION >= v"0.7.0-"
   using Pkg;
end

```

the way to go?

---

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [August 10, 2018, 1:09pm UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166/9 "2018-08-10T13:09:10Z")

</div>

this is what I just wanted to suggest  
`VERSION>=v"0.7-"&&using Pkg;`

I think Compat is usually the tool to solve such issues. But I have never used it.

> **[GitHub - JuliaLang/Compat.jl: Compatibility across Julia versions](https://github.com/JuliaLang/Compat.jl)**
>
> Compatibility across Julia versions. Contribute to JuliaLang/Compat.jl development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [August 10, 2018, 1:13pm UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166/10 "2018-08-10T13:13:09Z")

</div>

Yes, working, my travis.yml:

```julia
script:
   - if [[-a .git/shallow]]; then git fetch --unshallow; fi
   - julia -e 'if VERSION >= v"0.7.0-" using Pkg; end; Pkg.clone(pwd()); Pkg.build("NormalizeQuantiles"); Pkg.test("NormalizeQuantiles"; coverage=true)';

```

---

<div class="post-metadata">

**Author:** ![traktofon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/traktofon/32/591_2.png) [@traktofon](https://discourse.julialang.org/u/traktofon)\
**Post date:** [August 10, 2018, 1:23pm UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166/11 "2018-08-10T13:23:22Z")

</div>

Thanks, this seems to be working. I was thinking there may be a way to have Travis run different scripts for different Julia versions, but having the switch inside the Julia script will do for now.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [August 10, 2018, 3:54pm UTC](https://discourse.julialang.org/t/travis-and-julia-1-0/13166/12 "2018-08-10T15:54:31Z")

</div>

The travis tests are fixed now. Julia is now being called using:

```
julia --color=yes -e "VERSION >= v\"0.7.0-DEV.5183\" && using Pkg; Pkg.clone(pwd()); Pkg.build(\"${JL_PKG}\")"

```

I did not alter my `.travis.yml`.
