{ "info": { "author": "Jonathan Robson", "author_email": "jnrbsn@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7" ], "description": "====================\nvirtualenv-activator\n====================\n\nThe default activate script for Python's `virtualenv `_ had some\nproblems that bugged me:\n\n- It doesn't work with ``virtualenv --relocatable`` so you can't move or rename your virtual\n environment directory.\n- I wanted an easy way to modify the shell environment (manually or automatically) inside a virtual\n environment and have it restored when I deactivate it.\n- Some other stuff I can't remember.\n\nThis package provides a replacement activate script that automatically...\n\n- makes your virtual environment relocatable and keeps it that way even when you install new stuff\n (caveat: don't move or rename your virtual environment while it's activated).\n- sources an optional ``etc/environment.sh`` file where you can modify your shell environment every\n time your virtual environment is activated.\n- restores your shell environment upon deactivation to the state it was in before you activated.\n\nExample\n-------\n\nCreate a new virtual environment, install ``virtualenv-activator`` inside it, and then activate it\nusing the ``etc/activate.sh`` script.\n\n::\n\n $ cd /path/to/my_code\n $ virtualenv venv\n $ venv/bin/pip install virtualenv-activator\n $ . venv/etc/activate.sh\n (my_code) $\n\nDeactivate as normal...\n\n::\n\n (my_code) $ deactivate\n\nWell, it's not as normal as it looks. There's some magic happening under the hood. Try setting an\nenvironment variable in the ``etc/environment.sh`` file (this file doesn't exist by default) in your\nvirtual environment, but also set the same variable to a different value while you're outside the\nvirtual environment, and then watch what happens the variable as you activate and deactivate the\nenvironment.\n\n::\n\n $ echo 'export MY_VAR=\"inside venv\"' > venv/etc/environment.sh\n $ export MY_VAR=\"outside venv\"\n $ echo $MY_VAR\n outside venv\n $ . venv/etc/activate.sh\n (my_code) $ echo $MY_VAR\n inside venv\n (my_code) $ export MY_VAR=\"manually set\"\n (my_code) $ echo $MY_VAR\n manually set\n (my_code) $ deactivate\n $ echo $MY_VAR\n outside venv\n $ . venv/etc/activate.sh\n (my_code) $ echo $MY_VAR\n inside venv\n\nBasically, you can put pretty much anything bash related (variables, aliases, functions, etc.) in\nthe ``etc/environment.sh`` script and it will only exist when your virtual environment is activated.\n\n**NOTE:** You may have noticed in the example above that the parent directory's basename was used in\nmy prompt instead of the basename of the virtual environment directory itself. It does this when you\nname your virtual environment something generic like ``venv``, in which case it wouldn't really be\nvery informative to have that in your prompt. It uses this regular expression to decide if the name\nis \"generic\": ``^\\.?v(irtual)?env$``\n\nSimple Mode\n-----------\n\nSimple mode is enabled via the ``VIRTUALENV_ACTIVATOR_SIMPLE`` environment variable. When this\nvariable is set, the activator doesn't try to restore your environment to its previous state. It\ndoesn't even provide a ``deactivate`` function. This is sometimes more desirable when running a\ndaemon for instance. Here's an example of a bash script you might write to wrap a daemon written in\nPython so that the virtual environment is automatically activated for the daemon:\n\n::\n\n #!/bin/bash\n export VIRTUALENV_ACTIVATOR_SIMPLE=1\n . /path/to/venv/etc/activate.sh\n my_daemon \"$@\"", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jnrbsn/virtualenv-activator", "keywords": "virtualenv", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "virtualenv-activator", "package_url": "https://pypi.org/project/virtualenv-activator/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/virtualenv-activator/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/jnrbsn/virtualenv-activator" }, "release_url": "https://pypi.org/project/virtualenv-activator/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "A better activate script for Python's virtualenv", "version": "0.1.2" }, "last_serial": 1079322, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7ebce52cd5c9848cc5c0fdf42bd1533c", "sha256": "67117fa8959edc992f423b9339b0251709cbff3aa29d1c3066e446ca29cc37f4" }, "downloads": -1, "filename": "virtualenv-activator-0.1.0.tar.gz", "has_sig": false, "md5_digest": "7ebce52cd5c9848cc5c0fdf42bd1533c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3536, "upload_time": "2014-04-22T05:09:12", "url": "https://files.pythonhosted.org/packages/67/45/37cd493c01088fae96923b7e749a68ffe017f3146615fee5e9c8ffde786d/virtualenv-activator-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "fed2ff610b3b9d8b112c2e34a342cfd4", "sha256": "11dc8375c4e2291ca03524b1dd120fc965fdc2dd99f7fa4159f337fa6fa15aae" }, "downloads": -1, "filename": "virtualenv-activator-0.1.1.tar.gz", "has_sig": false, "md5_digest": "fed2ff610b3b9d8b112c2e34a342cfd4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3653, "upload_time": "2014-04-22T23:26:07", "url": "https://files.pythonhosted.org/packages/13/d2/e5f85050d21d70f8cda1b2305fad32be1ac2e3a7c95ebee30aa0fd745dcb/virtualenv-activator-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f3bc32c3b7044aa611eb0198e3d91de8", "sha256": "4d1bc5928881e6751f124420ff38647c6ca049e6afdb7469142aa56a6b5c82ce" }, "downloads": -1, "filename": "virtualenv-activator-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f3bc32c3b7044aa611eb0198e3d91de8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3992, "upload_time": "2014-05-03T04:45:59", "url": "https://files.pythonhosted.org/packages/ab/32/e6c89a037bea873786565826afed1e3e0df76ecf441ae665d96afb90d012/virtualenv-activator-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f3bc32c3b7044aa611eb0198e3d91de8", "sha256": "4d1bc5928881e6751f124420ff38647c6ca049e6afdb7469142aa56a6b5c82ce" }, "downloads": -1, "filename": "virtualenv-activator-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f3bc32c3b7044aa611eb0198e3d91de8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3992, "upload_time": "2014-05-03T04:45:59", "url": "https://files.pythonhosted.org/packages/ab/32/e6c89a037bea873786565826afed1e3e0df76ecf441ae665d96afb90d012/virtualenv-activator-0.1.2.tar.gz" } ] }