Giter VIP home page Giter VIP logo

inenv's Introduction

Inenv

Inenv is a multi-project virtual enviornment manager, switcher and executor.

Installation

Install inenv in your global python interpreter (make sure no virtualenvs are activated).

pip install inenv

Config file

In the root of your project add a file called inenv.ini.

[webproject]
deps: file:requirements.txt

[service]
deps: requests==1.4 file:subproject/app/requirements.txt
root: subproject/app # Optional, used by autojump
env: PYTHONPATH=dir:projects/search/app B=C

[py3app]
deps: aiohttp
python: python3

Project name

Each project is denoted by [project_name]. This venv contents will be in: /<projects_root>/.inenv/<project_name>

Python

You can specificy which python to use with the python argument. By default it uses your current python.

python: python3
python: python2

Deps

A project can have py deps. They can be a file (installed via pip install -r ) or a specific dep. They are installed in order separately. File paths are relative to the inenv.ini

Root

Root is the root of the project. If root is not set it will be the location of the first file dep and if that is not set it is the directory of the inenv.ini

Env

Key/value pairs that are set in the shell/process that is executed. These revert safely. Values can be prefixed with dir: to give the full path from the inenv.ini.

E.x. if /User/me/projects/django_app/inenv.ini dir: is the same as /User/me/projects/django_app/ So setting something like

env: PYTHONPATH=dir:subdir/app

Would actually set python path to:

PYTHONPATH= /User/me/projects/django_app/subdir/app

Hash

Sometimes you want to force the virtualenv to rebuild on all environments its run on. To do this you can set a hash for the venv:

hash: rev1

Going forward everytime you change the hash the venv will be rebuilt whenever an inenv command is run.

Useful commands

Execute something in an inenv without modifying current shell:

inenv <project_name> -- some command

Activating the venv in your current shell:

inenv <project_name>

To toggle autojump (cd into the root of the env after activating the venv):

inenv autojump

Deactivate the venv in your current shell:

deactivate

To install all requirements and setup the venv:

inenv init <project_name>

To remove and clean out all caches/installs:

inenv rm <project_name>

Get the root of the project venv:

inenv root <project_name>

View currently activated inenv:

echo $VIRTUALENV

inenv's People

Contributors

colcarroll avatar mattneary avatar mcamac avatar obi1kenobi avatar pnegahdar avatar yanivyacoby avatar

Watchers

 avatar

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.