# What would it take to bring this Julia 0.6 package to Julia 1.6?

**URL:** <https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652>\
**Category:** General Usage\
**Created:** [April 20, 2021, 9:45am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652 "2021-04-20T09:45:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 9:45am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/1 "2021-04-20T09:45:46Z")

</div>

Hi,

I found myself in a position where i need to solve a fully constraint lasso. There is a package there : [GitHub - Hua-Zhou/ConstrainedLasso.jl: Algorithms for fit constrained lasso](https://github.com/Hua-Zhou/ConstrainedLasso.jl) that does exactly what i need, but it’s old and works on Julia 0.6.

I’m not familiar with the differences between old and current Julia. What would it take to have this package work on current Julia 1.6 ? Would it need a full rewrite of the main code, or just a rewrite of the flourishes around the core componants of the package?

Is there some documentations on how to do that ?

---

<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:** [April 20, 2021, 9:47am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/2 "2021-04-20T09:47:30Z")

</div>

Best is to use it in Julia 0.7  
You will get quite detailed deprecation notes with suggestions (if I remember well).

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 9:49am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/3 "2021-04-20T09:49:41Z")

</div>

I do have code that i need to interact with that is already in current julia format, and downgrading it would probably be a pain. Which is why i asked.

Edit: Nevermind I did not understood what you meant. Ok so loading it in Julia 0.7 will give me deprecation notices that would help me port it to Julia 1.0 ?

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [April 20, 2021, 9:52am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/4 "2021-04-20T09:52:56Z")

</div>

You can just run the tests of CL.jl on Julia 0.7. Hopefully those would cover all to update it to Julia 1.0. Once it runs on 1.0, it will run on 1.6.

---

<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:** [April 20, 2021, 9:54am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/5 "2021-04-20T09:54:24Z")

</div>

I meant not to use it for your real problem but just use it in 0.7 to get the deprecations and suggestions. Perhaps it’s not so much to do to change everything in this package to make it run in 1.6.  
For what I have done in these days it wasn’t much work and quite easy.

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 10:04am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/6 "2021-04-20T10:04:39Z")

</div>

Would’nt it be easier to start with a fresh Pkg.Skeleton and copy sources and tests over the new interface until everything works ?

---

<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:** [April 20, 2021, 10:07am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/7 "2021-04-20T10:07:53Z")

</div>

Depends on the size of the package ( I didn’t checked ).  
And perhaps you could try to become the maintainer of this package for the future?

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 10:10am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/8 "2021-04-20T10:10:21Z")

</div>

