Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- function test_venv() {
- cmd=$1
- venv_dir=$(mktemp -d)
- tmp_dir=$(mktemp -d)
- if ! $cmd ${venv_dir} > /dev/null 2>&1; then
- return
- fi
- ln -s ${venv_dir}/bin/python ${tmp_dir}/python
- if [ ! "$(${tmp_dir}/python -c 'import sys; print(sys.path)'|grep ${venv_dir})" ]; then
- echo "$cmd: venv lost"
- else
- echo "$cmd: venv ok"
- fi
- }
- uname -a
- test_venv 'python3.6 -m venv'
- test_venv 'python3.7 -m venv'
- test_venv 'virtualenv-2'
- test_venv 'virtualenv -p python3.6'
- test_venv 'virtualenv -p python2.7'
- test_venv 'virtualenv -p python3.7'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement