├── .gitignore ├── README.md ├── Vagrantfile └── manifests ├── init.pp └── sql.pp /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | *~ 3 | *.swp 4 | .DS_Store 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## DESCRIPTION 2 | 3 | Complete Python Development Environment on top of a Vagrant VM. 4 | 5 | 6 | 7 | ## REQUIREMENTS 8 | 9 | 10 | * [VirtualBox](http://www.virtualbox.org/) 11 | * [VirtualBox Extension Pack](https://www.virtualbox.org/wiki/Downloads) 12 | * [Vagrant](http://www.vagrantup.com/) 13 | * [git](http://git-scm.com/downloads) 14 | or one of the Github GUI clients: [OSX](http://mac.github.com/), [Windows] (http://windows.github.com/), [Eclipse](http://eclipse.github.com/) 15 | * [python-dev-bootstrap](https://github.com/AnthonyNystrom/python-dev-bootstrap) 16 | 17 | Clone this repo: $ git clone git@github.com:AnthonyNystrom/python-dev-bootstrap.git 18 | Or, using one of the Github GUI clients, click the button: Clone in {platform} 19 | 20 | ## BASIC USAGE 21 | 22 | 1. Assuming you have met the above requirements. 23 | 2. Provision a new Vagrant VM (using PythonDevBootstrapPrecise as example) 24 | 25 | $ cd python-dev-bootstrap (Wherever your cloned path is for this repo) 26 | $ vagrant up 27 | $ vagrant ssh 28 | $ sudo su (Gets you to root) :) 29 | 30 | 31 | 32 | The above will build a 512MB virtual machine running Ubuntu with the following installed and configured: 33 | 34 | 1. Python 35 | 2. PIL 36 | 3. PIP 37 | 4. SciPy 38 | 5. BioPy 39 | 5. Redis, MongoDB, Postgres, MySQL, Elastic Search 40 | 6. Django 41 | 7. SQLAlchemy 42 | 8. Bottle 43 | 9. Twisted 44 | 10. Vim 45 | 11. IDLE 46 | 12. gEdit 47 | 13. SublimeText2 48 | 14. Pyes 49 | 15. POW (Python on Wheels) & Dep... 50 | 16. pyQt 51 | 17. NumPy 52 | 18. numarray 53 | 19. matplotlib 54 | 20. scrape 55 | 21. Beautiful Soup 56 | 22. pythonweb 57 | 23. mechanize 58 | 24. flask 59 | 60 | Hint: Not everything of this is installed by default. Change comments at the end of manifests/init.pp to influence it. 61 | 62 | ## OTHER 63 | 64 | You can download different types of "boxes" as your base at the following URL: 65 | 66 | http://www.vagrantbox.es/ 67 | 68 | --------------------------------------------------------------------- 69 | Maintained by [Anthony Nystrom](https://github.com/AnthonyNystrom) 70 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | 3 | config.vm.box = 'PythonDevBootstrap_13_10' 4 | config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-1310-x64-virtualbox-nocm.box" 5 | 6 | #network 7 | config.vm.network :private_network, ip: "192.168.33.10" 8 | 9 | #shared 10 | config.vm.synced_folder "./Development/Projects", "/projects", type: 'nfs' 11 | 12 | #virtualbox 13 | if defined? VagrantVbguest 14 | config.vbguest.auto_update = true 15 | end 16 | config.vm.provider :virtualbox do |vb| 17 | vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] 18 | vb.customize ["modifyvm", :id, "--memory", "1024"] 19 | end 20 | 21 | config.vm.provision :puppet do |puppet| 22 | puppet.manifests_path = "manifests" 23 | puppet.manifest_file = "init.pp" 24 | puppet.module_path = "modules" 25 | puppet.options = "--verbose --debug" 26 | #puppet.options = "--verbose --noop" 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /manifests/init.pp: -------------------------------------------------------------------------------- 1 | import "sql.pp" 2 | 3 | class core { 4 | exec { "apt-oldrepos": 5 | command => "/usr/bin/sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list" 6 | } 7 | 8 | exec { "apt-update": 9 | command => "/usr/bin/sudo apt-get -y update" 10 | require => Exec['apt-oldrepos'] 11 | } 12 | 13 | package { 14 | [ "vim", "git-core", "build-essential" ]: 15 | ensure => ["installed"], 16 | require => Exec['apt-update'] 17 | } 18 | } 19 | 20 | class python { 21 | 22 | package { 23 | [ "python", "python-setuptools", "python-dev", "python-pip", 24 | "python-matplotlib", "python-imaging", "python-numpy", "python-scipy", 25 | "python-software-properties", "idle", "python-qt4", "python-wxgtk2.8" ]: 26 | ensure => ["installed"], 27 | require => Exec['apt-update'] 28 | } 29 | 30 | exec { 31 | "virtualenv": 32 | command => "/usr/bin/sudo pip install virtualenv", 33 | require => Package["python-dev", "python-pip"] 34 | } 35 | 36 | } 37 | 38 | class pythondev { 39 | package { 40 | [ "dpkg-dev", "swig", "python2.7-dev", "libwebkitgtk-dev", "libjpeg-dev", "libtiff4-dev", 41 | "checkinstall", "ubuntu-restricted-extras", "freeglut3", "freeglut3-dev", "libgtk2.0-dev", "libsdl1.2-dev", 42 | "libgstreamer-plugins-base0.10-dev", "libwxgtk2.8-dev" ]: 43 | ensure => ["installed"], 44 | require => Exec['apt-update'] 45 | } 46 | 47 | exec { 48 | "SquareMap": 49 | command => "/usr/bin/sudo pip install SquareMap", 50 | require => Package["python-dev", "python-pip"] 51 | } 52 | 53 | exec { 54 | "RunSnakeRun": 55 | command => "/usr/bin/sudo pip install RunSnakeRun", 56 | require => Package["python-dev", "python-pip"] 57 | } 58 | 59 | exec { 60 | "wx-from-source": 61 | cwd => "/tmp", 62 | command => "/usr/bin/apt-get source -d wxwidgets2.8 && /usr/bin/dpkg-source -x wxwidgets2.8_2.8.12.1-6ubuntu2.dsc", 63 | #creates => "/tmp/wxwidgets2.8-2.8.12.1/wxPython", 64 | creates => '/usr/local/lib/python2.7/dist-packages/wx/lib/__init__.pyc', 65 | path => "/bin:/usr/bin:/usr/local/bin", 66 | 67 | require => [Exec['apt-update'], Package["python-dev", "python-pip", "dpkg-dev"]] 68 | } 69 | 70 | exec { 71 | "compile-wx-from-source": 72 | cwd => "/tmp/wxwidgets2.8-2.8.12.1/wxPython", 73 | command => "/usr/bin/sudo python setup.py install", 74 | creates => '/usr/local/lib/python2.7/dist-packages/wx/lib/__init__.pyc', 75 | path => '/bin:/usr/bin:/usr/local/bin', 76 | 77 | require => Exec['wx-from-source'] 78 | } 79 | } 80 | 81 | class networking { 82 | package { 83 | [ "snmp", "tkmib", "curl", "wget" ]: 84 | ensure => ["installed"], 85 | require => Exec['apt-update'] 86 | } 87 | 88 | } 89 | 90 | class science { 91 | 92 | exec { 93 | "numarray": 94 | command => "/usr/bin/sudo easy_install http://downloads.sourceforge.net/project/numpy/Old%20Numarray/1.5.2/numarray-1.5.2.tar.gz", 95 | require => Package["python-setuptools"] 96 | } 97 | 98 | exec { 99 | "biopy": 100 | command => "/usr/bin/sudo pip install http://biopy.googlecode.com/files/biopy-0.1.7.tar.gz", 101 | require => Package["python-numpy", "python-dev", "python-scipy", "python-pip"] 102 | } 103 | } 104 | 105 | class web { 106 | 107 | package { 108 | [ "python-twisted" ]: 109 | ensure => ["installed"], 110 | require => Exec['apt-update'] 111 | } 112 | 113 | exec { 114 | "bottle": 115 | command => "/usr/bin/sudo pip install bottle", 116 | require => Package["python-dev", "python-pip"] 117 | } 118 | 119 | exec { 120 | "sqlalchemy": 121 | command => "/usr/bin/sudo pip install sqlalchemy", 122 | require => Package["python-pip"], 123 | } 124 | 125 | exec { 126 | "django": 127 | command => "/usr/bin/sudo pip install django", 128 | require => Package["python-pip"], 129 | } 130 | 131 | exec { 132 | "beautifulsoup4": 133 | command => "/usr/bin/sudo pip install beautifulsoup4", 134 | require => Package["python-pip"] 135 | } 136 | 137 | exec { 138 | "mechanize": 139 | command => "/usr/bin/sudo pip install mechanize", 140 | require => Package["python-pip"] 141 | } 142 | 143 | exec { 144 | "scrapelib": 145 | command => "/usr/bin/sudo pip install scrapelib", 146 | require => Package["python-pip"] 147 | } 148 | 149 | exec { 150 | "Pyes": 151 | command => "/usr/bin/sudo pip install Pyes", 152 | require => Package["python-pip"] 153 | } 154 | 155 | } 156 | 157 | class pythononwheels { 158 | 159 | exec { 160 | "WebOb": 161 | command => "/usr/bin/sudo pip install WebOb", 162 | require => Package["python-pip"], 163 | } 164 | 165 | exec { 166 | "Mako": 167 | command => "/usr/bin/sudo pip install Mako", 168 | require => Package["python-pip"], 169 | } 170 | 171 | exec { 172 | "Beaker": 173 | command => "/usr/bin/sudo pip install Beaker", 174 | require => Package["python-pip"], 175 | } 176 | 177 | exec { 178 | "Nose": 179 | command => "/usr/bin/sudo pip install Nose", 180 | require => Package["python-pip"], 181 | } 182 | 183 | exec { 184 | "pow_devel": 185 | command => "/bin/true && cd /home/vagrant/ && /usr/bin/git clone https://github.com/pythononwheels/pow_devel.git && chown vagrant.vagrant -R pow_devel", 186 | require => [Package["git-core"], Exec["WebOb"], Exec["Mako"], Exec["Beaker"], Exec["Nose"]], 187 | onlyif => "/bin/true && test ! -d /home/vagrant/pow_devel", 188 | } 189 | 190 | exec { 191 | "pythonweb": 192 | command => "/bin/rm -f /tmp/PythonWeb.org-0.5.3-src.tar.gz && cd /tmp && /usr/bin/wget http://pythonweb.org/projects/webmodules/release/0.5.3/PythonWeb.org-0.5.3-src.tar.gz && /bin/tar xzf /tmp/PythonWeb.org-0.5.3-src.tar.gz && cd /tmp/PythonWeb.org/ && (echo y && echo y && yes '') | /usr/bin/sudo python setup.py install", 193 | require => Package["python"], 194 | } 195 | 196 | } 197 | 198 | 199 | class gui { 200 | 201 | package { 202 | "ubuntu-desktop": 203 | ensure => ["installed"], 204 | } 205 | 206 | package { 207 | [ "vim-gtk" ]: 208 | ensure => ["installed"], 209 | require => Package["ubuntu-desktop"] 210 | } 211 | 212 | exec { 213 | "repo": 214 | command => "/usr/bin/sudo add-apt-repository ppa:webupd8team/sublime-text-2 && /usr/bin/sudo apt-get -y update", 215 | require => Package["python-software-properties"], 216 | } 217 | 218 | package { 219 | [ "sublime-text" ]: 220 | ensure => ["installed"], 221 | require => [Package["ubuntu-desktop"], Exec["repo"]] 222 | } 223 | 224 | } 225 | 226 | class keepuptodate { 227 | 228 | exec { 229 | "apt-upgrade": 230 | command => "/usr/bin/sudo apt-get -y upgrade", 231 | require => [Package["ubuntu-desktop"], Exec["wx-from-source"]], 232 | } 233 | 234 | } 235 | 236 | class flask { 237 | 238 | exec { 239 | "fabric": 240 | command => "/usr/bin/sudo pip install Fabric", 241 | require => Package["python-pip"], 242 | } 243 | 244 | exec { 245 | "Flask": 246 | command => "/usr/bin/sudo pip install Flask", 247 | require => Package["python-pip"], 248 | } 249 | 250 | exec { 251 | "flask-sqlalchemy": 252 | command => "/usr/bin/sudo pip install Flask-SQLAlchemy", 253 | require => Package["python-pip"], 254 | } 255 | 256 | exec { 257 | "flask-script": 258 | command => "/usr/bin/sudo pip install Flask-Script", 259 | require => Package["python-pip"], 260 | } 261 | 262 | exec { 263 | "flask-wtforms": 264 | command => "/usr/bin/sudo pip install Flask-WTF", 265 | require => Package["python-pip"], 266 | } 267 | 268 | exec { 269 | "argparse": 270 | command => "/usr/bin/sudo pip install argparse", 271 | require => Package["python-pip"], 272 | } 273 | 274 | exec { 275 | "distribute": 276 | command => "/usr/bin/sudo pip install distribute", 277 | require => Package["python-pip"], 278 | } 279 | 280 | exec { 281 | "pyGeoDB": 282 | command => "/usr/bin/sudo pip install pyGeoDB", 283 | require => Package["python-pip"], 284 | } 285 | 286 | exec { 287 | "wtforms-recaptcha": 288 | command => "/usr/bin/sudo pip install wtforms-recaptcha", 289 | require => Package["python-pip"], 290 | } 291 | 292 | exec { 293 | "flup": 294 | command => "/usr/bin/sudo pip install flup", 295 | require => Package["python-pip"], 296 | } 297 | 298 | } 299 | 300 | 301 | 302 | include core 303 | include python 304 | include pythondev 305 | include networking 306 | include gui 307 | include keepuptodate 308 | include web 309 | include sql 310 | include mongodb 311 | 312 | #include science 313 | #include pythononwheels 314 | #include flask 315 | -------------------------------------------------------------------------------- /manifests/sql.pp: -------------------------------------------------------------------------------- 1 | 2 | class sql { 3 | 4 | exec { "apt-update-repo": 5 | command => "/usr/bin/apt-get -y update" 6 | } 7 | 8 | package { 9 | ["mysql-client", "mysql-server", "libmysqlclient-dev", "redis-server", "postgresql", "postgresql-client"]: 10 | ensure => installed, 11 | require => Exec['apt-update'] 12 | } 13 | 14 | service { "mysql": 15 | ensure => running, 16 | enable => true, 17 | require => Package["mysql-server"], 18 | } 19 | 20 | service { "redis-server": 21 | ensure => running, 22 | enable => true, 23 | require => Package["redis-server"], 24 | } 25 | 26 | service { "postgresql-8.4": 27 | ensure => running, 28 | enable => true, 29 | require => Package["postgresql"], 30 | } 31 | 32 | } 33 | 34 | 35 | class mongodb{ 36 | 37 | exec { "10gen-apt-key": 38 | path => "/bin:/usr/bin", 39 | command => "apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10", 40 | unless => "apt-key list | grep 10gen", 41 | } 42 | 43 | exec { "10gen-apt-repo": 44 | path => "/bin:/usr/bin", 45 | command => "echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' >> /etc/apt/sources.list", 46 | unless => "cat /etc/apt/sources.list | grep 10gen", 47 | require => Exec["10gen-apt-key"], 48 | } 49 | 50 | exec { "10gen-apt-update": 51 | path => "/bin:/usr/bin", 52 | command => "apt-get update", 53 | unless => "ls /usr/bin | grep mongo", 54 | require => Exec["10gen-apt-repo"], 55 | } 56 | 57 | package { "mongodb-10gen": 58 | ensure => installed, 59 | require => Exec["10gen-apt-update"], 60 | } 61 | 62 | service { "mongodb": 63 | enable => true, 64 | ensure => running, 65 | require => Package["mongodb-10gen"], 66 | } 67 | 68 | } 69 | 70 | 71 | 72 | --------------------------------------------------------------------------------