diff --git a/.travis.yml b/.travis.yml index 5ee23184..8a48714a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: python python: + - 2.6 - 2.7 - 3.2 - 3.3 diff --git a/REQUIRE b/REQUIRE index e6f20684..376e8944 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,3 +1,4 @@ julia 0.3 Compat 0.7.1 Dates +Conda 0.1.6 diff --git a/appveyor.yml b/appveyor.yml index d206e1d2..e3f93cd4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,6 +13,10 @@ environment: - JULIAVERSION: "julialang/bin/winnt/x86/0.3/julia-0.3-latest-win32.exe" PYTHONDIR: "C:\\Python34" PYTHON: "C:\\Python34\\python.exe" + + - JULIAVERSION: "julialang/bin/winnt/x86/0.3/julia-0.3-latest-win32.exe" + PYTHONDIR: "use_conda" + PYTHON: "use_conda" - JULIAVERSION: "julialang/bin/winnt/x64/0.3/julia-0.3-latest-win64.exe" PYTHONDIR: "C:\\Python27-x64" @@ -25,6 +29,10 @@ environment: - JULIAVERSION: "julialang/bin/winnt/x64/0.3/julia-0.3-latest-win64.exe" PYTHONDIR: "C:\\Python34-x64" PYTHON: "C:\\Python34-x64\\python.exe" + + - JULIAVERSION: "julialang/bin/winnt/x64/0.3/julia-0.3-latest-win64.exe" + PYTHONDIR: "use_conda" + PYTHON: "use_conda" # Nightlies - JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe" @@ -38,6 +46,10 @@ environment: - JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe" PYTHONDIR: "C:\\Python34" PYTHON: "C:\\Python34\\python.exe" + + - JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe" + PYTHONDIR: "use_conda" + PYTHON: "use_conda" - JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe" PYTHONDIR: "C:\\Python27-x64" @@ -50,6 +62,10 @@ environment: - JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe" PYTHONDIR: "C:\\Python34-x64" PYTHON: "C:\\Python34-x64\\python.exe" + + - JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe" + PYTHONDIR: "use_conda" + PYTHON: "use_conda" branches: only: diff --git a/deps/build.jl b/deps/build.jl index f52acfdc..bd1c6edc 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -9,6 +9,7 @@ isfile("deps.jl") && rm("deps.jl") using Compat +import Conda PYTHONIOENCODING = get(ENV, "PYTHONIOENCODING", nothing) PYTHONHOME = get(ENV, "PYTHONHOME", nothing) @@ -121,7 +122,22 @@ end # need to be able to get the version before Python is initialized Py_GetVersion(libpy) = bytestring(ccall(Libdl.dlsym(libpy, :Py_GetVersion), Ptr{UInt8}, ())) -const python = get(ENV, "PYTHON", "python") +use_conda = false +const python = try + let py = get(ENV, "PYTHON", "python"), vers = convert(VersionNumber, pyconfigvar(py,"VERSION","0.0")) + if vers < v"2.7" + error("Python version $vers < 2.7 is not supported") + end + py + end +catch e1 + info( "No system-wide Python was found; got the following error:\n", + "$e1\nusing the Python distribution in the Conda package") + use_conda = true + Conda.add("numpy") + abspath(Conda.PYTHONDIR, "python" * (@windows? ".exe" : "")) +end + const (libpython, libpy_name) = find_libpython(python) const programname = pysys(python, "executable") @@ -181,6 +197,8 @@ open("deps.jl", "w") do f const pyprogramname = $pystring("$(escape_string(programname))") const pyversion_build = $(repr(pyversion)) const PYTHONHOME = $pystring("$(escape_string(get(ENV, "PYTHONHOME", "")))") + "Returns a boolean of whether the Python distribtion in the Conda package is used" + const use_conda = $use_conda const PyUnicode_AsUTF8String = :$PyUnicode_AsUTF8String const PyUnicode_DecodeUTF8 = :$PyUnicode_DecodeUTF8