Git Product home page Git Product logo

re-env's Introduction

re-env

This is a simple bash function that solves the problem of activating a Python virtualenv that is in the current directory or a parent directory. It recursively searches for a directory named venv and activates the bin/activate script inside that directory.

Rather than storing all virtualenvs in a single directory, as required by the workon script included with virtualenv-wrappers, this script assumes that the virtualenv for a given codebase is in the same directory as the code it is being maintained for. For example, my code looks something like this:

/home/dusty/code/

  • project1 | + src | | + pkg1 | | + pkg2 | + doc | + venv
  • project2 | + src | + venv27 | + venvpypy
  • project3 | + venv

If I am in the code/project1/src/pkg1 directory, I can run the v function and it will find and activate the virtualenv script in code/project1/venv/bin/activate. If I am in the project2/src directory and I run the v venvpypy command, it will find and activate the virtualenv in code/project2/venvpypy/bin/activate.

The easiest way to install is to copy the function in your ~/.bashrc.

Note that I am a Python programmer, this may not be the prettiest bash you've seen.

re-env's People

Stargazers

eg avatar  avatar  avatar Antoine Pérus avatar Scott Sharkey avatar

Watchers

James Cloos avatar

Forkers

marcelhuberfoo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.