{"id":26650651,"url":"https://github.com/berdario/pew","last_synced_at":"2025-03-25T02:02:03.156Z","repository":{"id":8474116,"uuid":"10074815","full_name":"pew-org/pew","owner":"pew-org","description":"A tool to manage multiple virtual environments written in pure python","archived":false,"fork":false,"pushed_at":"2024-05-28T13:21:47.000Z","size":664,"stargazers_count":1169,"open_issues_count":53,"forks_count":81,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-03-20T17:01:51.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pew-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-05-15T09:02:21.000Z","updated_at":"2025-03-04T10:53:55.000Z","dependencies_parsed_at":"2024-06-03T22:53:28.937Z","dependency_job_id":null,"html_url":"https://github.com/pew-org/pew","commit_stats":{"total_commits":348,"total_committers":47,"mean_commits":7.404255319148936,"dds":"0.41954022988505746","last_synced_commit":"b140a9a869c1f972b43fb8f2269bf41d8ac9500e"},"previous_names":["pew-org/pew","berdario/pew"],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pew-org%2Fpew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pew-org%2Fpew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pew-org%2Fpew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pew-org%2Fpew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pew-org","download_url":"https://codeload.github.com/pew-org/pew/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245383037,"owners_count":20606265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-25T02:01:58.507Z","updated_at":"2025-03-25T02:02:03.147Z","avatar_url":"https://github.com/pew-org.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":["Python"],"readme":"Pew - Python Env Wrapper\n========================\n\n[![PyPi version](http://img.shields.io/pypi/v/pew.svg)](https://pypi.python.org/pypi/pew)\n[![CI test status][github-ci-tests-badge]][github-ci-tests-link]\n[![PyPi](https://img.shields.io/pypi/format/pew.svg)](https://pypi.python.org/pypi/pew/)\n\n[github-ci-tests-badge]: https://github.com/berdario/pew/workflows/ci-tests/badge.svg\n[github-ci-tests-link]: https://github.com/berdario/pew/actions?query=workflow:ci-tests+branch:master\n\n[Releases \u0026 changelog](https://github.com/berdario/pew/releases)\n\nPython Env Wrapper is a set of commands to manage multiple [virtual environments](http://pypi.python.org/pypi/virtualenv). Pew can create, delete and copy your environments, using a single command to switch to them wherever you are, while keeping them in a single (configurable) location.\n\nVirtualenvs makes it easier to work on more than one project at a time without introducing conflicts in their dependencies.\n\nPew is completely shell-agnostic and thus works on bash, zsh, fish, powershell, etc.\n\nInstallation\n------------\n\n### Nix (Linux and Macos)\n\nYou can use Nix to install Pew on [Nixos](http://nixos.org/) as well as [other Linux distributions or Macos](http://nixos.org/nix/download.html):\n\n    nix-env --install --attr pew\n\n### Arch linux\n\nFor Archlinux, there's an [AUR package](https://aur.archlinux.org/packages/python-pew/)\n\n### Pypi\n\n_Pew and its dependencies rely on a couple of features of pip/setuptools which might not be available on old versions. In case your distribution doesn't ship with one recent enough, you'll probably want to run `pip install --upgrade pip` before the installation._\n\nIf you cannot upgrade the version of setuptools on your system, and one of the packages listed below is of no use to you, I suggest to use [`pipsi`](https://pypi.python.org/pypi/pipsi) rather than plain `pip`\n\n\n    pipsi install pew\n\nSee the [troubleshooting](#troubleshooting) section, if needed.\n\n\nUsage\n-----\n\n### Which SHELL is Pew going to use?\n\nOk, Pew is shell-agnostic, but how is your shell going to be selected?\n\nLook for the `SHELL` environment variable: on most unix-like systems it's already defined in a login shell, and you can verify it with commands like:\n\n    env | grep SHELL\n\nor\n\n    python3 -c 'import os;print(os.environ.get(\"SHELL\",\"No shell defined\"))'\n\nSince that variable is not commonly used on Windows, we're detecting the parent process from which pew has been invoked and use that as the user's preferred shell. If `CMDER_ROOT` is defined this will select Cmder (a custom configuration of `cmd.exe`).\n\nIn all other cases we default instead to `sh`.\n\n### Windows/Cygwin notes\n\nA python installed from the normal `.exe` file [behaves differently](https://github.com/berdario/pew/issues/80#issuecomment-168279648) from a python installed inside Cygwin. For this reason if you want to use Pew inside a Cygwin shell, you should use a Cygwin python, and if you want to use it inside Powershell, you should use your normal Python install, and avoid a Cygwin one.\n\nCommon workflow\n---------------\n\nYou can create a new virtualenv, with a non-default python and specifying some packages to be installed in it, like this:\n\n    ~\u003e pew new --python=pypy3 -i django myproject\n    created virtual environment PyPy3.6.9.final.0-64 in 817ms\n    creator PyPy3Posix(dest=/home/tadej/.local/share/virtualenvs/myproject, clear=False, global=False)\n    seeder FromAppData(extra_search_dir=/usr/share/python-wheels,download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/tadej/.local/share/virtualenv)\n        added seed packages: pip==21.2.1, setuptools==57.4.0, wheel==0.36.2\n    activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator\n    Collecting django\n    Downloading Django-3.2.7-py3-none-any.whl (7.9 MB)\n        |████████████████████████████████| 7.9 MB 1.8 MB/s\n    Collecting asgiref\u003c4,\u003e=3.3.2\n    Downloading asgiref-3.4.1-py3-none-any.whl (25 kB)\n    Collecting pytz\n    Downloading pytz-2021.1-py2.py3-none-any.whl (510 kB)\n        |████████████████████████████████| 510 kB 10.6 MB/s\n    Collecting sqlparse\u003e=0.2.2\n    Downloading sqlparse-0.4.2-py3-none-any.whl (42 kB)\n        |████████████████████████████████| 42 kB 833 kB/s\n    Collecting typing-extensions\n    Downloading typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)\n    Installing collected packages: typing-extensions, sqlparse, pytz, asgiref, django\n    Successfully installed asgiref-3.4.1 django-3.2.7 pytz-2021.1 sqlparse-0.4.2 typing-extensions-3.10.0.2\n    WARNING: You are using pip version 21.2.1; however, version 21.2.4 is available.\n    You should consider upgrading via the '/home/tadej/.local/share/virtualenvs/myproject/bin/pypy3 -m pip install --upgrade pip' command.\n    Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.\n\nOnce inside, you can check the current Python version, list the packages present in its python's site-packages directory, and install additional packages like this:\n\n    myproject ~\u003e python -V\n    Python 3.6.9 (831ff17f8cd1, May 26 2021, 11:41:48)\n    [PyPy 7.3.1 with GCC 10.3.1 20210422 (Red Hat 10.3.1-1)]\n    myproject ~\u003e pew lssitepackages\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/Django-3.2.7.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/__pycache__\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/_distutils_hack\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/_virtualenv.pth\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/_virtualenv.py\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/asgiref\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/asgiref-3.4.1.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/backports\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/backports.entry_points_selectable-1.1.0.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/clonevirtualenv.py\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/distlib\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/distlib-0.3.3.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/distutils-precedence.pth\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/django\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/easy-install.pth\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/filelock\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/filelock-3.1.0.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/importlib_metadata\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/importlib_metadata-4.8.1.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/importlib_resources\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/importlib_resources-5.2.2.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/pew.egg-link\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/pip\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/pip-21.2.1.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/pip-21.2.1.virtualenv\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/pkg_resources\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/platformdirs\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/platformdirs-2.4.0.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/pytz\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/pytz-2021.1.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/setuptools\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/setuptools-57.4.0.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/setuptools-57.4.0.virtualenv\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/six-1.16.0.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/six.py\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/sqlparse\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/sqlparse-0.4.2.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/typing_extensions-3.10.0.2.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/typing_extensions.py\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/virtualenv\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/virtualenv-20.8.1.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/virtualenv_clone-0.5.7.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/wheel\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/wheel-0.36.2.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/wheel-0.36.2.virtualenv\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/zipp-3.6.0.dist-info\n    /home/tadej/.local/share/virtualenvs/myproject/site-packages/zipp.py\n    myproject ~\u003e pip install pdbpp\n    Collecting pdbpp\n    Downloading pdbpp-0.10.3-py2.py3-none-any.whl (23 kB)\n    Collecting fancycompleter\u003e=0.8\n    Downloading fancycompleter-0.9.1-py3-none-any.whl (9.7 kB)\n    Collecting wmctrl\n    Downloading wmctrl-0.4.tar.gz (5.4 kB)\n    Collecting pygments\n    Downloading Pygments-2.10.0-py3-none-any.whl (1.0 MB)\n        |████████████████████████████████| 1.0 MB 2.4 MB/s\n    Collecting pyrepl\u003e=0.8.2\n    Downloading pyrepl-0.9.0.tar.gz (48 kB)\n        |████████████████████████████████| 48 kB 3.0 MB/s\n    Building wheels for collected packages: pyrepl, wmctrl\n    Building wheel for pyrepl (setup.py) ... done\n    Created wheel for pyrepl: filename=pyrepl-0.9.0-py3-none-any.whl size=59906 sha256=de1c4017634f07823025e3cd6db0221c5ec6eafaade32f48c306b4774809c0db\n    Stored in directory: /home/tadej/.cache/pip/wheels/bd/32/c9/a638d4a50ae3bf39e8d6ac32f889746687f858794f2a841f84\n    Building wheel for wmctrl (setup.py) ... done\n    Created wheel for wmctrl: filename=wmctrl-0.4-py3-none-any.whl size=3858 sha256=e5aee6309b7b919a44423b524b6d0b66a238e6efdcafcefee34757cf2057f408\n    Stored in directory: /home/tadej/.cache/pip/wheels/1c/8e/da/50ccb9bb858eb7462f6047965be9badfa6f4d36d707ac5c5a2\n    Successfully built pyrepl wmctrl\n    Installing collected packages: pyrepl, wmctrl, pygments, fancycompleter, pdbpp\n    Successfully installed fancycompleter-0.9.1 pdbpp-0.10.3 pygments-2.10.0 pyrepl-0.9.0 wmctrl-0.4\n    myproject ~\u003e pip freeze\n    asgiref==3.4.1\n    backports.entry-points-selectable==1.1.0\n    cffi==1.14.0\n    distlib==0.3.3\n    Django==3.2.7\n    fancycompleter==0.9.1\n    filelock==3.1.0\n    greenlet==0.4.13\n    importlib-metadata==4.8.1\n    importlib-resources==5.2.2\n    pdbpp==0.10.3\n    platformdirs==2.4.0\n    Pygments==2.10.0\n    pyrepl==0.9.0\n    pytz==2021.1\n    readline==6.2.4.1\n    six==1.16.0\n    sqlparse==0.4.2\n    typing-extensions==3.10.0.2\n    virtualenv==20.8.1\n    virtualenv-clone==0.5.7\n    wmctrl==0.4\n    zipp==3.6.0\n    myproject ~\u003e ^D\n\nYou can also specify a requirements file, to be passed on to pip, and activate another virtualenv with workon:\n\n    ~\u003e pew new -r ~/Projects/topaz/requirements.txt topaz\n    New python executable in topaz/bin/python\n    [SNIP]\n    Successfully installed rply pytest invoke requests py\n    Cleaning up...\n    Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.\n    topaz ~\u003e ^D\n\n    ~\u003e pew workon myproject\n    Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.\n    myproject ~\u003e\n\nSince 0.1.16, Pew integrates Pythonz, which allows you to easily install a new python version (only on linux and macosx):\n\n    ~\u003e pew install 2.6.1 --type pypy\n    WARNING: Linux binaries are dynamically linked, as is usual, and thus might not be usable due to the sad story of linux binary    compatibility,  check the PyPy website for more information\n    Downloading pypy-2.6.1-linux64.tar.bz2 as /home/dario/.pythonz/dists/pypy-2.6.1-linux64.tar.bz2\n    ########################################################################## 100%\n    Extracting pypy-2.6.1-linux64.tar.bz2 into /home/dario/.pythonz/build/PyPy-2.6.1\n    Installing PyPy-2.6.1 into /home/dario/.pythonz/pythons/PyPy-2.6.1\n\n    Installed PyPy-2.6.1 successfully.\n    ~\u003e pew new --python=$(pythonz locate 2.6.1 --type pypy) latest_pypy\n    Running virtualenv with interpreter /home/dario/.pythonz/pythons/PyPy-2.6.1/bin/python\n    New pypy executable in latest_pypy/bin/python\n    Also creating executable in latest_pypy/bin/pypy\n    Installing setuptools, pip, wheel...done.\n    Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.\n    latest_pypy ~\u003e python -V\n    Python 2.7.10 (f3ad1e1e1d62, Aug 28 2015, 10:45:29)\n    [PyPy 2.6.1 with GCC 4.8.4]\n\n\nCommand Reference\n-----------------\n\nWhen invoked without arguments `pew` will output the list of all commands with each one's description\n\n### new ###\n\nCreate a new environment, in the WORKON_HOME.\n\n`usage: pew new [-hd] [-p PYTHON] [-i PACKAGES] [-a PROJECT] [-r REQUIREMENTS] envname`\n\nThe new environment is automatically activated after being initialized.\n\nThe `-a` option can be used to associate an existing project directory with the new environment.\n\nThe `-i` option can be used to install one or more packages (by repeating the option) after the environment is created.\n\nThe `-r` option can be used to specify a text file listing packages to be installed. The argument value is passed to `pip -r` to be installed.\n\n### workon ###\n\nList or change working virtual environments.\n\n`usage: pew workon [-h] [--no-cd] [envname]`\n\nIf no `envname` is given the list of available environments is printed to stdout. If `-n` or `--no-cd` is provided, current directory is not changed even if a project path is associated with `envname`.\n\n### mktmpenv ###\n\nCreate a temporary virtualenv.\n\n`usage: pew mktmpenv [-h] [-p PYTHON] [-i PACKAGES] [-a PROJECT] [-r REQUIREMENTS]`\n\n### ls ###\n\nList all of the environments.\n\n`usage: pew ls [-h] [-b | -l]`\n\nThe `--long` options will print each virtualenv side-by-side with its Python version and the contents of its site-packages\n\n### show ###\n\n`usage: pew show [env]`\n\n### inall ###\n\nRun a command in each virtualenv.\n\n`usage: pew inall [command]`\n\n### in ###\n\nRun a command in the given virtualenv.\n\n`usage: pew in [env] [command]`\n\n### rm ###\n\nRemove one or more environments, from the WORKON_HOME.\n\n`usage: pew rm envs [envs ...]`\n\nYou have to exit from the environment you want to remove.\n\n### install ###\nUse Pythonz to download and build a Python vm\n\n`usage: pew install [options] version`\n\nTo install Python3.8.0\n\n`pew install 3.8.0`\n\nTo install Pypy:\n\n`pew install 2.6.1 --type pypy`\n\n### list_pythons ###\nList the pythons installed by Pythonz\n\n`usage: pew list_pythons [options]`\n\nYou can list all the Pythons available to install with `-a` or `--all-versions`\n\n### locate_python ###\nLocate the path for the python version installed by Pythonz\n\n`usage: pew locate_python [options] version`\n\n### cp ###\n\nDuplicate an existing virtualenv environment. The source can be an environment managed by virtualenvwrapper or an external environment created elsewhere.\n\n_Copying virtual environments is not well supported. Each virtualenv has path information hard-coded into it, and there may be cases where the copy code does not know to update a particular file. Use with caution._\n\n`usage: pew cp [-hd] source [targetenvname]`\n\nTarget environment name is required for WORKON_HOME duplications. However, target environment name can be omitted for importing external environments. If omitted, the new environment is given the same name as the original.\n\n### sitepackages_dir ###\n\nReturns the location of the currently active's site-packages\n\n### lssitepackages ###\n\nEquivalent to `ls $(sitepackages_dir)`.\n\n### add ###\n\nAdds the specified directories to the Python path for the currently-active virtualenv.\n\n`usage: pew add [-h] [-d] dirs [dirs ...]`\n\nSometimes it is desirable to share installed packages that are not in the system `site-packages` directory and which should not be installed in each virtualenv. One possible solution is to symlink the source into the environment `site-packages` directory, but it is also easy to add extra directories to the PYTHONPATH by including them in a `.pth` file inside `site-packages` using `pew add`.\n\nThe `-d` flag removes previously added directories.\n\nThe directory names are added to a path file named `_virtualenv_path_extensions.pth` inside the site-packages directory for the environment.\n\n### toggleglobalsitepackages ###\n\nControls whether the active virtualenv will access the packages in the global Python `site-packages` directory.\n\n`usage: pew toggleglobalsitepackages [-q]`\n\n\n### mkproject ###\n\nCreate a new virtualenv in the `WORKON_HOME` and project directory in `PROJECT_HOME`.\n\n`usage: pew mkproject [-hd] [-p PYTHON] [-i PACKAGES] [-a PROJECT] [-r REQUIREMENTS] [-t TEMPLATES] [-l] envname`\n\nThe template option may be repeated to have several templates used to create a new project. The templates are applied in the order named on the command line. All other options are passed to `pew new` to create a virtual environment with the same name as the project.\n\nA template is simply an executable to be found in `WORKON_HOME`, it will be called with the name of the project, and the project directory as first and second argument, respectively. A `template_django` script is given as an example inside the `pew` package.\n\n### setproject ###\n\nBind an existing virtualenv to an existing project.\n\n`usage: pew setproject [virtualenv_path] [project_path]`\n\nWhen no arguments are given, the current virtualenv and current directory are assumed.\n\n### getproject ###\n\nReturn a virtualenv's project directory.\n\n`usage: pew getproject [env]`\n\nWhen no arguments are given, the current virtualenv is assumed.\n\n### restore ###\n\nTry to restore a broken virtualenv by reinstalling the same python\nversion on top of it\n\n`usage: pew restore env`\n\n### rename ###\n\nRename a virtualenv (by copying it over to the new name, and deleting the old one)\n\n`usage: pew rename source target`\n\n### wipeenv ###\n\nRemove all installed packages from the current (or supplied) env.\n\n`usage: pew wipeenv [env]`\n\n### shell_config ###\n\nPrints the path for the current $SHELL helper file\n\n`usage: pew shell_config`\n\n### dir ###\n\nPrints the path for the supplied env\n\n`usage: pew dir env`\n\n\nConfiguration\n-------------\n\nYou can customize pew's virtualenvs directory location, with the `$XDG_DATA_HOME` or `$WORKON_HOME` environment variables, and the locations of new projects created with mkproject by setting `$PROJECT_HOME` (otherwise, the current directory will be selected).\n\n\nTroubleshooting\n---------------\n\n### The environment doesn't seem to be activated ###\n\nIf you've defined in your shell rc file to export a PATH location that might shadow the executables needed by pew (or your project), you might find that when getting into the environment, they will still be at the head of the PATH.\n\nThere're multiple way to overcome this issue:\n\n* Move your export statements into the profile (`.bash_profile` and `.zprofile` for bash and zsh respectively, or in fish wrap your statements in a `if status --is-login` block ) and set up your terminal emulator to launch your shell as a login shell\n* Change your exports to put the new location at the tail, instead of the head of the PATH, e.g.: `export PATH=${PATH}:/usr/bin`\n* Change the files your OS provides to setup the base environment (it might be useful to look into `/etc/paths.d`, `/etc/profile`, and [environment.plist](http://stackoverflow.com/a/8421952/293735))\n\nIf you're running the `zsh` configuration tool `prezto`, and/or you're on MacOSX, [you might want to read this](https://github.com/thoughtbot/dotfiles/pull/426#issue-109716011) (it's about another project for handling dotfiles, but the misconfiguration described is quite similar to one witnessed on other OSX/prezto systems).\n\n\n### pkg_resources.DistributionNotFound: virtualenv ###\n\nThis might happen after a Python update, especially on MacOSX, upgrading `setuptools` might fix that (you should need superuser permissions to do it)\n\n`easy_install -U setuptools`\n\nor\n\n`pip install --upgrade setuptools`\n\n### Other issues ###\n\nCongratulations! You found a bug, please [let me know](https://github.com/berdario/pew/issues/new) :)\n\nRunning Tests\n-------------\n\nThe test suite for `pew` uses [tox](http://codespeak.net/tox). Most tests are actually integration tests that will fork shells, create virtualenvs and in some cases even download python packages from Pypi. The whole test suite takes around 1 minute to run on a single interpreter.\n\nWith every commit and pull request, the test suite is run over all supported interpreters on GitHub Actions (which runs tests on Linux and Windows).\n\nTo run individual test scripts, run from the top level directory of the repository a command like:\n\n`tox tests/test_setproject.py`\n\nTo run tests under a single version of Python, specify the appropriate environment when running `tox`:\n\n`tox -e py38`\n\nCombine the two modes to run specific tests with a single version of Python:\n\n`tox -e py38 tests/test_setproject.py`\n\nYou can also filter them:\n\n`tox -e py38 -- -k workon`\n\nAdd new tests by modifying an existing file or creating new script in the tests directory.\n\n\nDisplay the environment name in the terminal prompt\n---------------------------------------------------\n\n### bash/zsh ###\n\nThe first run setup should take care of this for you.\n\nYou can do it manually by appending to your `.bashrc`/`.zshrc`\n\n`source $(pew shell_config)`\n\n#### fish ####\n\nJust like for bash/zsh, but since fish uses a `fish_prompt` function and not a `PS1` environment variable, the setup will only make available to you a fish function `pew_prompt`. Just use its output in the `fish_prompt` function.\n\n#### powershell prompt ####\n\nAdd this to a prompt function:\n\n`Write-Host -NoNewLine -f blue ([System.IO.Path]::GetFileName($env:VIRTUAL_ENV))`\n\n### no hooks (for now) ###\n\n(There's currently a Pull Request open for it)\n\nAdding hooks for installing some packages on each new virtualenv creation is quite easy, but I couldn't find some comprehensive hook examples, and virtualenvwrapper's hook implementation lets the hook return a script to be sourced.\n\nThis could be handled by (instead of getting back a script to be sourced) getting back an environment/list of key-values to be applied when invoking inve.\n\nBut to handle just the simple case, using the existing virtualenvwrapper's infrastructure (which relied on stevedore) seemed like overkill, and given that the most interesting virtualenvwrapper's extensions have been merged to the trunk at the end, and that I never used virtualenvwrapper's hook first hand, I decided to skip them, at least for now.\n\n\nThanks\n------\n\nEveryone who submitted patches/PR, as of September 2015:\n\n- José Luis Lafuente\n- Arthur Vuillard\n- Jakub Stasiak\n- Ryan Hiebert\n- Michael Hofer\n- Daniel Harding\n- Timothy Corbett-Clark\n- Simon Junod\n- Robin\n- Matei Trușcă\n- Lucas Cimon\n- Alexandre Decan\n- Ashwin Vishnu Mohanan\n\n\nThanks also to Michael F. Lamb for his thought provoking gist and to Doug Hellman for virtualenvwrapper\n\nRationale\n---------\n\nPew is written in pure python and leverages [inve](https://gist.github.com/datagrok/2199506): the idea for a better activate script.\n\nPew was originally a rewrite of virtualenvwrapper, the advantage is that pew doesn't hook into a shell, but is only a set of commands, thus completely shell-agnostic:\n\nIt works on bash, zsh, fish, powershell, etc.\n\nThanks to using Python libraries and setuptools for dependency management, to Python stricter error handling and the fact that \"shelling out\" let us avoid keeping track of the previous environment variable values, pew code is much shorter and easier to understand than [virtualenvwrapper](http://virtualenvwrapper.readthedocs.org/)'s. How many Python programmers know at a glance what does `\"${out_args[@]-}\"` do? Or `eval \"envname=\\$$#\"`? Or [all other bash quirks](http://mywiki.wooledge.org/BashPitfalls) for that matter?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberdario%2Fpew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberdario%2Fpew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberdario%2Fpew/lists"}