From b8602e397597bb340a5f641c14f3b812ac78e078 Mon Sep 17 00:00:00 2001 From: "James D. Bohrman" Date: Thu, 9 Aug 2018 21:05:29 -0400 Subject: [PATCH] Add a Vagrantfile for easier collaboration (#193) --- .gitignore | 3 +++ README.md | 14 ++++++++++++++ Vagrantfile | 11 +++++++++++ provisioner.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 Vagrantfile create mode 100644 provisioner.sh diff --git a/.gitignore b/.gitignore index b022ebec..71cb3794 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,6 @@ target/ # pyenv python configuration file .python-version + +# Vagrant folder +.vagrant \ No newline at end of file diff --git a/README.md b/README.md index aa2cdc69..fcd28a46 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,20 @@ $ cd pyswarms $ python setup.py install ``` +## Running in a Vagrant Box + +To run PySwarms in a Vagrant Box, install Vagrant by going to +https://www.vagrantup.com/downloads.html and downloading the proper packaged from the Hashicorp website. + +Afterward, run the following command in the project directory: + +```shell +$ vagrant provision +$ vagrant up +$ vagrant ssh +``` +Now you're ready to develop your contributions in a premade virtual enviroment. + ## Basic Usage PySwarms provides a high-level implementation of various particle swarm diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 00000000..bee6752f --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,11 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + +config.vm.box = "ubuntu/xenial64" + +config.vm.box_check_update = false + +config.vm.provision :shell, :privileged => false, :path => "provisioner.sh" +end \ No newline at end of file diff --git a/provisioner.sh b/provisioner.sh new file mode 100644 index 00000000..f49c0abd --- /dev/null +++ b/provisioner.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +export DEBIAN_FRONTEND=noninteractive + +# Update sources +sudo apt-get update -y + +# Git +sudo apt-get install git + +# Python +sudo apt-get install -y python-pip python-dev build-essential + +# PyYaml +sudo apt-get update +sudo apt-get install python-yaml + +# Future + +sudo apt-get update +pip install future + +# Scipy & Numpy +sudo apt-get update +sudo apt-get install python-numpy python-scipy + +# matplotlib +sudo apt-get update +sudo apt-get install python-matplotlib + +# Mock +sudo apt-get update +pip install mock + +# pytest +sudo apt-get update +pip install -U pytest + +# attrs +sudo apt-get update +pip install attrs + +# AWS Cli +sudo apt-get update +pip install awscli + +# Vim +sudo apt-get install vim -y \ No newline at end of file