Skip to content

Commit

Permalink
update vagrantfile
Browse files Browse the repository at this point in the history
  • Loading branch information
obestwalter committed Jul 15, 2017
1 parent 9f59591 commit 70e6bf5
Showing 1 changed file with 19 additions and 45 deletions.
64 changes: 19 additions & 45 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,26 @@
INTERPRETERS = [
"3.6.0",
"3.5.2",
"3.4.5",
"3.3.6",
"2.7.13",
"2.6.9",
"pypy2-5.6.0"
],
<<-DOC
Start a virtualbox image with
* all supported interpreters installed
* tox installed
* this folder mapped read/writable to /vagrant
* convenient way to ssh into the box
PYENV_BIN_PATH = "/home/vagrant/.pyenv/bin"
This should work from Windows, macOS and Linux.
To run tests in the box do:
$ cd </path/to/where/this/file/is>
$ vagrant up arch
$ vagrant ssh arch
$ tox
Prerequisites: https://www.vagrantup.com/ and https://www.virtualbox.org/
DOC

Vagrant.configure("2") do |config|
config.vm.define :lin do |lin|
lin.vm.box = "obestwalter/tox-dev-arch-linux"
lin.vm.provider "virtualbox" do |vb|
config.vm.define :arch do |arch|
arch.vm.box = "obestwalter/bindlestiff-arch-linux"
arch.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
prepDevenv = <<-HEREDOC
if [ -d "#{PYENV_BIN_PATH}" ]; then
#{PYENV_BIN_PATH}/pyenv update
else
sudo pacman --noconfirm -S base-devel openssl zlib git xz
curl pyenv.run | sh
sed -i '$ a\\export PATH="$HOME/.pyenv/bin:$PATH"' .bashrc
sed -i '$ a\\eval "$(pyenv init -)"' .bashrc
sed -i '$ a\\export TMPDIR="#{GUEST_TMP_DIR}"' .bashrc
sed -i '$ a\\cd #{PROJECTS_MOUNT}' .bashrc
fi
export PATH="#{PYENV_BIN_PATH}:$PATH"
eval "$(pyenv init -)"
echo #{INTERPRETERS.join(" ")}
for version in #{INTERPRETERS.join(" ")}; do
pyenv install -s $version
done
pyenv global #{INTERPRETERS.join(" ")}
pip install -U tox
pip install -U -e /vagrant
# pytest fails with ImportMismatchError if we don't tidy up
find /vagrant -name '*.pyc' -delete
HEREDOC
lin.vm.provision "shell",
name: "prepare devenv",
inline: prepDevenv,
privileged: false
end

# No automation here yet, just the bare box wating to be configured ...
config.vm.define :win do |win|
win.vm.box = "inclusivedesign/windows10-eval"
end
end

0 comments on commit 70e6bf5

Please sign in to comment.