Skip to content

Commit

Permalink
install into global ~/.julia/conda directory (#126)
Browse files Browse the repository at this point in the history
* install into global ~/.julia/conda directory

* include miniconda version in default rootenv, so that in the future we can have multiple versions installed simultaneously for different projects

* 0.6 installations are already global, better not to touch them
  • Loading branch information
stevengj authored Oct 12, 2018
1 parent 7094e2a commit 39019c8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ os:
- osx
- linux
julia:
- 0.6
- 0.7
- 1.0
- nightly
env:
- CONDA_JL_VERSION="2"
Expand Down
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
julia 0.6
julia 0.7
Compat 0.62.0
JSON
VersionParsing
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
environment:
matrix:
- julia_version: 0.6
- julia_version: 0.7
- julia_version: 1
- julia_version: nightly
Expand Down
1 change: 0 additions & 1 deletion deps/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
usr/
deps.jl
!.gitignore
23 changes: 14 additions & 9 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
using Compat

const condadir = abspath(homedir(), ".julia", "conda")
const condadeps = joinpath(condadir, "deps.jl")

module DefaultDeps
using Compat
if isfile("deps.jl")
include("deps.jl")
end
if !isdefined(@__MODULE__, :ROOTENV)
const ROOTENV = abspath(dirname(@__FILE__), "usr")
elseif isfile(Main.condadeps)
include(Main.condadeps)
end
if !isdefined(@__MODULE__, :MINICONDA_VERSION)
const MINICONDA_VERSION = "3"
end
if !isdefined(@__MODULE__, :ROOTENV)
const ROOTENV = joinpath(Main.condadir, MINICONDA_VERSION)
end
end

ROOTENV = get(ENV, "CONDA_JL_HOME", DefaultDeps.ROOTENV)
Expand All @@ -33,11 +38,11 @@ const ROOTENV = "$(escape_string(ROOTENV))"
const MINICONDA_VERSION = "$(escape_string(MINICONDA_VERSION))"
"""

if !isfile("deps.jl") || read("deps.jl", String) != deps
write("deps.jl", deps)
end
mkpath(condadir)
mkpath(ROOTENV)

if !isdir(ROOTENV)
# Ensure ROOTENV exists, otherwise prefix(ROOTENV) will throw
mkpath(ROOTENV)
for depsfile in ("deps.jl", condadeps)
if !isfile(depsfile) || read(depsfile, String) != deps
write(depsfile, deps)
end
end

0 comments on commit 39019c8

Please sign in to comment.