> [@oheil](#):
>
> And perhaps you could try to become the maintainer of this package for the future?

I posted an issue, we’ll see if the developper wants to keep it or agrees to give it to me.

In 0.7, after instlal, i have :

```julia-auto
(v0.7) pkg> test ConstrainedLasso
   Testing ConstrainedLasso
 Resolving package versions...
    Status `C:\Users\u009192\AppData\Local\Temp\jl_5C93.tmp\Manifest.toml`
  [7d9fca2a] Arpack v0.3.2
  [9e28174c] BinDeps v0.8.10
  [b99e7846] BinaryProvider v0.5.10
  [34da2185] Compat v2.2.1
  [7e327ae7] ConstrainedLasso v0.0.0 [`C:\Users\u009192\.julia\dev\ConstrainedLasso`]
  [f65535da] Convex v0.11.3
  [864edb3b] DataStructures v0.16.1
  [31c24e10] Distributions v0.18.0
  [e2685f51] ECOS v0.9.4
  [8d5ece8b] GLMNet v0.4.2
  [b8f27783] MathOptInterface v0.8.4
  [fdba3010] MathProgBase v0.7.7
  [e1d29d7a] Missings v0.4.0
  [bac558e1] OrderedCollections v1.4.0
  [90014a1f] PDMats v0.9.12
  [1fd47b50] QuadGK v2.4.1
  [79098fc4] Rmath v0.5.1
  [a2af1166] SortingAlgorithms v0.3.1
  [276daf66] SpecialFunctions v0.7.2
  [2913bbd2] StatsBase v0.29.0
  [4c63d2b9] StatsFuns v0.8.0
  [30578b45] URIParser v0.4.1
  [2a0f44e3] Base64 [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Base64`]
  [ade2ca70] Dates [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Dates`]
  [8bb1440f] DelimitedFiles [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\DelimitedFiles`]
  [8ba89e20] Distributed [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Distributed`]
  [b77e0a4c] InteractiveUtils [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\InteractiveUtils`]
  [76f85450] LibGit2 [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\LibGit2`]
  [8f399da3] Libdl [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Libdl`]
  [37e2e46d] LinearAlgebra [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\LinearAlgebra`]
  [56ddb016] Logging [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Logging`]
  [d6f4376e] Markdown [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Markdown`]
  [a63ad114] Mmap [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Mmap`]
  [44cfe95a] Pkg [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Pkg`]
  [de0858da] Printf [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Printf`]
  [3fa0cd96] REPL [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\REPL`]
  [9a3f8284] Random [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Random`]
  [ea8e919c] SHA [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\SHA`]
  [9e88b42a] Serialization [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Serialization`]
  [1a1011a3] SharedArrays [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\SharedArrays`]
  [6462fe0b] Sockets [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Sockets`]
  [2f01184e] SparseArrays [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\SparseArrays`]
  [10745b16] Statistics [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Statistics`]
  [4607b0f0] SuiteSparse [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\SuiteSparse`]
  [8dfed614] Test [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Test`]
  [cf7118a7] UUIDs [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\UUIDs`]
  [4ec0a83e] Unicode [`C:\Users\u009192\AppData\Local\Julia-0.7.0\bin\..\share\julia\stdlib\v0.7\Unicode`]
WARNING: Base.Test is deprecated, run `using Test` instead
  likely near C:\Users\u009192\.julia\dev\ConstrainedLasso\test\constrsparsereg_test.jl:3
┌ Warning: `info()` is deprecated, use `@info` instead.
│ caller = top-level scope at none:0
└ @ Core none:0
INFO: Test lsq_constrsparsereg: sum-to-zero constraint
WARNING: importing deprecated binding Base.srand into constrsparsereg_test.
WARNING: Base.srand is deprecated: it has been moved to the standard library package `Random`.
Add `using Random` to your imports.
  likely near C:\Users\u009192\.julia\dev\ConstrainedLasso\test\constrsparsereg_test.jl:8
┌ Warning: `srand` is deprecated, use `Random.seed!` instead.
│ caller = top-level scope at none:0
└ @ Core none:0
┌ Warning: using `A[I...] = x` to implicitly broadcast `x` across many locations is deprecated. Use `A[I...] .= x` instead.
│ caller = top-level scope at none:0
└ @ Core none:0
┌ Warning: using `A[I...] = x` to implicitly broadcast `x` across many locations is deprecated. Use `A[I...] .= x` instead.
│ caller = top-level scope at none:0
└ @ Core none:0
┌ Warning: using `A[I...] = x` to implicitly broadcast `x` across many locations is deprecated. Use `A[I...] .= x` instead.
│ caller = top-level scope at none:0
└ @ Core none:0
┌ Warning: using `A[I...] = x` to implicitly broadcast `x` across many locations is deprecated. Use `A[I...] .= x` instead.
│ caller = top-level scope at none:0
└ @ Core none:0
┌ Warning: `info()` is deprecated, use `@info` instead.
│ caller = top-level scope at none:0
└ @ Core none:0
INFO: Optimize at a single tuning parameter value
ERROR: LoadError: LoadError: MethodError: no method matching sqrt(::Array{Float64,1})
Closest candidates are:
  sqrt(::Float16) at math.jl:1004
  sqrt(::Complex{Float16}) at math.jl:1005
  sqrt(::Missing) at math.jl:1056
  ...
Stacktrace:
 [1] #lsq_constrsparsereg#1(::Array{Float64,2}, ::Array{Float64,1}, ::Array{Float64,2}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Bool, ::ECOS.ECOSSolver, ::typeof(ConstrainedLasso.lsq_constrsparsereg), ::Array{Float64,2}, ::Array{Float64,1}, ::Float64) at C:\Users\u009192\.julia\dev\ConstrainedLasso\src\constrsparsereg.jl:66
 [2] (::getfield(ConstrainedLasso, Symbol("#kw##lsq_constrsparsereg")))(::NamedTuple{(:Aeq, :beq, :penwt, :solver),Tuple{Array{Float64,2},Array{Float64,1},Array{Float64,1},ECOS.ECOSSolver}}, ::typeof(ConstrainedLasso.lsq_constrsparsereg), ::Array{Float64,2}, ::Array{Float64,1}, ::Float64) at .\none:0
 [3] top-level scope at none:0
 [4] include at .\boot.jl:317 [inlined]
 [5] include_relative(::Module, ::String) at .\loading.jl:1038
 [6] include at .\sysimg.jl:29 [inlined]
 [7] include(::String) at C:\Users\u009192\.julia\dev\ConstrainedLasso\test\runtests.jl:1
 [8] top-level scope at none:0
 [9] include at .\boot.jl:317 [inlined]
 [10] include_relative(::Module, ::String) at .\loading.jl:1038
 [11] include(::Module, ::String) at .\sysimg.jl:29
 [12] include(::String) at .\client.jl:398
 [13] top-level scope at none:0
in expression starting at C:\Users\u009192\.julia\dev\ConstrainedLasso\test\constrsparsereg_test.jl:26
in expression starting at C:\Users\u009192\.julia\dev\ConstrainedLasso\test\runtests.jl:3
ERROR: Package ConstrainedLasso errored during testing

(v0.7) pkg> ^

```

Seems like there might be a lot to do.

Edit: To be sure that i am in the right track, is it the right thing to do to `dev` the package in Julia 0.7, make modifications and commits until tests passes, and then try the same repo on Julia 1.6 directly ?

---

<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:** [April 20, 2021, 10:17am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/9 "2021-04-20T10:17:14Z")

</div>

No, not so much 😉  
4 things:

```julia
`srand` is deprecated, use `Random.seed!` instead

```

```julia
Warning: using `A[I...] = x` to implicitly broadcast `x` across many locations is deprecated. Use `A[I...] .= x` instead.

```

```julia
Warning: `info()` is deprecated, use `@info` instead.

```

```julia
sqrt(::Array{Float64,1})

```

The last one should probably become

```julia
sqrt.(::Array{Float64,1})

```

---

<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:** [April 20, 2021, 10:18am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/10 "2021-04-20T10:18:35Z")

</div>

> [@lrnv](#):
>
> Edit: To be sure that i am in the right track, is it the right thing to do to `dev` the package in Julia 0.7, make modifications and commits until tests passes, and then try the same repo on Julia 1.6 directly ?

Sounds good to me (but I haven’t done it like that so I can’t tell from experience).  
I don’t even know if the `dev` thing was already there in 0.7, but you will see.

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 10:18am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/11 "2021-04-20T10:18:58Z")

</div>

> [@oheil](#):
>
> I don’t even know if the `dev` thing was already there in 0.7, but you will see.

It was not \>\<"

---

<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:** [April 20, 2021, 10:22am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/12 "2021-04-20T10:22:08Z")

</div>

I actually expect more to come after you fixed those 4 😉

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 10:23am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/13 "2021-04-20T10:23:17Z")

</div>

Me to. This would probably be a pain. Was Revise a thing on 0.7 ? What was the way to dev a package on 0.7 ? I’m an archeologist today !

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 10:25am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/14 "2021-04-20T10:25:14Z")

