Virtualenv bootstrapper
Project description
When you are about to create a python program with some pip modules, you may setup virtualenv and install some pip modules within that virtualenv manually. This module automatically creates an environment and enables it.
Setup
Requirements
python 2.7 or later
pip
virtualenv
Installation
$ pip install vebootstrap
Usage
Importing
Insert following line into head of your script file, and create a requirements.txt in same directory as necessary.
import vebootstrap
Running that script, it creates a virtualenv and modules will be installed automatically.
Not Importing
If you do not want to add a line, run following command and then virtualenv will be prepared.
python -m vebootstrap [script file]
Example
Case: you want to create a script using `requests` module. (http request library)
Create a script file (eg. get_yahoo.py)
import vebootstrap # you must write this sentence at the first line import requests print(requests.get(’http://yahoo.co.jp’).content[:100])
Create a requirements.txt
requests
Run a script
python get_yahoo.py
At the first time, virtualenv will be created and modules will be installed. And you get a first line of html of the Yahoo.
Extra Usage
vebootstrap supports creating virtualenv bootstrap script. Run a following command in your scripting directory. The bootstrap script involving requirements.txt will be created.
python -m vebootstrap.create
–after-install option allows you to add another process into the bootstrap script. Please see help.
python -m vebootstrap.create –help
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.