using or import a specific package version

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

using or import a specific package version

Tom Lee
Hi all,

Is there any way to specify that "using" or "import" should load a specific package version without pinning the package to a particular version globally? I would like to prevent my older scripts breaking when packages are updated while still using the latest version by default.

Thanks,

Tom
Reply | Threaded
Open this post in threaded view
|

Re: using or import a specific package version

Tom Breloff
Not that I know of. Hopefully the next generation package manager (Pkg3) will enable this sort of conditional pinning. It should at least enable dual environments. 

On Friday, November 4, 2016, Tom Lee <[hidden email]> wrote:
Hi all,

Is there any way to specify that "using" or "import" should load a specific package version without pinning the package to a particular version globally? I would like to prevent my older scripts breaking when packages are updated while still using the latest version by default.

Thanks,

Tom
Reply | Threaded
Open this post in threaded view
|

Re: using or import a specific package version

Stefan Karpinski
In Pkg3, if your script uses a particular environment, which can be project-local (i.e. local to the repository the script is in) then as long as you don't change the version of anything in that environment, it won't change. I wasn't planning on having a way of indicating a particular version in the source code at the point of loading something, however.

On Fri, Nov 4, 2016 at 6:30 PM, Tom Breloff <[hidden email]> wrote:
Not that I know of. Hopefully the next generation package manager (Pkg3) will enable this sort of conditional pinning. It should at least enable dual environments. 


On Friday, November 4, 2016, Tom Lee <[hidden email]> wrote:
Hi all,

Is there any way to specify that "using" or "import" should load a specific package version without pinning the package to a particular version globally? I would like to prevent my older scripts breaking when packages are updated while still using the latest version by default.

Thanks,

Tom

Reply | Threaded
Open this post in threaded view
|

Re: using or import a specific package version

Alex Mellnik
I'm really looking forward to this -- knowing that all my existing projects and tools will continue to operate in the same way after running Pkg.update() will be very welcome.  

On Friday, November 4, 2016 at 4:03:45 PM UTC-7, Stefan Karpinski wrote:
In Pkg3, if your script uses a particular environment, which can be project-local (i.e. local to the repository the script is in) then as long as you don't change the version of anything in that environment, it won't change. I wasn't planning on having a way of indicating a particular version in the source code at the point of loading something, however.

On Fri, Nov 4, 2016 at 6:30 PM, Tom Breloff <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nG6-3e6eAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">t...@...> wrote:
Not that I know of. Hopefully the next generation package manager (Pkg3) will enable this sort of conditional pinning. It should at least enable dual environments. 


On Friday, November 4, 2016, Tom Lee <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nG6-3e6eAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ma...@...> wrote:
Hi all,

Is there any way to specify that "using" or "import" should load a specific package version without pinning the package to a particular version globally? I would like to prevent my older scripts breaking when packages are updated while still using the latest version by default.

Thanks,

Tom

Reply | Threaded
Open this post in threaded view
|

Re: using or import a specific package version

Tom Lee
In reply to this post by Stefan Karpinski
Project-local environments sounds like exactly what I am after. Great to hear its being worked on. I guess we will need to wait until 0.6 for Pkg3?

On Saturday, 5 November 2016 09:03:45 UTC+10, Stefan Karpinski wrote:
In Pkg3, if your script uses a particular environment, which can be project-local (i.e. local to the repository the script is in) then as long as you don't change the version of anything in that environment, it won't change. I wasn't planning on having a way of indicating a particular version in the source code at the point of loading something, however.

On Fri, Nov 4, 2016 at 6:30 PM, Tom Breloff <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nG6-3e6eAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">t...@...> wrote:
Not that I know of. Hopefully the next generation package manager (Pkg3) will enable this sort of conditional pinning. It should at least enable dual environments. 


On Friday, November 4, 2016, Tom Lee <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nG6-3e6eAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ma...@...> wrote:
Hi all,

Is there any way to specify that "using" or "import" should load a specific package version without pinning the package to a particular version globally? I would like to prevent my older scripts breaking when packages are updated while still using the latest version by default.

Thanks,

Tom

Reply | Threaded
Open this post in threaded view
|

Re: using or import a specific package version

Steven G. Johnson


On Saturday, November 5, 2016 at 12:38:41 AM UTC-4, Tom Lee wrote:
Project-local environments sounds like exactly what I am after. Great to hear its being worked on. I guess we will need to wait until 0.6 for Pkg3?

No, you can do that now.

insert!(LOAD_PATH, 1, mypath)
insert!(Base.LOAD_CACHE_PATH, 1, mypath)

will add mypath to the module and cache loading path.  Then you can put whatever modules you want into mypath and they will take precedence over the ones in the standard path.
Reply | Threaded
Open this post in threaded view
|

Re: using or import a specific package version

Adrian Salceanu
I have used DeclarativePackages (https://github.com/rened/DeclarativePackages.jl) - it's quite all right. 
Also, a while ago I've stumbled onto Playground (https://github.com/Rory-Finnegan/Playground.jl) but I haven't tried it myself. 


sâmbătă, 5 noiembrie 2016, 15:09:50 UTC+2, Steven G. Johnson a scris:


On Saturday, November 5, 2016 at 12:38:41 AM UTC-4, Tom Lee wrote:
Project-local environments sounds like exactly what I am after. Great to hear its being worked on. I guess we will need to wait until 0.6 for Pkg3?

No, you can do that now.

insert!(LOAD_PATH, 1, mypath)
insert!(Base.LOAD_CACHE_PATH, 1, mypath)

will add mypath to the module and cache loading path.  Then you can put whatever modules you want into mypath and they will take precedence over the ones in the standard path.