</div>

I have the following:

```julia
(v0.7) pkg> develop ConstrainedLasso
ERROR: The following package names could not be resolved:
 * ConstrainedLasso (7e327ae7-2474-5f1d-becc-899fe7a0c896 in manifest but not in project)
Please specify by known `name=uuid`.

```

I do not unserstand as i `add`ed it…

---

<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:** [April 20, 2021, 10:40am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/16 "2021-04-20T10:40:02Z")

</div>

This was wrong

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 10:48am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/17 "2021-04-20T10:48:02Z")

</div>

I started to correct some bugs and stuff, no i have the follwoing error that i do not understand:

MethodError: no method matching sumsquares(::Array{Convex.MultiplyAtom,1})

---

<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:** [April 20, 2021, 10:50am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/18 "2021-04-20T10:50:05Z")

</div>

```julia
(v0.7) pkg> rm ConstrainedLasso

(v0.7) pkg> dev ConstrainedLasso

```

created the project in the dev folder for me.

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 10:51am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/19 "2021-04-20T10:51:00Z")

</div>

Yes i managed to create it in the dev folder also.

i’m now going throughthe bugs. It seems like the handling of broadcast was not the same on 0.7…

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [April 20, 2021, 11:18am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/20 "2021-04-20T11:18:08Z")

</div>

I think you should be able to get through it in a few hours (unless you hit some hard to debug edge-case).

x-ref: [PSA: use Julia 0.7 if you are upgrading - #11 by jlapeyre](https://discourse.julialang.org/t/psa-use-julia-0-7-if-you-are-upgrading/13321/11) and tips therein.

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 11:31am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/21 "2021-04-20T11:31:04Z")

</div>

Thnaks for the help so far !

I’m now at a point where, making all modifications requested by the deprecations warnings, the tests do not pass…

I forked the repo there : [GitHub - lrnv/ConstrainedLasso.jl: Algorithms for fit constrained lasso](https://github.com/lrnv/ConstrainedLasso.jl) and added a first commit with some modifs, would you mind looking at the diff ? Maybe you’ll see something that I missed.

[Next page](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652.md?page=2)
