Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ jobs:
PYTHON: python
- run: julia test/check_deps_version.jl ${{ matrix.python-version }}
- uses: julia-actions/julia-runtest@v1
env:
# Windows temp directories break the CI:
# https://github.com/actions/runner-images/issues/712
# so, we use
# https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
_TMP_DIR: ${{ runner.temp }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
Expand Down
17 changes: 14 additions & 3 deletions test/test_venv.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
using PyCall, Test

"""Gets temp directory, possibly with user-set environment variable"""
function _mktempdir(f::Function, parent=nothing; kwargs...)
if parent === nothing && haskey(ENV, "_TMP_DIR")
return mktempdir(f, ENV["_TMP_DIR"]; kwargs...)
end
if parent === nothing
parent = tempdir()
end
return mktempdir(f, parent; kwargs...)
end


function test_venv_has_python(path)
newpython = PyCall.python_cmd(venv=path).exec[1]
Expand Down Expand Up @@ -35,7 +46,7 @@ function test_venv_activation(path)
# Marking the test broken in Windows. It seems that
# venv copies .dll on Windows and libpython check in
# PyCall.__init__ detects that.
@test_broken begin
@test begin
output = read(jlcmd, String)
sys_executable, exec_prefix, mod_file = split(output, "\n")
newpython == sys_executable
Expand All @@ -57,7 +68,7 @@ end
elseif Sys.which(pyname) === nothing
@info "No $pyname command. Skipping the test..."
else
mktempdir() do tmppath
_mktempdir() do tmppath
if PyCall.pyversion.major == 2
path = joinpath(tmppath, "kind")
else
Expand Down Expand Up @@ -108,7 +119,7 @@ end
elseif !success(PyCall.python_cmd(`-c "import venv"`, python=python))
@info "Skip venv test since venv package is missing."
else
mktempdir() do tmppath
_mktempdir() do tmppath
if PyCall.pyversion.major == 2
path = joinpath(tmppath, "kind")
else
Expand Down