Skip to content

Commit

Permalink
Install Miniconda3-4.5.4 (Python 3.6) on Windows (JuliaPy#124)
Browse files Browse the repository at this point in the history
* Use Appveyor.jl

* Bring back 0.6

* Test Conda.add for Python package

* Install Miniconda3-4.5.4 on Windows

* Use python=3.6 in test
  • Loading branch information
tkf authored and stevengj committed Sep 22, 2018
1 parent 4781680 commit 7094e2a
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 15 deletions.
45 changes: 32 additions & 13 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
environment:
matrix:
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
- julia_version: 0.6
- julia_version: 0.7
- julia_version: 1
- julia_version: nightly

platform:
- x86 # 32-bit
- x64 # 64-bit

# # Uncomment the following lines to allow failures on nightly julia
# # (tests will run but not make your overall status red)
# matrix:
# allow_failures:
# - julia_version: nightly

branches:
only:
- master
- /release-.*/

notifications:
- provider: Email
Expand All @@ -12,16 +27,20 @@ notifications:
on_build_status_changed: true

install:
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
- ps: (new-object net.webclient).DownloadFile(
$env:JULIA_URL,
"C:\projects\julia-binary.exe")
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))

build_script:
- IF EXIST .git\shallow (git fetch --unshallow)
# Test #17 by using ENV[\"HOME\"]=joinpath(homedir(),\"Conda test home\")
- C:\projects\julia\bin\julia -e "versioninfo(); p = joinpath(homedir(),\"Conda test home\"); mkdir(p); ENV[\"HOME\"]=p; Pkg.clone(pwd(), \"Conda\"); Pkg.build(\"Conda\")"
- echo "%JL_BUILD_SCRIPT%"
- SET HOME=%userprofile%\Conda test home
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"

test_script:
- C:\projects\julia\bin\julia --check-bounds=yes -e "ENV[\"HOME\"]=joinpath(homedir(),\"Conda test home\"); Pkg.test(\"Conda\")"
- echo "%JL_TEST_SCRIPT%"
- SET HOME=%userprofile%\Conda test home
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"

# # Uncomment to support code coverage upload. Should only be enabled for packages
# # which would have coverage gaps without running on Windows
# on_success:
# - echo "%JL_CODECOV_SCRIPT%"
# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"
7 changes: 7 additions & 0 deletions src/Conda.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ function _installer_url()
elseif Compat.Sys.islinux()
res *= "Linux"
elseif Compat.Sys.iswindows()
if MINICONDA_VERSION == "3"
# Quick fix for:
# * https://github.com/JuliaLang/IJulia.jl/issues/739
# * https://github.com/ContinuumIO/anaconda-issues/issues/10082
# * https://github.com/conda/conda/issues/7789
res = "https://repo.continuum.io/miniconda/Miniconda$(MINICONDA_VERSION)-4.5.4-"
end
res *= "Windows"
else
error("Unsuported OS.")
Expand Down
19 changes: 17 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
using Conda, Compat, VersionParsing
using Compat
using Compat: @info
using Compat.Test

exe = Compat.Sys.iswindows() ? ".exe" : ""

Conda.update()

env = :test_conda_jl
rm(Conda.prefix(env); force=true, recursive=true)

@test Conda.exists("curl", env)
Conda.add("curl", env)

@testset "Install Python package" begin
Conda.add("python=3.6", env) # 3.7 doesn't work on Windows at the moment
pythonpath = joinpath(Conda.python_dir(env), "python" * exe)
@test isfile(pythonpath)

cmd = Conda._set_conda_env(`$pythonpath -c "import zmq"`, env)
@test_throws Exception run(cmd)
Conda.add("pyzmq", env)
run(cmd)
end

curlvers = Conda.version("curl",env)
@test curlvers >= v"5.0"
@test Conda.exists("curl==$curlvers", env)

exe = Compat.Sys.iswindows() ? ".exe" : ""

curl_path = joinpath(Conda.bin_dir(env), "curl" * exe)
@test isfile(curl_path)

Expand Down

0 comments on commit 7094e2a

Please sign in to comment.